Project of the Day – Dawn / Dusk Raspberry Pi Switch on Device

Pictured below is a device designed to switch on a Raspberry Pi for a user programmable number of minutes at dawn and dusk as detected by a light detector. Under normal circumstances the Raspberry Pi itself could be used to detected day and night, but although the Pi is a very very low powered computer (2.5 Watts), that is a relatively large amount of power if it is to be on continuously 24 hours per day powered by a solar charged battery, as was our customer’s requirement.

dawn and dusk detecting controller to power a Raspberry Pi

Instead of leaving the Raspberry Pi running continuously, this intermediate controller circuit supplies power to the Pi only when required, and draws only a few milliAmps of current rather than hundreds of milliAmps of the Raspberry Pi.

The controller circuit we have built is based around a Picaxe-08M2 microcontroller. The user can set the light level threshold at which dawn and dusk are detected (using similar logic to that successfully used in our dawn dusk relay controller), and the number of minutes that the Raspberry Pi is to be powered at dawn and at dusk.

A MOSFET is used to supply a 12V output at dawn and dusk which passes through the 5V from 12V regulator pictured below to supply the required 5 Volts DC to the Raspberry Pi.

5-volt-regulator-for-raspberry-pi

Normally we would fit voltage regulation directly on our circuit board, but it is not possible to buy even half the components on this ready made 3 Amp rated 90% efficient 3.3V / 5V from 12V regulator (priced at £1.12 including delivery) so we used that. We just soldered 12V+, 12V-, and 5V+ leads to the regulator, and screw-in connectors on the output side of our controller to hook it up. A couple of terminals on our board then supply the regulated 5V voltage to the Raspberry Pi at dawn and dusk.

This will be put to use in a hen house door controller. The Raspberry Pi, extended with a Gertboard attached to the GPIO interface will be used to control a motor which will open/close a horizontally sliding door. Microswitches will be used to detect when the door is fully open/closed, and the Raspberry Pi will give feedback to the user by sending him an email. A camera may also be added to the setup in the future.


Leave a Reply