Browse over 10,000 Electronics Projects

Optical Occupancy Detector

Optical Occupancy Detector

There are a few situations when an optical detector is better than a current detector. This detector uses the same PC board as the Rev H current detector, but with value changes and added jumpers. Sometimes a direct indication of train position is desired.
This could be for positioning in a hidden storage yard, detecting when a train has cleared a grade crossing, or any number of similar jobs. If your trains are fully equipped with conductive wheel sets, then this may not be a big problem for you. However I would like these circuits to be useable by a larger number of people, thus the creation of the IR detector. At first I figured that this would require a different PC board, but after looking at the circuit requirements I decided that this could actually be done using the existing BOD-H board. As much as 90% of the requirements were the same. I have two different options shown here. Neither uses an opto isolator, because the IR version of the BOD does not need to be connected to the DCC rails. Obviously an opto device may be used if you desire it. The IR detector is expected to be an IR sensitive photo transistor but if you have a stable level of room lighting you may substitute a common Cadmium-Sulfide cell and use it to detect the shadow of passing cars.This will work best if intermittent detection caused by passing spaces between cars is not any problem. Power can be from any convienient 12VAC or 12VDC source. The power source must have a common ground with the controlled circuits if you chose the option without any opto isolation.

Operating principles:

The simplest way to get the same voltages on the input of U1-A that are found in the current detector version is to change the value of R2 to serve as a pull up resistor. When light shines on the input sensor it conducts, pulling the voltage from R2 down to ground, and turning off U1-A. C1 acts to cancel out the effects of florecent light flicker, and improves the stability of the circuit.


D3, C2, and the 5 volt regulator VR1 provide DC power for the circuit, and may be omitted and replaced by a jumper at J6 if you have a 5V power source such as the crossing gate controller. R1 is to limit the peak charging current of the power circuit and also acts as a fuse if the circuit fails.

R2, R3, and R15 act as an input voltage divider and biasing circuit. R4 is to limit the current in R15 if it is adjusted to it’s minimum position. R5 and R6 generate a positive reference voltage, and power bus ‘B’ serves as the zero reference point. R15 controls the amount of current required to reach the reference voltage points. The circuit is designed to respond in the range of 20-30K ohm equivilant resistance.

C3, R7, R8, and R9 are the timing circuit. The timing may be varied by changing the value of C3. A value of 1.5Mfd allows for a rapid response.

U1-C drives the output stage. U1-D provides an inverted output option. R10 and R11 provide a bias point for the driver, while R12 and R13 provide the hysteresis necessary for stable switching action. R14 is the current limiter for LED 1 and the opto isolator. If you need to drive more current in the output of the isolator you may vary the value of R14. I use 4N28 isolators because they are the least expensive, but many different opto isolators will serve as well depending on your needs. If you are using simple open collector switching into a logic board like I am, be sure to check that your isolator has enough gain to drive the pull-up resisters used on your board. R-16 is an optional current limiter for driving one or two external LED’s.

Visit Here for more.