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.

LM2596 Variable Voltage Regulator with Built in Voltmeter

We have just purchased one of the voltage regulators pictured below for REUK product testing. This is a variable voltage regulator which will accept inputs of from 4-40V and output a user set voltage from 1.3-37V at up to 2 Amps. (Input voltage must be at least 1.5V higher than user set output voltage)

lm2596 voltage regulator with voltmeter display
This device is just 3.5 x 6.0cm in size and includes a display to 0.1V resolution of the measured input and output voltages AND it costs a hard to believe £3.51 delivered to anywhere in the world from China.

We will add lots of information about this device together with some photos just as soon as we are done testing. For now, here is a link to get your hands on one or more of these LM2596 regulators to test for yourselves.