Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Problem connecting ULN2003 to AVR

Status
Not open for further replies.

Adbadb

Junior Member level 1
Junior Member level 1
Joined
Jan 14, 2015
Messages
17
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
118
Hi,

I want to use ATtiny2313 and ULN2003 to control a 7 segment display, there are resistors on the segments of the display, it works with common Anode +24v.
The ULN2003 has the inputs connected to the IC and the outputs to the display,
the GND is connected to the Ground and the COM to +24. I noticed that when the GND from the 24v supply and the GND from the 5V supply are conected together the ULN2003 works like it should, but the output pins from the ATtiny2313 does not work, and when the GND are not connected with each other the output pins from the ATtiny2313 give +5V but now the ULN2003 is not working.
What could be the problem?
 

The ground HAVE to be connected. The ULN2003 inputs are referenced to the GND pin and all the segment current also flows through the GND pin so failing to connect the MCU ground to the LED supply ground may result in high voltage reachng the MCU and damaging it.

Please post your schematic so we can see what you are doing. Note that the COM pin can be left disconnected. It's purpose is to sink current from switching inductive loads to the supply line but LEDs are not inductive so it serves no useful purpose in your application.

Brian.
 

Post your circuit diagram then we will know what actually is happening. And the COM pin of ULN2003 is used when you are switching relays using ULN2003 to remove the need to add a diode across relay or ULN2003.
 

The ground HAVE to be connected. The ULN2003 inputs are referenced to the GND pin and all the segment current also flows through the GND pin so failing to connect the MCU ground to the LED supply ground may result in high voltage reachng the MCU and damaging it.

Please post your schematic so we can see what you are doing. Note that the COM pin can be left disconnected. It's purpose is to sink current from switching inductive loads to the supply line but LEDs are not inductive so it serves no useful purpose in your application.

Brian.
This is how everything is connected, please tell me if i have connected something wrong.

IMG_20150114_130755.jpg
 

As far as it goes, that looks OK. A full schematic diagram would help.

If that is the full design, I would not expect it to work, you need additional decoupling and possibly osdcillator components before it will operate.

When you say the ULN2003 is not working, what exactly are you seeing? If it a transistor array so if you expect the output to go high when the input is low you are mistaken. It works like a voltage operated switch between the output pin and GND pin, when the input is high, the output is grounded, when the input is low the output is turned off. The output pin will not go high unless you provide it a current source from outside the device.

Brian.
 
The output pin on the ULN2003 should be 0v when on the input it has +5v.
Now, when i connect the +5v from the MCU directly to the input of the ULN2003 it is ok, the output is 0v.
But when the output pin from the MCU is connected to the ULN2003 it is not working, the output of ULN2003 is not 0v (and the MCU is programed corectly, but i have noticed that the voltage from this pin is 3.8V but i dont think that should be a problem).
 

3.8V should be enough but there is little safety margin. The ULN2003 is designed to run with 5V inputs but should work with a small load down to about 3V.

How much current is passing through the output pin? (your LED current)
Higher currents need more input voltage but for most LEDs it should work. Are you measuring 3.8V at the input pin of the ULN2003 or the output of the MCU with the ULN2003 disconnected?

Brian.
 

3.8V should be enough but there is little safety margin. The ULN2003 is designed to run with 5V inputs but should work with a small load down to about 3V.

How much current is passing through the output pin? (your LED current)
Higher currents need more input voltage but for most LEDs it should work. Are you measuring 3.8V at the input pin of the ULN2003 or the output of the MCU with the ULN2003 disconnected?

Brian.
The current is low it is 10ma.
And the 3.8V are on the MCU with ULN2003 disconected, and if i connect the ULN2003, on his input pin i measure lower than 1 V. It is strange.
 

1V certainly isn't enough to make the ULN2003 conduct. It has a darlington transistor and a series resistor inside it which makes it need a higher voltage.

According to the data sheet, the MCU should be able to produce a minimum of 4.2V while sinking 20mA so somethng is wrong in the MCU circuitry or the device configuration. Can you check the supply pins still have 5V across them when the ULN2003 is connected. It's just a guess but maybe the whole supply is dropping.

Brian.
 

1V certainly isn't enough to make the ULN2003 conduct. It has a darlington transistor and a series resistor inside it which makes it need a higher voltage.

According to the data sheet, the MCU should be able to produce a minimum of 4.2V while sinking 20mA so somethng is wrong in the MCU circuitry or the device configuration. Can you check the supply pins still have 5V across them when the ULN2003 is connected. It's just a guess but maybe the whole supply is dropping.

Brian.

The supply is stable 5v, the problem is that the output pin when it is connected to the input of the ULN2003 drops to 1V. But when the +5V are connected directly to the ULN2003 it works ok.
 

Looks like wrong configuration of the driving AVR pin, open drain with pull-up instead of regular output. Or defective ULN2003.
 
  • Like
Reactions: Adbadb

    Adbadb

    Points: 2
    Helpful Answer Positive Rating
Looks like wrong configuration of the driving AVR pin, open drain with pull-up instead of regular output. Or defective ULN2003.


Yes i checked and the problem was that the pin was configured as input pin, i changed it to output and now everything is ok, it was my mistake.
Thank you for your help.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top