1
\$\begingroup\$

I thought I had a simple circuit ready but I need help finishing it off. I’m using an IR receiver, transistor and a matrix of four 3MM LEDs. Want the LEDs to turn ON only when IR is detected.

Using a VS1838B IR Receiver, BC548 NPN Transistor and the 3mm LEDs powered by a 5V power bus. There are matching IR sources, as well, that are not a direct part of this circuit. The set-up is part of a large scale art installation where each circuit and LEDs will be on PCB “leaves” within a grove of “trees” (lots and lots of these little leaf set-ups). The individual “leaves” light up as someone gets near, triggering the IR receiver, off otherwise.

The main question: Though Ive seen this simple current source transistor circuit everywhere, I’ve not understood exactly how I can wire up the IR receiver to the transistor (especially because the receiver is a LOW when reading IR), and thus turn on/off the LEDs. Maybe wrong connections? Wrong Transistor? More resistance, Vcc?

Some Datasheets:

Transistor https://www.sparkfun.com/datasheets/Components/BC546.pdf

VS1838 IR Receiver datasheet https://www.optimusdigital.ro/index.php?controller=attachment&id_attachment=4

3mm LED similar datasheet http://www.ea1uro.com/ea3gzl/Data%20sheets/Diodo%20Led.pdfSketch of partial circuit

Added another transistor to invert IR signal

\$\endgroup\$
  • \$\begingroup\$ The VS1838 requires a modulated IR source such as that from a remote control. It will NOT respond to simple IR light. \$\endgroup\$ – Jack Creasey Nov 1 '18 at 4:50
  • \$\begingroup\$ Thanks. I've been testing variations of the above circuit with my remote just for that reason. Once I've gotten the receiver circuit set up, I'll work on a 555 timer circuit for the IR source. But first I got to get these transistor/receiver connections untangled...:-) \$\endgroup\$ – adlib33e Nov 1 '18 at 4:55
  • \$\begingroup\$ the IR receiver ground should be connected to ground, not to Ve \$\endgroup\$ – jsotola Nov 1 '18 at 6:06
  • \$\begingroup\$ Thanks as well, jsotola. The line from the IR receiver really does go straight to ground. I made a mistake in the schematic. I’m still looking for a way to wire up the transistor so that it acts like a on/off switch (off when no IR, on with IR). When the Receiver gets IR, it goes low. That won’t work as a Base voltage for the transistor, right? Or is there another way to switch the current flow ON? \$\endgroup\$ – adlib33e Nov 1 '18 at 19:28
  • \$\begingroup\$ Added a second transistor to invert the IR ON (LOW) signal. Ran the Collector signal from first NPN transistor to the base of the second. See second pix. That seemed to do the trick. Newb that I am, I'm not super clear why and I'm sure it could use better resistor choices. It works but if I leave the IR transmitter on for more then 15 seconds, the LEDs fade (and the amps on the bench power start to fade as well) Hmmmmm...? Can anyone point to an explanation? \$\endgroup\$ – adlib33e Nov 3 '18 at 1:21
1
\$\begingroup\$

Look closely at figure 4 of the data sheet. Do you notice how the output is essentially just an NPN transistor and a resistor? Also notice that the output goes low when modulated IR is detected.

The simplest way to do what you want (light an LED when IR is detected) is to change your circuit slightly. Instead of using one or more NPN transistors, use a single PNP. A 2N3906 is a reasonable choice for what you're doing. Also notice that the LED forward voltage is not 3.3 to 5 volts as you show - it is 3.3 to 4 volts, so you need a series resistor to limit the current through the LED. Furthermore, connecting your 4 LEDs in parallel (which is what I think you mean by "matrix" is potentially a bad idea. You are better off connecting each with its own current limiting resistor.

So, taking all this into account,

schematic

simulate this circuit – Schematic created using CircuitLab

will (probably) do the job.

There is a potential problem. The output of the sensor is specified as 0.2 to 0.4 volts, but the current it can handle at those levels is not specified. The circuit shown will attempt to drive about 8 mA through the base of the transistor. If the sensor will not handle this, the transistor may not turn on fully, and the LEDs will be somewhat dim. If this is the case, your 2-transistor circuit, with two modifications, will be OK.

The first modification I'd recommend is changing the collector resistor of the first NPN to 470 ohms. The second, of course, is adding a current-limit resistor to each LED.

For LED voltages in the range of 3.3 to 4 volts, the current for this circuit will run about 10 to 15 mA, which is a comfortable range for LEDs with a maximum current of 20 mA.

\$\endgroup\$
  • \$\begingroup\$ Thank you very much @WhatRoughBeast. I much prefer your solution as it is simpler and much more compact. This receiver circuit (LOTS of them) will be embedded in "leaf" shapes throughout a grove of trees, the sculpture being 10' wide x 8' tall. It needs just that kind of simplicity. I didn't have any PNP transistors around so I will order and try out your much more elegant solution. Then report back, if interested. \$\endgroup\$ – adlib33e Nov 3 '18 at 2:33
  • \$\begingroup\$ @adlib33e - While you are buying transistors, also buy a cheap digital voltmeter (DMM). It will be invaluable for figuring out what went wrong. Also, while I appreciate the selection, in general you should wait at least 24 hours before awarding points to an answer. Who knows, somebody might point out that I am (gasp!) wrong. Never happen, of course (well, almost never), but the principle is there. \$\endgroup\$ – WhatRoughBeast Nov 3 '18 at 2:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.