Protecting inputs from momentary high current and voltage

I have an electronic match lighting system to ignite fireworks, when a firework match is plugged in I read that the pin goes high (a small amount of current from the arduino doesn't light the fuse). (this lights an LED and tells me i have connected the match properly). I have a shift register controlling a bunch of relays that put 12v from a car battey accross the ignitor to set it off. However, I'm worried that i might fry my input pin, even if its "after" the ignitor. Been looking around, is this my best solution? http://www.thebox.myzen.co.uk/Tutorial/Protection.html Once the match has burnt it breaks the loop.

Would rather fewer components if possible, thinking i could bung a big capacitor between match and pin in?

Quick diagram might help(ish!)

arduino 5v--------------------¦--------match------¦---input pin ¦ ¦ car battery +12v----------relay---- -------car battery -ve

Thanks Neal

using an optocoupler between the 5V and 12V circuits?

No your proposal does not have enough isolation from the arduino 5 volt system and your 12 volt ignition system. However the relay could allow you a means to have proper isolation. A DPDT relay could provide that. The two common contacts would wire to your match. The two normally closed contacts would wire to the arduino input and output pins and the two normally closed contacts would wire to your 12 volt power supply to fire the match. With relay de-energized the arduino would see if there is continuity through the match and if so the relay could be energized to activate the match at your command.

That make sense?

Great thanks guys, i'm using an 8 gang single pole relay board (it was what i had around), so limited to that, but I wonder if i can use the second contact and a diode? see diagram;

arduino 5v---------->diode>----------¦--------match------¦-------relay NC--------input pin ¦ ¦ car battery -12v------------------------ ------relay NO------car battery +12v

perhaps adding a optoisolator in where the diode is might get me there?

Thanks for the quick replies, trying to get this done for new year celebrations!

Not sure that would work or not. The negative of the 12 volt source would have to never be wired to an arduino ground, but rather floating, and even then I'm not sure the diode buys you anything. Again a DPDT relay would give you complete isolation from the continuity testing circuit and the 12vdc firing circuit. Deviate from that at your own risk.

Lefty

nlscarter: perhaps adding a optoisolator in where the diode is might get me there?

Way too complicated. The relays already provide isolation. Just connect your 12V battery to the match with the relay contacts in series with one side. Don't join the grounds of the Arduino and the 12V battery.

Ignore that, I see that you are trying to use an input pin to check continuity of the match as well.

The attached schematic shows one possibility. The 1M resistor limits the current into the microcontroller pin protection diode to a safe value, and the capacitor prevents it picking up interference through capacitive coupling.

dc42: The attached schematic shows one possibility. The 1M resistor limits the current into the microcontroller pin protection diode to a safe value, and the capacitor prevents it picking up interference through capacitive coupling.

But if the match is ever open circuited say due to an open wire would that not then be a floating input condition rather then a valid LOW signal to the input pin?

Lefty

retrolefty: But if the match is ever open circuited say due to an open wire would that not then be a floating input condition rather then a valid LOW signal to the input pin?

Lefty

Good point! It needs a pulldown resistor as well, for example a 1M pulldown resistor from the pin to ground, or perhaps 10K across the relay contacts.

Could the relay and fuse be flipped allowing the internal pull-up to be used?

[quote author=Coding Badly link=topic=139354.msg1047196#msg1047196 date=1356662644]

Could the relay and fuse be flipped allowing the internal pull-up to be used? [/quote]

The problem I see with using the internal pullup is that it prevents a large series resistor being used. You could connect a diode between the input pin and the fuse/relay junction instead of a series resistor, however if the voltage on that junction undershoots (due to circuit inductance) when the fuse current is switched off, then it is likely to damage the pin.