Saturday, 11 June 2011

An easy circuit to transform a led/light pulse into a useful voltage for a pulse counter

I'm gonna show an easy (and probably not optimal) circuit to take the blink of a led and transform it into an electric signal that will become the logic state to be counted by a pulse counter device.

The counter device is a "SENECA Z-D-IN". This digital input device is able to count electric pulses and it is queryable with the modbus protocol.

Here is the circuit:

These are the components I used and the links to the data sheets:
  • diodo zener 8.2 V
  • phototransistor BPX 43
  • transistor BC107B
  • opamp OPA251
The 16 volt power can be supplied by the Seneca digital input counter.

I have used a phototransistor that must be attached to the pulsing led, maybe with some adesive tape so that it will remain in the dark when the led is off.

The phototransistor must be sensible to visible light and cannot be an infrared one. The Bpx is sensible to all the visible spectrum.

The 8.2Volt Zener diode is useful to maintain the voltage between the collector and emitter of the phototransistor less than 3V. This is because many phototransistors have a small maximum Vce and with this circuit the phototransistor will switch on a second transistor that can have higher maximum ratings.

The opamp is used as a subtractor of the voltages across tre resistor marked with "R5". So the output will be 0 V when the led is off and almost 16V when the led is on.

The resistors involved with the opamp are 1MOhm because I don't want current circulating across the "R6" and "R9" resistors.

The zener diode used is very small and must be soldered even if you use a breadboard.

This circuit has been tested with the Seneca device.