Resistors with darlington array - Page 1
Forum section: electronics / beginners

author: dferyance
author_rank: Regular Contributor
timestamp: March 10, 2015, 01:17:50 am
content: I am working on a project where I have to interface a hall-effect sensor with a microcontroller. The sensor needs a higher voltage than 3.3 volts and due to the needs of another part of it, I have both 3.3v and 6v rails so I am using the 6v with the sensor. I both need to drive the sensor as well as read the input from it with the microcontroller. I was able to get a circuit working using a couple transistors to drive it and a voltage divider to step down the sensor output. I have a darlington array package I would like to try out both as a learning experience but also because it is nicer having a single package over multiple transistors and resistors.As semiconductors was one of the EE courses that wasn't part of my degree, I tend to struggle with them especially when interpreting the datasheets. Here is what I am usinghttp://www.st.com/web/en/resource/technical/document/datasheet/CD00001244.pdfI have the ULN2001A. It isn't clear to me if and where I need current limiting resistors. I know that with microcontrollers they usually have high impedance inputs so I don't have to put resistors in place. With transistors I do. But what in the datasheet do I look at to know the difference? It lists max values. What I don't know is when a max value is the maximum the chip will do (i.e. there is internal resistance or regulation) and when it is the max I should try to get out of it (i.e. I have to add resistors). Just as a test, I used my meter on a chip (I have spares) and measured the current when connecting these without resistors. The values I got were higher than the datasheet so it sounds like I need to limit the current but obviously this kind of test isn't a good way to find out. From the schematic of a darlington pair this also makes sense but isn't clear to me from the datasheet. For the hall effect sensor it also has a max current but when trying this I got a value lower than the max so I am sure I don't need to limit it. I know for LEDs I can look at the forward voltage drop, but I don't see something like that in the datasheet.

author: marinedalek
author_rank: Contributor
timestamp: March 10, 2015, 07:53:22 am
content: As you're using the 2001A, the input pins connect directly to the base of the transistor. As such, once Vin goes appreciably over ~1.2V (2x a normal diode drop, one for each base-emitter junction), the input pin will look like a dead short to ~1.2V to whatever is driving it.Let's assume you're driving the input with a 6V signal. The datasheet lists the absolute maximum base current as 25mA, but you don't need anywhere near that because the darlington driver in this IC has a rated gain of around 1000. If you have a 10k pullup resistor on the output to 3.3V, you only need 330uA of collector current to pull it low, which would be achieved with 0.3uA (!) of input current. As it happens it helps to overcompensate a bit when doing switching, and it won't do any harm to aim for, say 100uA of base current (just plucking a number out of the air) so ensure the pair is switched on.To calculate the required total input resistance, take the input voltage (6V) and subtract the darlington driver base-emitter drop (1.2V), then divide by your required current. This gives a resistance of 48k. However, we have a problem; there is a 7.2k resistor from base to emitter of the first transistor. In operation this will be a ~0.6V drop, so it will sink 83uA of current, leaving 17uA going into the base, which would work but it's not what we were aiming for. The solution is simple: recalculate by adding that to our desired current. This gives a total input resistance needed of 26k. Just find the output impedance of your sensor, subtract that from 26k and pick the nearest standard resistor value below it.It's late, so there may be errors, but that's how I'd do it, assuming a 6V input voltage.

author: picandmix
author_rank: Frequent Contributor
timestamp: March 10, 2015, 09:56:01 am
content: The UNL2803A is the octal version of the 200n range.Section 9 of the datasheet clearly identifies its input voltage needs, ie its fine for direct micro connection at 3v3 or 5vEnsure the COM pin 10 is connected to your switching positive voltage.http://www.ti.com/lit/ds/symlink/uln2803a.pdf

author: dferyance
author_rank: Regular Contributor
timestamp: March 10, 2015, 06:21:56 pm
content: For the most part the replies have been helpful. I think I should be able to figure out what resistors I need. The TI datasheet is better as it shows the functional block diagram which makes it much clearer what is happening. I think I still am stuck at the general problem of not knowing when a datasheet's max current values are the max I should apply to it, or if they are the max that the chip will supply. Is it just based off of experience with knowing what the chip is designed to do?

author: picandmix
author_rank: Frequent Contributor
timestamp: March 10, 2015, 08:58:26 pm
content: With that chip , as said you can connect it directly to any common micros output port, as simple as that.When it comes to output current what a chip like that can handle its less clear, in that they can often quote lab test figure, the same as saying your family car engine is rated up to 7,000rpm, so why don't you keep the engine at 7000rpm all the time then ?Same with these chips, they say 500ma load per single transistor section, yes, but if you run such a test you find it soon gets rather warm, and like the car engine, heat = less life. Imagine what would happen if you tried to put 500ma though each segment at one time !In practice, they are used typically as stated a driver for smaller relays and leds etc where probably the typical load for all segments would not exceed 500ma at any one time.So, again in more practical terms, how many devices and their loads are you wanting to drive ?Depending on what you say will help establish if these chips would suit your needs or if you need to look at some other power transistors or mosfets.

author: Paul Moir
author_rank: Frequent Contributor
timestamp: March 11, 2015, 04:14:07 am
content: Uh, check out the ULN2001A, it's totally different from the ULN2003, ULN2803, etc which have drivers for the darlingtons. On this chip the base of the darlington is directly exposed. If you run more than 25ma into the base, you'll fry it.If you want to use the array to switch things on and off, you want to drive the darlington into saturation. I'm guessing you'll use a common emitter setup with the emitter tied directly to ground. Now check out Vce(sat) in the datasheet. With an Ib of 0.5mA and up to 350mA going through Ic, Vbe is max 1.6V. You don't say what your micro is but say it's digital outputs are 4v for high and can drive up to 30ma. So to get .5mA, you'll need a resistor of at most 4V-1.6V=2.4V / .0005A = 4.8Kohm. Since your micro is capable, you might want to drive it harder with say a 2.2K resistor. No harm except wasting power unless you exceed the max your micro can supply or the max you can drop through the darlington's base.If you don't need 350mA of Ic, you can drop your Ib and save power on the drive current.EDIT: marinedalek is saying almost exactly the same thing, just coming at it from a slightly different angle.EDIT2: Maybe I'm misunderstanding how you're connecting the hall effect sensors. Can you sketch out what you did with the discreet transistors to make it work? Are you modulating them?

author: dferyance
author_rank: Regular Contributor
timestamp: March 12, 2015, 01:52:08 am
content: I have attached a schematic of what I have working with discrete transistors. The hall-effect sensor is an encoder that is part of a motor. For what I am doing I only care about one output (two would be better but I can get by with one). As I am running off of batteries, I cannot keep power going to the encoder, it will draw about 10ma. So I need to be able to turn it on and off based off of if I am running the motor or not to keep power usage down.My first solution used a single discrete transistor as the switch. I had all kinds of problems with that where the encoder output was messed up or that the voltages were wrong (did I mention I am new to this). I found the two transistor solution somewhere online and it seems to work ok. I read that the Sziklai pair was similar to a Darlington pair so I figured I might be able to get my component count down with a single chip. I am hand-soldering point-to-point and I don't have a lot of space. As I need to add some resistors to this, I don't think this idea helped out too much.I am using a voltage divider on the encoder output to drop it back down to 3V for the microcontroller. A diode and the micro's internal pull-ups would be better but I didn't have any diodes sitting around at the time. I have a few now and I think I will give it a try.

author: picandmix
author_rank: Frequent Contributor
timestamp: March 12, 2015, 10:33:07 am
content: First, you need to show the resistor values in your diagram.Have you measured the actual voltage at the Hall device when the battery is switched by the transistor ?Have you run your Hall sensor direct from the battery, with no transistor switches, and got the expected reading from it into your micro ok ?As Marinedalek mentioned earlier when a transistor/s switch voltage there is an internal loss so the 6 volts in will be less to the hall device.Also a 6v battery is rarely 6.00 volts, its starts off higher and ends up lower.Both the above factors could affect the operation of the hall device but again you need to specify the extact type so its datasheet can be seen and the effects of input voltage can be established.There are several ways to overcome your problem, given that a 6v battery is suitable for the sensor.First is a simple transistor driving a minature relay ( to switch your 10ma load), this means there is no voltage drop from any transistor. Plenty of examples on the web of this configuration.Second way would be to use a single Mosfet which has virtually no voltage drop, however they are not a device I know well and you would need a 'logic level' type, hopefully someone else could help there ...?If the hall sensor needs a much more stable voltage than a running down battery then you might have to look at a 9v battery though a 6v regulator .Don't forget, as the battery voltage drops, so does the output voltage though the potential divider resistors or diodesEdit, found a common mosfet and just tested it in this circuit which runs with the currents shown in picture 2, though the load was just a led , not the sensor shown.