Urgent help - ULN2803A

frank_p

Member
I am building a switching circuit using a PICAXE28X1 which drives 5 74HC595 chained ICs. The idea is to send a pulse to one of the 40 outputs and switch off immediately after the pulse.

I intended to use the ULN2803A as an amplifier to each output point but in some older post on this forum I've read that this IC will not really switch off completely when the pulse goes low from the 28X1. In this old post it was suggested another IC, the UDN2981A but the reason is not very clear.

Is the 2803 reliable to switch off once the pulse from the picaxe goes low or is there any other IC which can do the job?

I need to shut off completely because of hazard it might cause in where it is going to be used. The idea is thus because the 595 itself is not in a known state when switched on and an astray bit might trigger the output even before the picaxe sends it's first output bit to any of the 5 chained IC's.

Any help greatly appreciated. Need to finish the circuit design by tomorrow.
 

Attachments

Last edited:

westaust55

Moderator
Frank,

not sure I fully understand how you intend to use the ULN2803. Your schematic does not show the ULN2803's.
If they follow the 74HC595 then they will only reflect the state of the 74HC595 outputs. There is no mechanism such as an enable pin to turn off all outputs with a single signal irrespective of the data inputs.

The ULN2803 and the UDN2981 have darlington transistors so you incur 2 x Vce as volt drop.
The ULN2803 is low side switching so when the output is low and when the output is high it is basically floating.
while the UDN2981 is high side switching - when the output is high/on the load is powered, when the output is off the pin and thus load is again basically floating.
 
Last edited:

frank_p

Member
@westaust55

THe 2803 i didn't put them yet. They should connect to the output pins of the 595s.

I will do them soon and can update the schematic later. My problem is if i switch on a 595 pin from the picaxe and then switch it off again by another byte i send (actually 5 bytes) will it switch off or there is still current going on. In other words before i signal an input on the 2803 will it be 0V or not?

Thanks for your advice.

Didn't understand exactly this line: "The ULN2803 is low side switching so when the output is low and when the output is high it is basically floating."

So what you mean is that the 2803 when input to it goes high, the output from it goes low?

In that case i will better use the 2981, so if i signal high on input with will go high on output. Is it?

Thanks
 

westaust55

Moderator
Frank,
you talk of not knowing the state of the 74HC595 outputs which gives the impression you want to isolate the 595 outputs until you have a known state.

Yopu also talk of amplifying the signal.

1. Current capacity:
(a) 74HC595 = 35mA sink or source
(b) ULN2803 = 500mA sink (from load to ground)
(c) UDN2981 = 500mA sink (from supply into load)

SO yes, (b) and (c) give higher current capacity.
Think of options (b) and (c) as switches.circuit is supply - load - transistor - ground.

for (b), the circuit is supply - load - transistor - ground. When the transistor is on (conducting) the load is powered and when the transistor is off, the low side of the load is floating
for (c) the circuit is supply - transistor - load - ground. When the transistor is on (conducting) the load is powered and when the transistor is off, the high side of the load is floating.

Neither (b) or (c) will act as an isolation device so if you do not know the state of the 74HC595 oputputs then the darlington drivers IC's do not change anything.

The 74HC595 have a clear signal SRC but that only works on the cascading internal shift register latches not the output latches.

how critical safety (to people and machines) and time wise is your project?
I believe the 595's power up with the outputs off but if your PICAXE code made the first comamnds:
1. pulse the SRC pin on the 595's (pin 10)
2. shift the cleared data into the outputs (1 pulse only)
that would all be done in a couple of milliseconds and give you a know state.
 

frank_p

Member
@westaust55

You are perfectly right. I want to isolate the 595 from the output. I intend to make a switch that controls the 2803 independently, so first i switch on the whole thing up to the 595 then manually switch on the output of board. The intended target of the board is for a fireworks display, so the detonators are connected to the outputs.

If you are right about the 595 then i do not need to put the isolation switch at all, so all i need is to amplify the signal to trigger the detonator only.

As you might have noticed the signal is coming from an RS485 network because the whole system is spread out across a wide area.

There will be multiple boards like this one spread out approximately 100m from each other in an open field, so the idea is that once switched on, before the computer sends a signal to one addressable board no detonator is triggered.

Hope i explained the purpose clearly.
 

Attachments

westaust55

Moderator
considering the application, a form of isolation on the outputs before the controller is definitiely in a known state would be very worthwhile.

While I believe the 595 outputs establish in the low state, that is not a guarantee.

Some tests with an oscilliscope for both the 595 and ULN2803 or similar to ascertain the condition on outputs at energisation would be worthwhile.
 

lanternfish

Senior Member
As the 595 has tri-state outputs, then pull-up resistors on the 2803 inputs should help. As this is a pyrotechnics controller, what are your failsafes? Cheers
 

frank_p

Member
@westaust55
Just one more question in this regard. If the output of the 2803 goes momentarily high when a high pulse is received on it's input if i switch the 0V of the connectors to on/off then it should be safe enough?

@lanternfish
A message from the computer cannot go further than the 1st board because the RS485 is not a bus network but the message has to be reconstructed again inside the picaxe. Or didn't i get it right what you meant?
 

lanternfish

Senior Member
Depending on what type of igniters you are using and their sensitivity, do you have a way of ensuring they won't fire until the final command is given? What happens if the 2803 outputs pulse low? What is the minimum current & time for ignition? Cheers
 

Dippy

Moderator
Firstly, simply consider each 2803 I-O pin as the base-collector of a darlington pair.
If , on paper, you split your multple o/ps and visualise just one channel at a time then just think of it as a Darlington Transistor, open collector type thing.

Secondly, the choice of 595.
(Keep in mind I've never used that specific chip but I have used other shift registers).
As you clock the data the outputs will ripple through, momentarily making them high.
Is that ideal? Have you breadboarded and used LEDs as test indicators?

I would have thought that using a couple of 4-16 decoder chips would have been safer.
I realise it'll use more PICAXE pins, but it means you can 'address' a specific pin and leave the others definitely OFF.
Sorry, if I have wrong end of stick - it's a big circuit diagram for this time in the morning ;)
 

hippy

Ex-Staff (retired)
The ULN2803 is a low-side switch controlling a load from +V through it to 0V. To ensure the load cannot be accidentally switched on the best way would be to completely isolate the +V to those loads. Without +V it doesn't matter if the ULN2803 transistors are on or not.

One way to reduce the effects of possible current leakage through the ULN and increase safety is to not connect the detonators directly to the ULN but use the ULN to control relays which in turn connect +V and 0V to the detonators. That way the detonators are completely isolated from the controller and the physical construction of the relay should mitigate against some short-term glitches on ULN output or input. A relay may be more resilient than a ULN to a detonator which has shorted and appears as a zero-ohm load.

As these are intelligent remote modules connect to a master controller it would make sense for the modules to be connected with 5V, 0V and at least one control line, plus a separate +V to for the load.

When off, neither 5V nor +V would be supplied to the modules. In standby, 5V would be supplied but not +V. When armed +V would also be supplied.

As this is a safety critical application there should be key operated switch on each module to only allow the +V through when the keyswitch is enabled. It would also be sensible to add relays so +V is also only passed through when +5V is present and when the microcontroller has initialised. Thus +V is only present when the controller is armed and passing +V out, when 5V is also present when the microcontroller has initialised, and the keyswitch has been enabled.

Likewise on the controller, it should only give out +V when its controller has initialised, 5V is being passed out to the controllers and they have initialised, and a keyswitch on the controller has enabled arming. Separate +V controls and interlocks for each external module will hopefully isolate any fault condition to just the module affected.

In terms of remote module design, the more there is the more scope there is for something to go wrong. Rather than a single module controlling multiple outputs a number of modules controlling a few outputs may be simpler to design, code for and to verify the operation of. Again, it will hopefully isolate a fault condition to just affecting a few outputs. It also has an advantage that if you have a faulty module its removal will result in the loss of fewer outputs. It is easier and more realistic to have a number of spare small modules than larger ones.

Reducing what each module controls does increase costs, especially as each module must have separate safety mechanisms for enabling +V for firing. Reducing cost may often be at the expense of increased safety risk. A safety critical system should be designed with safety paramount and without regard to cost. Reducing safety should only be done in conjunction with risk assessment and failure mode analysis.

Rev-Ed do not recommend that any PICAXE is used in any safety critical systems.
 

frank_p

Member
@Dippy

The output of the 2803 in the circuit diagram goes directly to the connectors. and the other terminal of the connector is connected to ground. I don't have the detonators now but i check check the length of the pulse to verify how long it should be to fire the detonator.

I breadboarded the circuit and with some modifications the message does not ripple through from one to the other. I noticed the random effect of the 595 sometimes on switching on so i thought of putting a switch on the 2803 and switch it on manually after i switch on the other part of the circuit.

Thanks for your advice about the decoder chip, i'll check it out.

Frank
 

frank_p

Member
@ Dippy

Do you have any example how to use it with picaxe? I have both 18X and 28X1 available to test.

Frank
 

westaust55

Moderator
Secondly, the choice of 595.
(Keep in mind I've never used that specific chip but I have used other shift registers).
As you clock the data the outputs will ripple through, momentarily making them high.
Is that ideal? Have you breadboarded and used LEDs as test indicators?
For Information . . . (and simply put)
The 74HC595 has a set of internal shift registers that the data is clocked through (and can cascade into the next chip) without affecting the outputs. when the data is where you want it in terms of bits clocked through, then give all 595's a common signal which shifts the data into the output latches.
Hence the outputs do not ripple as the data moves through as is the case with some other shift registers.
 

Dippy

Moderator
Cheers Westy, I didn't even look at the data sheet. I'm glad you did as thats useful to know.

As for the 4514/5: I didn't use it with PICAXE so I have no code.
But basically, you set the 4 data pins and then to latch it you do a 1-0 transition on the 'latch' to (you've guessed it) latch it.
0 to $F in and 0 to 15 'individual' pins out.

It requires 4 pins so that equates to half a PIC port. So just send your binary value to the port. You could use the lower half of a Port and send a number (Port=), or if the top half of a port then a simple 4 bit shift.
 

eclectic

Moderator
@frankp

The wind vane circuit, here:
http://www.siliconchip.com.au/cms/A_102593/article.html

uses a 4514, shown in the lower half of the diagram here:
http://www.siliconchip.com.au/cms/gallery/article.html?a=102593&i=10


A few points.

1. The circuit shows Leg1 (strobe/latch) held high.
“Automatic non-latched counting” is therefore enabled.
(Not correct terminology, I know). :)

2. A simple 28X1 program, similar to Dippy's suggestion:
Code:
;4514 Forum 06 06 09
#picaxe 28x1
#no_table
Main:

for b0 = 0 to 15
pins = b0
sertxd (#b0, " ") ;just for testing
pause 500
next

goto main
with leg1 to V+ works fine.
You will need to add another Picaxe output if you require latching.

3. The Philips HEF4514BP version (which I own)
http://www.standardics.nxp.com/products/hef/datasheet/hef4514b.pdf
is a 24 pin 0.600” spacing DIP.

4. Finally, take extra care with those leg/output numbers.
It is so easy to make a transposition error on a breadboard. (I have).

Luckily, I didn't break anything.
But with Whoosh-Oooh-Aaah-Bangy bits attached? :)

e
(and OE)
 
Last edited:

PerthEng

Member
If the supply to the detonators is held off with say a switch, then could the 595 directly drive the firing or is the lower current rating Westy previously mentioned the issue?
 

frank_p

Member
Thanks for all the information you guys gave me. Actually I was just told that it is a flash detonator so with a couple of uA it should trigger.

Since this is so I believe i'll remove the ULNs from the circuit and build it without them.

I'll put a switch from the 0V connectors to discontinue the ground and in any case each board will need to be switched manually to arm it.

I'll just re-test any astray pins on the 595.

I'll keep you updated with the progress.

In any case if you have any other advice they are all welcome. Especially since this is a real critical application.

Frank
 

inglewoodpete

Senior Member
I'll put a switch from the 0V connectors to discontinue the ground and in any case each board will need to be switched manually to arm it.
I'd be putting the switch on the 'live' side of the detonators. It they are sensitive to uA, then you need good earthing (0v) connected all the time for maximum protection.
 
Last edited:

frank_p

Member
@inglewoodpete

What I intended to say is that since i will connect the outputs of the 595 directly to the connectors then i will put a switch on the common 0V of the connector.

Each detonator will connect from one 595 pin to 0V and when the 595 pin is high the detonator is triggered but if during initial startup a pin is fired and the 0V is not switched on it will not trigger the detonator.

Hope my logic works fine. What is your opinion on this? I'm assuming that the detonator will not blow by touching one terminal to positive only without touching the other end to the 0V.

Frank
 

inglewoodpete

Senior Member
Hope my logic works fine. What is your opinion on this? I'm assuming that the detonator will not blow by touching one terminal to positive only without touching the other end to the 0V.
Yes that should be fine, if the only energy will be coming from the 595.

My experience with these sorts of things is limited to model rockets, which need quite a high current to ignite. These things you're referring to seem very sensitive. Is static electricity a problem? I'd be a tad nervous. Maybe I'm not suited to fireworks!
 

frank_p

Member
Yes that should be fine, if the only energy will be coming from the 595.

My experience with these sorts of things is limited to model rockets, which need quite a high current to ignite. These things you're referring to seem very sensitive. Is static electricity a problem? I'd be a tad nervous. Maybe I'm not suited to fireworks!
Yes, the only power is coming from the 595 and the switch is used to discontinue the circuit until all the boards are initialized. It is pretty straight forward how they should work.

I will be changing the circuit to get power from the network cable which is also used for data transmission but since RS485 need only 4 wires from the CAT5 8wires, i'll use the other 4 for power. (+-) pair for 19V power supply and regulate it with LM7805 to smooth it down to +5V for the picaxe.
 

Dippy

Moderator
As you will be trying to make this thing bulletproof, may I suggest some power supply decoupling caps on the PICAXE and all logic chips too.

These detonators are sensitive to uA? Bloomin heck. 1uA or 1000uA? Frightening. And what is the typical pulse duration to trigger? Or is it a time x current function?
All sounds very sensitive so take care.
 

frank_p

Member
Thanks guys.

It worked perfectly, though I will do modifications after I tried it in practice. I was told I can use IC relays which is much more safe than what I did here.

Frank
 
Top