Maker Pro
Maker Pro

LED Debugger to check sensor working

anroop

Dec 11, 2013
65
Joined
Dec 11, 2013
Messages
65
I have a circuit that has a PIC controller and a IR reflective sensor as input to it. this input will drive a motor using motor driver. My doubt is how to connect a LED in the same circuit to debug if the sensor is working (LED should glow if the sensor detects any reflective object). i did use a pull down resistor in the input port of the controller. I connected a low power LED from sensor output to GND (now sensor output is connected to CONTROLLER's one of the input port and LED). this works but is there any other way to connect this debugging LED without using the Output pins of the controller(as all other pins are already used for some other purposes).
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Yes, there will be a simple way to do this, but I'm not sure I understand your description.

So you have a signal from your IR sensor that goes into the input of the PIC. That signal is high when the sensor is detecting IR. And you want to drive an LED from that signal so it lights up when the sensor is detecting IR, but you don't want to connect the LED directly onto the signal because this will load down the sensor. Is that right?

If your supply voltage is 5V, you can use an emitter follower to buffer the signal. Use a general purpose NPN transistor such as 2N3904 with its collector connected to +5V. Connect the base to the sensor output signal, and connect the emitter through a current limiting resistor to the anode of the LED. Connect the cathode of the LED to 0V.

When the sensor output goes high, the transistor will pull its emitter up to about 4.3V. Current will flow through the current limiting resistor and the LED. The transistor will draw very little current from the sensor; most of the LED current will flow through the collector-emitter path in the transistor.

If this doesn't answer your question, please post a diagram of your circuit.
 
Top