this was moderately expensive
edit: two more pictures showing lamps which would turn off when the bonemeal or tnt is running low. obviously if you run the farm with no bonemeal nothing happens. if you run the farm without tnt, it'll break. for this reason, i built in a big margin into the tnt meter -- so if it's on, there's at least enough tnt 20 hours of wood farming.
ideally, although i haven't done it yet, it would be possible to set up some wiring so that if the tnt run out, then power is cut to the wood farm and it stops working.