Code for Pyrotechnic Sequencer w/ Trigger, Input, LCD and Timer?!

Before you begin reading, I will warn you that I am a complete NOOB when it comes to Arduino's / Coding, but have a fair understanding of electronics in general. I have only done one project so far, but it used existing plans and code. I don't expect anyone to write the code for me, but I don't understand all that much yet.

So with that said, I work in the Pyrotechnic Industry on a professional level. We currently use a firing system made by Cobra Firing Systems, it is a complete wireless firing system with 100 channels and 18 cues per channel (1,800 individual cues!), it can do scripting from a number of software based systems out there, excel spreadsheets, or manually set "sequences". The system works flawlessly, but the problem I am running into is the cost of the modules and potentially number of cues for the "body" of the show.

The company provides us with a number of Field Modules (or FM's), but each only has 18 cues. Most of the time we are stuck using the system for the finale and large shells only and have to hand fire the 'body' of the show. A Module is about $400-500 each with all of the accessories, so at 18 cues each you can see how quickly the cost can add up! Another issue is that we have to switch channels on the main firing module which can be annoying in the middle of the show if it isn't scripted...

Anyways, sorry for the long intro. Here is what I would like to do, but I am completely stuck figuring out the code for a fully digital "Sequencer" and I need to have a demo ready in a few weeks :\

What I would like consists of 5 'parts'

  • Trigger
  • Input
  • Display
  • Timer
  • Output

The Trigger would use an existing Cue from the Cobra Firing system. So for example, I would push Cue 1 / Channel 00 on the Cobra Firing System, but instead of the wires running to an E-Match on a shell, they would run to the Arduino Sequencer instead. When the Arduino senses a "High" signal from the 'Trigger' it would start the timer. The Trigger would be what I'm guessing would be an Input on one of the Digital Pins(?)

The Input will be either a 3x4 or 4x4 keypad OR a 5 button LCD w/ Keypad (Up/Down/Left/Right/Select). What I would like to do is turn on the system, have the display initialize and run through a test sequence of all of the cues, and then read something like 'Please enter a delay time' or something along those lines. You would then use either a numeric keypad to enter a number, or use a 5 or 6 button LCD w/ Keypad to move left/right between the numbers, and up and down to change the value.

I would like the display and timer to be as accurate as possible, but at Minimum I need to be able to enter a time in Tenths of a second, so the display would look something like:
XX.Xs or
XX.XXs

The Display can be something as simple as a 16x2 LCD or a full color OLED, but I just need it to be able to go through several steps and then "store" the entered value. So for example, you would power up the system and be prompted with something like:

Please enter a delay time...
00.00s

Then you would key in the desired value, and press select. It would then present you with a refreshed display such as:

Delay Time: XX.XXs
Status: (Not Started / Firing)

I would also like the ability to simply press the 'Select' key again, or another key on a 3x4 / 4x4 keypad (e.g. the * or # key) to re-enter a different time anytime before the timer is started.

The Timer is just that, a timer, that when started will continue on a loop for a preset number of times based on a predefined value depending on how many cues that particular sequencer has. I plan on making a few different sequencers of different sizes such as 50, 100, 200, etc cues. Once the code is finished, I can easily change this value based on the "model" of the sequencer. I just need to be sure the rest of it is simple for my crew members to use. (They will only see and/or use the finished system with a keypad and LCD/OLED), I will be the only one that would ever need to make changes to the code itself.

The Timer doesn't have to be extremely accurate, as in hundredths or thousandths of a second. However, I would like it to be as accurate as possible without needing to add another circuit such as an RTC, unless it is absolutely necessary! I would need the system to be accurate within +/- 0.1 seconds, so if I entered 3.45 sec, I would need an output every 3.35 - 3.55 sec. It can fluctuate a small amount in either direction, but the end result needs to be Fairly Close!

For example:
If a sponsor asks for a 25 minute show (25 * 60 = 1500 seconds)
I have 400 shells, 1500 sec / 400 shells = 3.75 seconds between shells
I would set 3.75s, it can vary from 3.65-3.85, but in the end it needs to be close to 25 minutes...

Using that example, if it is constantly inaccurate on the low side by 0.1s, I would end up with a show that is almost a minute short. This is actually a pretty small variation, but hopefully this explains what I need. I can't enter a number and end up with a show that is several minutes off, especially if it is short!

The Output is just a constant output and the voltage and current is not (that) important. If I could design this system to just blink an LED every XX.XX seconds that would be fine! I have actually made an 'analog' system in the past using this same concept that worked perfectly except that my timing was never accurate. The 'Firing' system of this sequencer is completely separate from what I am trying to achieve here... So, the Arduino does NOT have to provide the current to fire a match! The 'High Side' or 'Firing Side' of the electronics uses a secondary power supply with a High Voltage and High Current to ensure that the E-Matches actually fire.

All that this system (the Sequencer) will do is output a consistent voltage and current at a specified interval. I have several ways of both checking continuity of each match, and firing each match. The 'analog' sequencer I made a few years ago just used a 555 timer, a square wave, and a Pot in place of a resistor to control the timing, used several 4017 Decade Counters / Dividers to output to each Cue, and a MOSFET to drive the high current side.

I should mention that I will use the same firing setup (minus the timer / input / etc), so I DO NOT need to use a different output for each cue like I have seen others trying to do! I just need ONE Output that will drive the entire system...

**Note: A later revision may use 2, 3, or 4 outputs at different intervals, but this is not needed at this time. For now, I just need a single output, and a single time interval.

Again, sorry for such a long first post. I just want to be sure everyone knows exactly what it is I'm looking to do. So, to sum it all up I would like to:

  1. Power on the system
  2. Screen displays "Please enter a delay time..."
  3. Using a 5/6 Button LCD or 3x4/4x4 keypad, enter a time, press 'select/enter' key
  4. Screen refreshes with the 'stored' time, and total length (time * no. of cues) and/or status
  5. Arm the system and wait for the 'Trigger' from the Cobra System to go "High"
  6. Output a specific voltage/current at the 'stored' interval time that was set in #3
  7. Repeat the output at the specified delay or interval at a predefined number of times (50, 100, etc)

(If you could enter a precise time that would be displayed on an LCD and have it flash an LED at that specified time, it that would be perfect for this system! I just need to tie all of those parts together!)

I hope all of this helps, and hopefully it isn't too much info. I wish I had some pre-written code to share but I haven't been able to find anything that is even close to what I am trying to do. I have found systems that do exactly what I want, but they aren't user friendly for the crew and times had to be set in the code and uploaded, I have found code for LCD timers, but no output or loop, and a number of others that were all missing several pieces of what I need and I have NO CLUE how to tie them all together :\

If this sounds like a project you wouldn't mind helping out on please let me know! Any information would be very much appreciated at this point, I have been completely lost on this. Even if you can point me in the right direction or give me bits and pieces of what I need it would be better than what I have now!!

Thank You!

Interesting project.
I see this solved with a UNO (or pro mini) , 128x64 OLED, power sw, 2 buttons and a potmeter.

MCUs oscillator provides more that good enough timing.

  • OLED gives better contrast than LCD and takes less current.
    The screen shows all parameters at all times..
  • One "select"-button to cycle IDLE / ACTIVE / SET SECS / Tenths / SET NBR / SHOW NBR
  • Potmeter to adjust value (shown on screen) before:
  • One "SET"-button to enter value at selected position in selected 'SHOW'

Values are stored in EEPROM - and stay there until new values are entered.

Great! This is just the type of info I'm looking for to get started... Just a few questions.

"MCUs oscillator provides more that good enough timing"

This is something I haven't worked with before. I was hoping to stay away from an external clock if possible, is this what you are referring to? Do you have a link to the part that you are referring to or any more info about it?

"Values are stored in EEPROM - and stay there until new values are entered"

Again, this is something I haven't had much experience with. I did some work with an EEPROM on the one arduino project I have made. It was a cartridge resetter for a 3D Printer with a "DRM Chip" in the filament cartridge but unfortunately like I was saying earlier it was just code that someone else had posted. I made changes and 'tweaked' the existing code, but I wouldn't know how to write it on my own.

Are you saying I should pick up an external EEPROM of some sort? Or is there one built into the arduino that I am able to use?

Luckily I have about 5 or 6 Arduino Pro Mini 328's to use right now, and I also ordered an UNO R3 last week but I'm still waiting to get it.

I wouldn't suppose you have any code by chance that could get me started or point me in the right direction? I'm understanding exactly what you are suggesting, I just don't understand the code well enough to implement it :confused:

Thanks a lot for the quick reply!!

This is something I haven't worked with before. I was hoping to stay away from an external clock if possible, is this what you are referring to? Do you have a link to the part that you are referring to or any more info about it?

He's referring to the Uno itself and its timing capabilities.

Are you saying I should pick up an external EEPROM of some sort? Or is there one built into the arduino that I am able to use?

Again, he's talking about the on board EEPROM.

here's a link:

EEPROM

Do the prototyping with the UNO.
By the time the pro minis are to be progammed, it is handy to use a USB to TTL converter
eg. like this one http://www.ebay.com/itm/FTDI-FT232RL-USB-to-TTL-Serial-Converter-Adapter-Module-5V-and-3-3V-For-Arduino-/111696408406?pt=LH_DefaultDomain_0&hash=item1a019fef56
(there are several variants. It's also possible to program the pro minis using the UNO)

The OLED. Make a new thread - ask for user experience. U'll need 1" (0.96" or bigger?? 128X64 allow for 8 lines of text) and there must be a small library available for download.

Its difficult to start the framework for the code until more details for the behaviour / user interface is clear.


Some boards use a 16.000 MHz xtal. (timing error given in ppm)
other use a resonator @ 16.00 MHz. (better than 0.1% -> 4 sec / hour)

Thanks for the information so far everyone!

I've got the FTDI Adapter already, in fact I think it's the same one you linked to lol :wink:

The plan was to use the UNO because of the built in USB Connection and there seem to be a lot more shields for them that will make the prototyping easier vs having to solder everything on the pro mini.

@knut_ny, I'm just wondering about squaring away the OLED first. Do I get all of the 'Features' I want figured out first and then define all of my pins and add the rest of the code to it after that? I'm just trying to figure out the easiest way for a beginner to do this...

I'm pretty confident that I can get any one part of this project working, I've been able to do quite a bit with the pro mini's in my free time when I was just messing around with it. The problem I've been having is taking 2 or 3 sketches and making them work together, other than the very basic functions. I've been able to tie different sketches like pushing a button or tripping a photocell and having it turn an LED on - things like that, but nothing much more advanced.

Do you have any recommendations where to start? Should I just order a screen and get it to ask me for an input and then ask again from there, or do you think I'd be better off with an LCD Shield with the 5 (or 6) buttons built in? I'm a little worried on the number of pins I have available, between the screen, 5/6 inputs from buttons, the trigger and output I have a feeling I'll be close to the max number of pins, or are there certain screens that use less pins?

Also, just a quick question for everyone.

The 'Pulse' (well surge really) provided by many of the Firing Systems out there are often times a capacitive discharge, and usually at a high voltage. They are designed to shoot 10+ E-Match at a time, so it isn't uncommon for a firing system to have 24-48 VDC @ many amps. I believe the dwell time is usually about 200ms, where they are receiving current. Although, iirc the Cobra will send continuous outputs if it doesn't detect that the match was fired though I did work around that I think. Will this high current be an issue for the Trigger? I had read somewhere that I could simply run a 10k ohm resistor between the Trigger Pin and the GND, having the input wire somewhere between the Trigger Pin and the Resistor. Do you think this would be sufficient for all systems from 9V up? Will the Wattage rating on the Resistor need to be real high, or will a smaller one do?

Sorry, sooo many questions and sooo little time to finish this :confused:

"where to start ?"

Do I get all of the 'Features' I want figured out first and then define all of my pins and add the rest of the code to it after that?

Document what you build!

  • draw the framework.
  • how should menus look like - how to select item (i'd use the pot to scroll, button to choose)
  • how to enter values (u know MY favorite way)
  • what kind of info needs to be input and stored (detailed)

hardware

  • I'd avoid shields - use connecting cables (more flexible - later solder)
  • which info is visible to any one time (select type of display)
  • voltage levels. do they match? or is there any need for adaption
  • noisy lines? filtering? (shielded TP-cable?)
  • key switch to activate? or just select proper menu_choice?
  • keys/buttons/switches used - define finction for each of them
  • descrive all signals involved. level or edge? / resting level / pulses ? (draw timing diagrams)
    (- LED indicators?)

software

  • map special pins required by other hardware
  • choose connection pins
  • how much info is to be stored? (semi_permanent)
    (store one setup... or several "shows")
  • is feedback to initiater reqired? how?

make a total sketch of the meny system with submenues

  • menu items (define/describe exact function)
  • make sketches also for all submenues - to show whats on the display?
  • indicate user interaction where needed. tell what and how.

I'm a little worried on the number of pins I have available, between the screen, 5/6 inputs from buttons, the trigger and output I have a feeling I'll be close to the max number of pins, or are there certain screens that use less pins?

UNO has 20 / pro mini has 22
screens can have different kind of interface; SPI / I2C / parallel (parallel use 6 pins +1 for all pushbuttons)
(I/O isn't the problem)