I'm working on garage parking system. When my car enters the garage, it will break a laser beam that is shooting across the entry to the garage. When the car is far enough in that it un-breaks the laser beam, I'll sound a chime or light sequence or something to let me know that I'm at the perfect distance to stop (maximum space ahead of the car). I plan to use an ardunio. So my first step is building a laser detector circuit that the arduino will be able to read high/low to know the presence of the laser.
I was able to turn on an LED when the laser hits the phototransistor. But it fades in and out, it's not a clear on/off. So I added an optocoupler, thinking this would act as a relay and give me a clean on/off signal. It's better, and it got better still when I added a pull down resistor on the input (R3). Before I added that, the LED was on softly all the time from ambient light.
I've mocked it up in tinkercad here: https://www.tinkercad.com/things/lY...=3CTny8QYRZ7wTofR8G5GDfaxfs7r_muoMDluQkF2PUI=
FYI The led resistor and the optocoupler resistor are around 200 ohms. It seems to make no difference what value I give them in the simulator. The pull down resistor is 4k. The power supply is 5v.
Suggestions for improvement?
More explanation below:
no light to the phototransistor
full light to the phototransistor
voltage on the LED anode is shown on the oscilloscope. No light hitting the sensor gives a reading around 3.5v When the maximum amount of laser light is shown into the sensor, it reads around 1v. When shooting the laser across the garage door, of course there will be less light entering the sensor than in this test.
I was able to turn on an LED when the laser hits the phototransistor. But it fades in and out, it's not a clear on/off. So I added an optocoupler, thinking this would act as a relay and give me a clean on/off signal. It's better, and it got better still when I added a pull down resistor on the input (R3). Before I added that, the LED was on softly all the time from ambient light.
I've mocked it up in tinkercad here: https://www.tinkercad.com/things/lY...=3CTny8QYRZ7wTofR8G5GDfaxfs7r_muoMDluQkF2PUI=
FYI The led resistor and the optocoupler resistor are around 200 ohms. It seems to make no difference what value I give them in the simulator. The pull down resistor is 4k. The power supply is 5v.
Suggestions for improvement?
More explanation below:
no light to the phototransistor
full light to the phototransistor
voltage on the LED anode is shown on the oscilloscope. No light hitting the sensor gives a reading around 3.5v When the maximum amount of laser light is shown into the sensor, it reads around 1v. When shooting the laser across the garage door, of course there will be less light entering the sensor than in this test.