Go Down

Topic: Photocell as on/off switch (Read 2064 times) previous topic - next topic

barrysfarm

The project I'm working on involves playing music using an arduino and a adafruit wave board. It also uses a photo cell to play the music. It needs to be battery powered, so I'm trying to think of ways to maximize the battery life.

I got the system to work by using the photo cell as a sensor using the A1 input, and reading the value. However, this means that the arduino is always running, and I'd presume it'll drain the battery really quickly.

Is there any way I can use a photocell as an off/off switch for the arduino itself? So, when it goes dark, the battery isn't being used, and when light hits the photocell the arduino turns on.

baum

You could rig something up with a p channel mosfet connected to an interrupt. If dark, low resistance, high input voltage, mosfet turns off. If light, high resistance, low input voltage, mosfet turns on, interrupt triggered. You could put MCU in sleep mode to save power when its off.

Grumpy_Mike

You are always going to use some power checking the photo cell is dark, it's like a stand by state.
It is best if this state is handled while the processor is stopped, however this circuitry will still need power.

One approach is to send the arduino to sleep for say one second, then wake up check the photo cell and go back to sleep again. You can do this on a timer interrupt cycle. It saves some power.

Go Up