Need some transistor help

Thread Starter

Ryanm0085

Joined May 23, 2018
8
This question is probably very elementary. I have an rfid door controller that, when a accepted card is swiped, a red led is supposed to turn green and the door unlocks.

My issues is that the led doesn't turn green. In troubleshooting, i found that the LED output on the controller, has a constant 5v. When a card is swiped and accepted, the 5v goes to 0v for a few seconds and then goes back to 5v.

The LED indicator however needs a ground reference to change color. I believe i can accomplish this by adding a transistor, just not sure which type or how to do it.

In short, I need the LED input to reference to ground when the 5v is removed.

Thanks in advance for any help!!!
 

Thread Starter

Ryanm0085

Joined May 23, 2018
8
Is this a purchased produce, or something you designed and built?

ak
Unfortunately it’s something I purchased and am getting no support from the company. They are telling me they aren’t compatible. However, I can take the led wire and touch it to gnd and it changes color like it’s supposed to. I just need that 5v to hold open and then when released send the LED to ground.
 

ebeowulf17

Joined Aug 12, 2014
3,307
Analogkid is asking all the right questions. It's not clear to me if this is one purchased item that's malfunctioning or two separately purchased items that aren't directly compatible with each other.

If it's the latter, one potential solution would be using a transistor and a few resistors as a switch - one which is controlled by that 5V signal you described. There are some good tutorials and graphics here:
https://www.electronics-tutorials.ws/transistor/tran_4.html

I've copied this image from that page:
IMG_5674.GIF
You can ignore a few components to the left side of this schematic. Basically you would connect your control signal (the pin where 5V represents "off" and 0V represents "on") and connect it to the left of Rb in the diagram above. Connect a PNP transistor, LED, and resistor as shown and you should have a working light.

I don't know if a transistor switch circuit is really what you need, but the information above should help if you want to go that route.
 

Thread Starter

Ryanm0085

Joined May 23, 2018
8
They were purchased separate and claimed compatible. What I am working with is a two door rfid access controller which uses rfid readers to read keyfobs. If the keyfob is in the system, the controller opens the door and the light turns green. If it’s not in the system, then the light remains red. The led is located on the reader. The controller and reader connect with 5 wires: +12v and gnd for power, D0 and D1 which uses Weigand 26 protocol to communicate, and an LED OUT which is 5v at idle. When a card is swiped and in the system, the controller drops the 5v to 0v to change the Led to green on the reader. However, the readers I was sold only change color when the LED OUT is pulled to gnd.

My original though was to use a 5v relay. Coil on gnd and 5v which would keep the relay energized. Then gnd to the common on the relay and the LED of the reader to the Normally Closed side. When a card is swiped and Approved, the 5v will drop to 0v de-ergizing the relay and connecting the LED to gnd, change the led to green. Then once the 5v is reapplied, the Led goes back to red. Basically by taking the LED wire to gnd, it changes the led from red to green.

That is the controller I am using. The bottom pic is the reader.

FD2F305A-A333-4DDA-B600-8ABE33526789.jpeg 55E98F66-D070-40A1-8D1B-9E418003FE13.jpeg
 

AnalogKid

Joined Aug 1, 2013
11,055
1. When a card is swiped and in the system, the controller drops the 5v to 0v to change the Led to green on the reader.
2. However, the readers I was sold only change color when the LED OUT is pulled to GND.
I realize that electro-speak is not your first language, but to me those two phrases mean the same thing. Usually in systems such as this, 0 V and GND are functionally equal when doing something like driving an LED.

Are you saying that the controller signal is the correct polarity (moving in the right direction) but cannot sink enough current to make the LED visible?

ak
 

Thread Starter

Ryanm0085

Joined May 23, 2018
8
Sorry I’m horrible with the terminology. Basically when the card is swiped and accepted the 5v drops out. Doesn’t reference to ground. I need it to reference to ground.
 

ebeowulf17

Joined Aug 12, 2014
3,307
And now I'm blanking on some terminology, but I think I get the idea here.

The output can source current in the 5V state, but acts like an open switch when it's "0" volts. Either there's no connection to ground in that state, or perhaps just a very high impedance path which won't sink enough current to light the LED.

Sort of like the way open collector outputs can sink but not source, this can source but not sink?
 

ebeowulf17

Joined Aug 12, 2014
3,307
Hmmm.... SPDT relay, totem pole output, comparator with push-pull output... a few ideas come to mind, but nothing solid and I've got to get to work now.

I guess I'm still not totally sure if the LED output pin needs to carry the load or if it's just providing a signal to the reader.

If it's only a signal that's needed, this might be as simple as just adding a pull down resistor to the LED output pin. Probably not that lucky, but it's a nice thought. If this was the answer, it might be something like a 10k resistor connected from the LED output pin to ground. It should be a safe, harmless experiment. Might be worth a shot if you've got resistors lying around already.
 

Thread Starter

Ryanm0085

Joined May 23, 2018
8
I don’t think it powers the LED at all. Without it hooked up the LED is red. I am definitely going to try the resistor. I think that will do it.
 

Thread Starter

Ryanm0085

Joined May 23, 2018
8
Well I tried a 10k resistor but it did not work. Didn’t mess anything up, but didn’t fix the issue. I’m thinking the relay might be the easiest fix
 

ebeowulf17

Joined Aug 12, 2014
3,307
Well I tried a 10k resistor but it did not work. Didn’t mess anything up, but didn’t fix the issue. I’m thinking the relay might be the easiest fix
Hard to tell from here, but it sounds reasonable to me. Two things to consider:
  1. The output pin may not be able to supply very much current to operate a relay coil.
  2. The relay coil is an inductor, which will create a negative voltage spike when you turn it off after its been on. This could damage their output. You should probably put a reverse biased diode in parallel with the relay coil. If you're not already familiar with this, Google flyback diode or freewheeling diode. Lots of explanations and examples out there.
 

be80be

Joined Jul 5, 2008
2,072
That thing has 4 relays on it looks like 2 uln type chips where you hooking your 12 volts up at a link to it would probably fix you up LOL

I have a _______________________ here the link ______________________
fill in the blanks
 

Thread Starter

Ryanm0085

Joined May 23, 2018
8
I’ve hooked up other readers and they work fine. Just these two for some reason don’t work the same. Just thought I could come up with a quick solution. I might just attach a relay to the lock output to take the led to ground and be done with it.
 
Top