So I'm making a simple laser tripwire alarm as a school project. Decided to use an Arduino for part of it. So here's what I've done so far:
I've built myself a 555 astable, it produces a tone from a loudspeaker. The Arduino will drive it. I need to write some code so that an LDR is being read, and when the laser beam is broken, it will cause the pins to the 555 to go high, and then latch, until the alarm is reset from the power. I'm a complete programming noob, (I've done a little in python, that's about it) and I really am lost.
Ps. It's due in tomorrow. I knew I shouldn't have left it till the last minute =(
If your question is how do I sense the resistance of the LDR, then my answer is use a voltage divider and one of the analog pins. The value of the resistor should be approximately the resistance of the LDR in ambient light.
If you can do away with the 555 timer and use the arduino command/function, named "tone()", you can drive your speaker directly with an arduino pin at any frequency for any amount of duration, including on until you turn it off otherwise. This only works with one tone played at a pin, you can't play two tones, one on each pin so no polynones
Have a few hundred ohm resistance to protect the arduino pin.
liudr:
If you can do away with the 555 timer and use the arduino command/function, named "tone()", you can drive your speaker directly with an arduino pin at any frequency for any amount of duration, including on until you turn it off otherwise. This only works with one tone played at a pin, you can't play two tones, one on each pin so no polynones
Have a few hundred ohm resistance to protect the arduino pin.
Nah, can't do that. I need at least 2 process blocks in my circuit. The 555 is 1 of these blocks.