Show Posts
Pages: [1] 2
1  Using Arduino / Project Guidance / Re: Pyro Firing system... Looking for a starting point on: April 26, 2013, 07:12:20 am
Hey Terry,

Good suggestion on testing for shorted FETs.

On the subject of high or low side switching, I've had discussions with different folks and everyone has a reason for doing it their way.  My original firing board uses regular switches with the high side of my power supply connected to the distribution panel in the field and the return path going through my switches to ground on my firing board.  That means the pins in the field are always high (+24V) and waiting for ground to complete the circuit.  This design was used by my mentor in the business and I never really questioned his reasoning until a bit later.  I'm an Electronics Technologist by trade (before I became a Computer/Network Security Analyst), so I did question it. but went ahead and designed my board based on his design.  It was only during one of my shows where two separate distribution panels were firing parallel cues at once (...and they weren't meant to) that I changed my mind.  Thus the reason for switching the high side of the rail to ground rather than the other way around. 

Sorry, moderators, this is not a Pyro site; we'll limit our continued efforts to Arduino.  Hard not too when you get other pyros in the room.  LOL
2  Using Arduino / Project Guidance / Re: Pyro Firing system... Looking for a starting point on: April 26, 2013, 06:13:28 am
Good morning PyroBrit.

Thank you for the post and the link to the video; it was very informative and re-confirmed I was on the right track. 

My project is coming along very well.  The use of relays is still a concern for me, however, as a "proof of concept" they will provide the data I need.  The plan is to custom design a 32 channel FET board to replace the relays.  I've customized a communications protocol between the Master Control Module and the Field Modules over RS485.  I would like to use a library written by Nick Gammon ( which uses a CRC test, start/stop characters, and a transmission protocol to overcome possible noise over long comms lines.  I cannot yet determine if the added overhead would cause delays in very fast sequential cues (less than .1 sec intervals); this I will have to test once my first roll-out has been done.  That will be the point where I will review my entire code and make modifications to clean it and make it more efficient.

Terry; the design I opted for to test the continuity uses some 4067 analogue multiplexers on the squib side to detect the state of the squibs connected to ground.  When I issue the command on the Master Control, a 4 bit counter on the Arduino Mega Field Module is activated and cycles through all 16 channels of both 4067's to allow whatever state is present on the squib to be channeled to the signal pin of the analogue multiplexer.  That signal pin is tied to a digital input on the Arduino, which in turn is being held high through an internal pull-up resistor.  This way, the +5V on the pull-up resistor does not get through to the squibs themselves.  If the squib makes connection to the ground rail, the voltage on the signal side of the multiplexer will be 0V (a digital 0).  If the squib did not have continuity to ground, the digital input will continue to see +5V of the internal pull-up (a digital 1).  This, of course, precludes that the firing mechanism is waiting to close the circuit on the squib connected to ground by firing +24V into it.  Very low currents will not set off a squib (and I cannot presume to think that a very low current for long periods will not "cook off" a squib either), but I added a measure of safety by placing the 4067 multiplexers between the squibs and the Arduino.  Besides, their use means that I only need to use two digital inputs to measure continuity on 32 channels (and yes, the results of the continuity tests are stored in a register for later transmission to and processing by the Master Control Module).

Terry, you bring up and interesting case of what happens when a FET blows shorted to the +24V rail?  My design, uses a master switch (with a key) to prevent the +24V rail from making contact with the drains on the FETS until the show is ready to fire.  If I cannot detect that some FETs may have shorted to Vcc, then, the squib connected to that FET will fire off when the Master Arm switch is thrown ON before a show.  Things to ponder to include in the design.  PyroBrit; what's your take?

3  Using Arduino / Project Guidance / Re: Pyro Firing system... Looking for a starting point on: February 13, 2013, 02:10:35 pm
Hello Dan,

Your point on the relays is not lost.  That was my initial fear with using them; if they get banged around, the reed will slam down and close the contacts.  Since the solid state relays were much more expensive; I opted for electro-mechanical for the proof of concept.  Changing out the electro-mechanical relays for a custom-built FET board or commercial SSR board will be easy.  The whole premise of this project was to make adding features easy through firmware (thus the Arduino) and provide a framework around which parts can be changed for added features or higher reliability.

I enjoy exchanging ideas on forums like these; like minded folks have various views of the same process.  I prefer surrounding myself with people much smarter than me.

BTW: did you design continuity testing in your FET board?  Wanted to know how you got around the issue.

Take care.
4  Using Arduino / Project Guidance / Re: Pyro Firing system... Looking for a starting point on: February 13, 2013, 12:31:36 pm
Afternoon Terry,

The field module mega is connected to a custom shield which breaks out all the connections along the sides.  The 32 signal lines needed are well pinned out to the edge (pins 21-53) and connected to the relay boards (2X16) by means of a custom cut ribbon cable.  The relay boards are from China (the typical stuff you would find on SainSmart and others).  They were cheap and available for a proof of concept.

As time goes by and the whole project evolves to completion, I would like to design a fully customized shield containing the continuity logic circuits, the communications IC, and connectors.  There is a great and free application from Eaglesoft to create PC boards that I have been playing with for a while.  Since there are numerous prototyping companies out there that specialize in PBC manufacturing, it will be easy to mass produce the shields.

If interest develops in the hobbyist community (and professionals at large), I could make the shields available (this is, of course a longer term part of this project).

I'll send pics of the gear as time permits.
5  Using Arduino / Project Guidance / Re: Pyro Firing system... Looking for a starting point on: February 13, 2013, 11:50:22 am
Good morning everyone,

I'm Chuck from Ottawa, Ontario, Canada.  I am in the middle of designing and building a full-featured Professional Fireworks Ignition System with the Arduino Mega.  It consists of a Master Control Module communicating with parallel connected Field Modules consisting of 32 relays each.  It is capable of shooting pre-designed CVS formatted set of cues, will soon have FSK and SMPTE capabilities to fire shows to time-coded music, and able to manually fire individual e-matches.  It has a built-in function to verify e-match continuity remotely from the Master Control Module and will eventually have the same local feature at the Field Module end.  The Master Control has a built-in touch screen and menu driven.  The Field Module is designed to be field addressable to set up large shows using several dozen Field Modules individually addressed.  I've based the Arduino coding on Finale Fireworks' professional show design software "show output file" (CSV).

My company and I have been firing commercial fireworks in Ontario for 13 years and needed to expand our capabilities to generate larger, more controlled shows.  Since I am an IT Professional, Electronics Technologist, and life-long tinkerer I took on the challenge myself.  I understand that commercial products are out there, but at $10 000 a complete system (for the size we needed); I knew I could built it myself for much less.

Seeing that several folks are interested in the open source nature of this project, I thought I might offer my own insight.  Our project is not commercially ready yet, but at the proof of concept level; however, it's moving along well.

Have a great week.
6  Using Arduino / General Electronics / Re: Power bleeding over serial link from one Mega to second Mega on: January 18, 2013, 09:20:44 am
That makes sense!

Electronics Engineering 101.  This behavior is to be expected, not a defect, but a protective design.

Thanks for the info.
7  Using Arduino / General Electronics / Re: Power bleeding over serial link from one Mega to second Mega on: January 18, 2013, 09:10:44 am
3 wires are connected: Rx1-Tx2, Tx1-Rx2, ground
8  Using Arduino / General Electronics / Power bleeding over serial link from one Mega to second Mega on: January 18, 2013, 08:54:20 am
Morning folks.

Here's an interesting situation: I have 2 Arduino Megas connected to each other over the Serial3 port and attempting to communicate data (yes, they have their individual grounds connected over the same comms cable).  Mega 2 receives signals to activate relays, Mega 1 (a Sainsmart TFT Screen package programmed to read an SD file containing activation sequences) sending signals over Serial link to Mega 2.  When I connect power to one of the Megas (whether through external power or the USB port), it feeds the other Mega whose power has not yet been connected.  It doesn't matter which one is connected to power, the one not connected will have it's power LED glowing brightly. 

In fact, when the relay-Mega is connected to power, the Sainsmart TFT-Mega's screen begins to glow (but not boot up), but only after a few seconds; as if the power filtering caps were slowly charging.

What's up with that???
9  Using Arduino / Programming Questions / Re: CSV file read stops after 9 lines? on: November 20, 2012, 08:32:44 am
Morning WildBill,

Tried your suggestion on sending character 19 and character 17 through Serial.write, but no avail.  I can see that my terminal program is accepting the code and doing something with it; if I don't turn on Xon/Xoff flow control, I will get characters appearing on the terminal screen - the opposite happens when I do activate flow control (this presumes that if I don't see the characters on screen; they must be processed by the application).  The issue, as far as the buffer over run, still exists.

SurferTim has the final solution: eventually my CSV will reside on an SD card connected to an Arduino Leonardo.  It will transmit the lines of the CSV to the Mega, which will activate the relays.  Reading the CSV line by line through the SD library will provide a slow smooth data flow to the Mega that will not over run its buffer.  The exercise was good: I wanted to understand flow control for future use.  I still want to know how to achieve it; if there's still someone out there that can show me.

Thank you all so far for your suggestions.
10  Using Arduino / Programming Questions / Re: CSV file read stops after 9 lines? on: November 19, 2012, 06:55:41 am
I will try that.

My serial terminal program (on Linux Kubuntu 12.04) does accept software flow control: Xon/Xoff.  I'm not at the lab right now, but I'll try later today and report back.
11  Using Arduino / Programming Questions / Re: CSV file read stops after 9 lines? on: November 19, 2012, 06:49:13 am
The file is just a text file containing lines as shown in my very first post.  I run through a sequence of numbers corresponding to the relay numbers: 1 through 16 followed by relay on-time and off-time.  It looks something like this:


...and so on and so on.  The Serial.parseInt() helps separate the values within the sketch.  I can confirm that changing the delays changes the number of lines the sketch can go through (compounded by whether I allow the on-screen printing of the results).  I understand that the relay activation is not an amazing feat, but this project is a proof of concept.  These relays will eventually perform tasks and the sequence and timing will be much different.  Coming up against these challenges now permits me to understand the behavior of the Arduino and programming in C++.

The final proof will be using a Leonardo connected to an SD card reader containing the CSV file, it will transmit this file's data via Dallas 1-wire comms (to keep the wiring down to 2 physical wires only), and having a Mega 2560 receive the data from the Leonardo to activate the relays.
12  Using Arduino / Programming Questions / Re: CSV file read stops after 9 lines? on: November 18, 2012, 07:38:27 pm
Hello again everyone,

Here is my new code; I've tightened things up a bit.  I also googled and searched this forum for flow control on the serial buffer; and found that according to those in the know: there is no flow control on the Arduino's serial interface.  Please correct me if I'm wrong (and my wish is that someone please corrects me).  I would love to see code that would perform this in order to incorporate it in my current proof of concept sketch.  I've found a few things on Handshaking, but they all seem to relate to Arduino to some external device serial comms, rather than a constant stream from DTE to the Arduino.

The new code permits the execution up to relay 13 at 1200 baud.  If I remove the lines that actually print to the serial port (for visual feedback of where the CSV file is at); the entire test CSV up to relay 16 does cycle through; I can see the relay indicator LEDs light up sequentially.  If I bring the baud rate to 9600, the sequence stops at 9 as it did before; even without the serial printing.

int data[3];
int arr_ndx;
int relaypin;

void setup(){
  // initialize serial communication:
  arr_ndx = 0;
  // initialize the relay pins:
  for (relaypin = 22; relaypin < 38; relaypin++) {
    pinMode(relaypin, OUTPUT);
void loop(){
  if (Serial.available()){
    data[arr_ndx] = Serial.parseInt();// check for comma separated data
    if(Serial.available() && ==  '\n'){  // end of line test
      arr_ndx = 0;
      actRelay(data);//send data to actRelay func
/*      Serial.print("Relay:");
      Serial.print("Time ON:");
      Serial.print("Time OFF:");


void actRelay(int* array)
  digitalWrite(array[0]+22, HIGH);

Thanks Wildbill for the snippet that reduced the size and complexity of the actRelay function. 

I appreciate all your help on this.
13  Using Arduino / Programming Questions / Re: CSV file read stops after 9 lines? on: November 15, 2012, 09:50:01 am
Hey Paul,

You'll most likely get to see more questions on the 1-wire comms stuff; that's the next phase of this project.  I will be going from testing the code PC-to-Arduino, then going Arduino (Master Control Module)-to-Arduino (Field Module).  The 1-Wire comms will be Dallas 1-wire.  The protocol performs bi-directional comms using 1 wire plus ground.

Stay tuned...
14  Using Arduino / Programming Questions / Re: CSV file read stops after 9 lines? on: November 15, 2012, 09:22:55 am
In response to PaulS:

1. Good point on the naming convention.
2. Do I really need to use an array to store the three pieces of data I need to activate the relays?  Maybe not, I will rewrite the code to use variables called: relay, t_on, t_off and I will retest.
3. I will perform tests when I get back to the lab and provide feedback on the comms questions

In response to wildbill:
I will slow down the baud rate and see if this helps.  On that note; what is the method to prevent such an overflow without having to play with baud rate?  The issue may be more prominent when the project gets used in the field: I will be using 1-wire comms to transmit the CSV to the Mega; which will activate the relays.  The length of the 2 wires used to communicate may vary and I don't want to have to adjust the baud rate to prevent overflow every time something changes on the wiring.

Thank you all for weighing in.  More data to come after spending more time in the lab.
15  Using Arduino / Programming Questions / Re: CSV file read stops after 9 lines? on: November 15, 2012, 08:40:09 am
Very cool PaulS.

Using Serial.parseInt() is good, but I need to keep in mind that the comma is not what is actually causing the command to parse: anything not a number will suffice.

What about the response from MarT?  Would you weigh in on why my sketch stops after the 9th line?
Pages: [1] 2