I am just starting out in electronics, so forgive my questions about relatively basic things.
I am trying to electrically control a "contact closure" sensor. Currently the sensor is set up with a reed switch and magnet. I'd like to remove the reed switch and magnet and replace that with a visible laser/photocell switch.
I was able to design a circuit that works...well, most of the time. It works on the breadboard, but it seems to have problems in the long term when I built a PCB and I can't figure out why this is. One of my challenges is that the voltage is very low between the contact closure pads. Just 0.45V.
So, my plan is the following:
1) Build a typical voltage divider circuit off a 3VDC source with a 10K resistor and a CdS photocell with a range of Rdark=2,000,000ohms, Rlaser=100ohms, Rambient=9000ohms. I've done the math and that's where I came up with the 10K resistor (probably should be more like 20K, but it's what I've got). The photocell is on the ground side of the voltage divider, so that Vout is ~2.9V when dark.
2) Use the Vout of the voltage divider circuit to drive a NPN 2n3904 transistor which will switch on/off the contact closure pads.
It works, then it doesn't work, then it works, then it doesn't work. I can't tell if the circuit is incorrectly designed, or the transistor I have is flaky. I do know that the sensor module works if I put the reed sensor back in.
I should mention that I have the photocell very well protected from stray ambient light. Also, the capacitor in the schematic is optional and helps me control how quickly the sensor module detects a break in the laser. I've been experimenting with different values there.
I'll see if I can't attach a schematic...
Any comments welcome.
![sensor-schematic.jpg sensor-schematic.jpg](https://www.electro-tech-online.com/data/attachments/16/16097-46d9d20abff37d2c4e77a4358ce0b5b3.jpg)
I am trying to electrically control a "contact closure" sensor. Currently the sensor is set up with a reed switch and magnet. I'd like to remove the reed switch and magnet and replace that with a visible laser/photocell switch.
I was able to design a circuit that works...well, most of the time. It works on the breadboard, but it seems to have problems in the long term when I built a PCB and I can't figure out why this is. One of my challenges is that the voltage is very low between the contact closure pads. Just 0.45V.
So, my plan is the following:
1) Build a typical voltage divider circuit off a 3VDC source with a 10K resistor and a CdS photocell with a range of Rdark=2,000,000ohms, Rlaser=100ohms, Rambient=9000ohms. I've done the math and that's where I came up with the 10K resistor (probably should be more like 20K, but it's what I've got). The photocell is on the ground side of the voltage divider, so that Vout is ~2.9V when dark.
2) Use the Vout of the voltage divider circuit to drive a NPN 2n3904 transistor which will switch on/off the contact closure pads.
It works, then it doesn't work, then it works, then it doesn't work. I can't tell if the circuit is incorrectly designed, or the transistor I have is flaky. I do know that the sensor module works if I put the reed sensor back in.
I should mention that I have the photocell very well protected from stray ambient light. Also, the capacitor in the schematic is optional and helps me control how quickly the sensor module detects a break in the laser. I've been experimenting with different values there.
I'll see if I can't attach a schematic...
Any comments welcome.
![sensor-schematic.jpg sensor-schematic.jpg](https://www.electro-tech-online.com/data/attachments/16/16097-46d9d20abff37d2c4e77a4358ce0b5b3.jpg)
Last edited: