Detect flashlight on/off

Status
Not open for further replies.

nlecaude

Well-known member
Hello,

I'm working on a project where I need to detect someone turning a flashlight on or off.

The flashlight circuit is quite basic:
cub_electricity_lesson05_activity2_fig2.jpg

It uses a 3V battery.

I understand that I'll need to connect the negative side of the battery to the ground of the Teensy. I also assume that I'll need to set my digital pin as a pulldown rather than a pullup.
The one thing I'm not sure, given the above schematic, what spot do I need to connect to my digital pin ? Do I need more components ?
(The teensy will be powered separately from the flashlight)

Thanks !
 
Hi, you don't need a pull-up or pull-down. Connect a digital pin to the right side of the switch, between the switch and the lamp. I suggest putting 1k in series to the pin (not in series inside the part of the schematic you posted!). The digital Pin will read high if the Lamp is off and low when it's on.
Ben
 
Status
Not open for further replies.
Back
Top