miibpa
Posts: 4
Joined: Mon May 13, 2013 2:36 pm

GPIO doubt

Mon May 13, 2013 5:51 pm

Hi, I'm new at this forum, so I introcuce myself.
I'm building a remotelly controlled fireworwk launching system using raspberry's GPIO pins as "triggers". The problem is that the output current provided by GPIO's is not enough to activate fireworks. I've tried to use an ULN2803, but it didn't work, I'm not an electronics expert, so I don't know if the configuration that i used was the correct: GPIO pin to ULN2803 in, ULN2803 out to one firework cable, raspberry's +5V to second firework cable, ULN2803's com to raspberry's +5V and ULN2803's GND to raspberry's GND. The case is that the fiworks lauches if i directly connet cables to raspberry's +5V and GND, so another option I thought is to use a NPN transistor connectin the collector to board's +5V, base to the GPIO pin and the firework as load in emisor. Which option do you think it's the best?? Someone can tell me what I'm doing wrong with ULN2803, or if I was wrong for using it :P... Thank you very much in advance

pjc123
Posts: 922
Joined: Thu Mar 29, 2012 3:37 pm
Contact: Website

Re: GPIO doubt

Mon May 13, 2013 6:27 pm

What are you triggering with the GPIO via a ULN2803 to fire the fireworks? Certainly not nichrome wire, as that requires in the Amperage range not mA range to get hot enough to ignite a fuse, even when using the thinnest usable nichrome AWG (without using a microscope). The ULN2803 maximum continuous collector current is 500ma, so once again, if you are using nichrome wire, it will not be enough current to get it hot enough, and that would also exceed the maximum rating of the ULN2803. This is all speculation, as I don't know what you are actually triggering.
My Raspberry Pi Project Page:

https://www.flaminghellmet.com/launch/

miibpa
Posts: 4
Joined: Mon May 13, 2013 2:36 pm

Re: GPIO doubt

Mon May 13, 2013 6:47 pm

Thank you for your answer. I'm using cold fireworks, used for live indoor shows, I don't know exactly the materials, but they fire with a regular AA battery.

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5623
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: GPIO doubt

Mon May 13, 2013 8:39 pm

miibpa,
A possibility would be to use a buffered (transistor) & protected (diode) to trigger a thyristor driven capacitor discharge circuit. The capacitor is slowed charged from, say, a 12V battery, through ~1Mohm resistor but discharged rapidly through the fireworks "trigger-wire" - peak current depends upon the "trigger-wire" resistance. In essence a simplified form of automotive CDI "electronic ignition". 20 years or so ago I designed and built trigger circuits based on this approach to trigger gas-discharge (CO2) lasers (albeit from a 300-500V charging source). For more info. you're welcome to PM me, since such circuitry is somewhat "off-topic" here.
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

pjc123
Posts: 922
Joined: Thu Mar 29, 2012 3:37 pm
Contact: Website

Re: GPIO doubt

Mon May 13, 2013 8:40 pm

miibpa wrote:Thank you for your answer. I'm using cold fireworks, used for live indoor shows, I don't know exactly the materials, but they fire with a regular AA battery.
I see. I think I am reading your circuit OK and it looks correct. I do a very similar thing, but I have an opto before the ULN2803, because in my case I am controlling a high current AC relay on the far end. One thing you can do, to take the GPIO equation out of the loop, is to apply 3.3V directly to the input of the ULN2803 (with ground connected to the ground of your circuit) and see if that works. If that works, then the issue would be with the GPIO. As you probably already know, you need to send a HIGH output from the GPIO to activate the ULN2803 and therefore ignite the fireworks, so maybe something is wrong with your software code. Do you have a multimeter or maybe a LED/resistor that you can use to test that it is indeed HIGH? Also, make sure you are using the correct input and output (Same Darlington Pair of the IC). Are you using a GPIO library, and if so, which one?
My Raspberry Pi Project Page:

https://www.flaminghellmet.com/launch/

miibpa
Posts: 4
Joined: Mon May 13, 2013 2:36 pm

Re: GPIO doubt

Tue May 14, 2013 7:46 am

Yes, the circuit works with LED+resistor, so I'm guessing that it's still not enough current to trigger the fireworks. I'm thinking in combinig 2 ULN outputs to get the double of output current, Is it possible?. Or I should use the opto?

pjc123
Posts: 922
Joined: Thu Mar 29, 2012 3:37 pm
Contact: Website

Re: GPIO doubt

Tue May 14, 2013 11:25 am

miibpa wrote:Yes, the circuit works with LED+resistor, so I'm guessing that it's still not enough current to trigger the fireworks. I'm thinking in combinig 2 ULN outputs to get the double of output current, Is it possible?. Or I should use the opto?
One last check before jumping to conclusions. To make absolutely sure what is going on, is to put the LED (and appropriate value resistor) on the output of the ULN2803 to make sure that current is actually flowing through the output when the GPIO is HIGH (wiring error, defective wire, defective ULN2803, burned up the ULN2803 by exceeding the 500ma limit, etc.). If current is flowing, then get a transistor which can handle higher current than the ULN2803; there are plenty available. Since connecting directly to the pi's 5V works, then apparently the power supply is powerful enough to supply the pi as well as launch the fireworks, although you don't know what safety margin you have. The opto will not help you as it serves a different purpose. Since each ULN2803 circuit output can only handle 500ma, doubling them up will not help. Depending on the current requirements of the base of the higher power transistor, you could put the ULN2803 before the transistor, or use a low and high power transistor in series. Somewhere down the line you really need to get yourself a multimeter, as this is not the proper way to be troubleshooting electronics.
My Raspberry Pi Project Page:

https://www.flaminghellmet.com/launch/

User avatar
gordon@drogon.net
Posts: 2020
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
Contact: Website

Re: GPIO doubt

Tue May 14, 2013 7:18 pm

miibpa wrote:Hi, I'm new at this forum, so I introcuce myself.
I'm building a remotelly controlled fireworwk launching system using raspberry's GPIO pins as "triggers". The problem is that the output current provided by GPIO's is not enough to activate fireworks. I've tried to use an ULN2803, but it didn't work, I'm not an electronics expert, so I don't know if the configuration that i used was the correct: GPIO pin to ULN2803 in, ULN2803 out to one firework cable, raspberry's +5V to second firework cable, ULN2803's com to raspberry's +5V and ULN2803's GND to raspberry's GND.
That sounds right - but how do you know if you actually activated the Pi's GPIO pin correctly?

So rather than use the Pi's GPIO, connect the input to the ULN2803 directly to the Pi's +3.3v supply - at which point it should "fire".

If using the Pi's +5v supply, then you only have at most 2-300mA avalable anyway, so if that can trigger a firework, then the ULN solution ought to work too.

An issue might be firing several fireworks at the same time.

Do you have a data sheet on the fireworks?
The case is that the fiworks lauches if i directly connet cables to raspberry's +5V and GND, so another option I thought is to use a NPN transistor connectin the collector to board's +5V, base to the GPIO pin and the firework as load in emisor. Which option do you think it's the best?? Someone can tell me what I'm doing wrong with ULN2803, or if I was wrong for using it :P... Thank you very much in advance
If you wire a transistor up that way - with the firework connected between emitter & 0v, then you'll limit the output voltage to a shade under 3.3v. (google emitter follower, or common collector).

I'd go back to the ULN2803 method and double-check that you're actually enabling the right gpio pin. Fetch wiringPi and use the gpio command to set the pins from the command-line - test first with a simple LED & resistor on the GPIO pin, then in-place of the firework, then with the firework.

http://wiringpi.com/

-Gordon
--
Gordons projects: https://projects.drogon.net/

Return to “Interfacing (DSI, CSI, I2C, etc.)”