Pages: [1]   Go Down
Author Topic: Photocell as on/off switch  (Read 1982 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Connecticut
Offline Offline
Edison Member
*
Karma: 17
Posts: 1216
RTFD (Datasheet in our case)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 634
Posts: 34554
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: