I need some help learning how to trigger transistors using the K8055. I am not new to electronics, but I am also not very advanced in them.
I’ve read about ‘open collector outputs’, and even after reading about them I don’t understand their purpose/meaning. I would greatly appreciate if someone could explain what that means.
All I need to do for starters is control an LED using a transistor connected to my K8055. I know it sounds high, but I’m using a 9v power supply (and it doesn’t damage the LED, so it will work for me). I would simply like to be able to turn the LED on and off by checking and unchecking that output in the demo program. My project is more complicated than this, but I need to do this in order to learn how to do anything else.
I’ve searched all around, but I can’t find an explanation for how to connect the transistor to one of the outputs so it will function the way I want. I’ve read something about using a pull-up resister, but I really don’t understand what they were talking about.
I would really appreciate it if someone could explain how these outputs work and how I could turn an NPN transistor (2N3904) on and off. Thanks!
The open collector output acts as a switch between the digital output terminal of the card and the GND terminal. Actually there is a NPN transistor as a switching component. Its collector is connected to the digital output terminal of the card and its emitter is connected to the GND terminal. You can connect only positive voltage via a resistor to the digital outputs of the card. See example on page 19 of the K8055 manual: K8055 illustrated assembly manual (PDF)
To get your external NPN transistor on or off via the control of the K8055 card do following:
Connect the emitter of your 2N3904 to the GND terminal of the digital output block.
Connect the base of your 2N3904 to one of the digital output terminals (O1…O8)
Connect a pull up resistor (10k) from the base of your 2N3904 to the +9V of your power supply.
Connect the minus (-) of your power supply to the GND terminal of the K8055 card.
This way you get your 2N3904 on or off depending the status of the digital output where you connected it.
You can connect a LED with series resistor (1k) between the collector of the 2N3904 and +9V of your power supply.
BTW: Why are you using an external transistor? The digital outputs of the K8055 are specified to drive 100mA current and withstand +50V.
Thanks for the explanation. It really helped. I think I mostly understand how the outputs work now.
I still have some questions, though.
[quote]You can connect only positive voltage via a resistor to the digital outputs of the card.[/quote][quote]The open collector output acts as a switch between the digital output terminal of the card and the GND terminal.[/quote]So basically what the outputs do is either leave the connection open or close it to ground, right? So when you connect a positive voltage with a resistor, when that output is “on”, the voltage is grounded and completes a circuit, and when the output is “off”, the connection is open and there is no circuit. Is that right?
I have two questions mainly about transistors. My first is this. Can I use a voltage from a separate power source to trigger a transistor? For example, let’s say we have a simple battery powered LED circuit with a transistor as a switch for the LED. And say we connect the base of this transistor to a positive voltage from one of the analog outputs on the K8055 (and turn that output on). Will this trigger the transistor? My question is because the voltage from the output does not complete a circuit with the rest of the LED circuit. Or is it not necessary for it to complete a circuit? I would appreciate it if you could explain this. My second question is this. Can you connect the base of a transistor to ground to trigger the transistor? Because yesterday I was messing around with the outputs, pull-up resistors, etc. to try to figure out how to use the outputs, and I found that if I connect the ground wire from my LED circuit to the GND terminal on the K8055, turning an output on would trigger my transistor. So when I turned the output on, the base of my transitor was connected to ground. I guess I know this works because I did it, but why does that work?
My last question is this, why can I measure about .61 volts on any of the outputs when they are “on”? If the transistor is connected to ground, why can I read any voltage on them with my meter?
EDIT: In response to your question about why I’m using an external transistor, it’s for two reasons. The first is I don’t know how else I would do it with an LED. I guess I could connect the positive wire from my power source to the anode of the LED (with a 1k resistor to protect the LED, of course), and connect the cathode of the LED to one of the outputs. I would also connect my negative power wire to the GND terminal. Then when I turn the output on, the circuit would be closed and the LED would turn on. Is that right? Anyway, the other reason is because in my project I need to use external transistors. It’s complicated to explain without you knowing what I’m trying to do, but I know for sure I need external transistors. I was just trying to turn an LED on and off to learn how the outputs work.
Thank you so much for your help! Sorry about all the questions, but I really appreciate it.[/quote]
Yes you can. There are 1k5 resistors in series of the analog outputs. You can connect the analog output directly to the base of the transistor.
In principle not. Difficult to say what happened in your circuit.
The transistors of the ULN2803 are Darlington type. It is normal that there is one base-emitter voltage (about 0.6V) over the transistor when it is conducting. Download a datasheet (link below). On page 2 you see the internal circuit of the ULN2803. focus.ti.com/lit/ds/symlink/uln2803a.pdf