CO Alarm

Hi guys... new to the forum and new to Arduino... ok I could have sworn I posted this around 3am but then I must be dreaming because for the life of me I can't find my post. I am trying to connect a motorcycle air horn (12 volts) to my Arduino so that when a carbon monoxide sensor variable exceeds a predefined level it sends an output signal to complete a 12v connection to the horn and sounds an alarm loud enough for the whole house to hear. I know I can't supply 12v from the board but can I use an H-Bridge I have to control a stepper motor (don't know the number off hand since I'm not at home at the moment). I also have a relay that came with the horn. Can I just use a relay without and voltage coming back into the Arduino and frying it or a combination of both? I'm sure I may need some resistors in there somewhere just not sure of the basic layout. Right now I haven't received the CO detector yet since it is coming from China and may get here some time next year lol ... however in the meantime I do have some photo resistors, pots etc to use as input devices to write the basic program. I will be glad to provide more specific information later when I have it available to me but if anyone can nudge me in the right direction working with the few items I have I would greatly appreciate it. Thank you!

Hi, I'd seriously think about using optical isolation between the Arduino and the high-power stuff.

Could be relays like these: http://goo.gl/3mXu0 (Also see the schematics on their pages)

Or do you own with opto-isolator chips. See http://arduino-info.wikispaces.com/Popular-ICs and scroll down to the Opto stuff...

DISCLAIMER: Mentioned stuff from my own shop...

I know I can't supply 12v from the board but can I use an H-Bridge I have to control a stepper motor (don't know the number off hand since I'm not at home at the moment).

Why would you do that? Just use a relay. Use the arduino to trigger the relay to pick, and have the 12V wired to the common and the other connetion to the horn.

Test with a simple button or something else, if you get a signal the horn should activate.

Thanks Hazard ... that's why I said "I also have a relay that came with the horn. Can I just use a relay without and voltage coming back into the Arduino and frying it" in my first post... it's been ages since I've messed with electrical components but I do remember the purpose of a relay is to use a smaller current (and wiring) to send a signal to switch on a higher current. Just couldn't remember if the relay might have any kind of back flow to the board. So it's as simple as a pinout signal to the relay?

Yes it is that simple, just make sure you include a diode with that output, so that there is no back flow to the arduino. Yes, there will be some back flow, because you are powering an induction coil and that can easily go back to the arduino if there is no protection.

Refer to this: http://www.google.com/imgres?imgurl=http://www.rc-float-flying.rchomepage.com/Schieppati/relay.jpg&imgrefurl=http://www.rc-float-flying.rchomepage.com/Schieppati/switch.html&h=575&w=614&sz=61&tbnid=kHyZ81Sdu5HngM:&tbnh=90&tbnw=96&zoom=1&usg=___cJ8v52BkbNEl4q2jzvrmcH1C4Q=&docid=RG2MIHS9qpcXZM&hl=en&sa=X&ei=4FWlULWtHKTE0QGk_YGoCw&ved=0CEMQ9QEwAg&dur=0

WOW, that is a long one, sorry about that.

I believe I have some Schottky diodes around here ... would they be sufficient? I also have some http://www.datasheetcatalog.org/datasheet/diodes/ds28009.pdf

That diode will be fine. It needs to have a Peak Reverse Voltage rating above the relay’s coil voltage, and a Forward Current rating greater than the coil current.

In order to drive the relay directly from the Arduino, the relay coil voltage should be 5V (a 12V coil won’t work) and the activation current (coil current) needs to be 40mA or less.

FYI - You don’t need a microcontroller or programming if all you want to do is turn on/off an alarm based on the CO level. :wink: Assuming the CO sensor has an analog output, you can use an op-amp as a [u]comparator[/u] and the same sort of driver/relay for the alarm.

If you google "gas sensors", you'll find many places to buy in the USA. Figaro makes many, and has data online.You'll probably also have a 10X better idea of what you actually have bought. If you're really lucky, China might include a datasheet.

Thanks guys for the help ... I know the really simple solution would be just buy a CO Detector on Amazon but that would take all the "fun" out of it lol .... thanks again.

If this is for your robot, then experimenting is fun.

haven't received the CO detector yet since it is coming from China

Gives me the willies.

If this is for your house, and you want to keep your family safe, you're better off going to Walmart or Home Depot or the local hardware store, and buying an approved CO detector. I certainly wouldn't buy something like this cut-rate from China for use in the baby's bedroom.

No, not for any "real" protection ... I have a propane heater I use in the garage once in a while and I am the only one out there tinkering. I never let it burn more than 10 mins and always leave the door up a few inches just to be sure. Just more of a "tinker" thing.

Since it's you, it's ok, but we don't want no babies with blue lips and finger nails around here.

Well between 1978 and now I've had 5 babies and have managed to not fry or gas any of them so I'm 0 in 5 in that category haha. I think it's great that you guys share your knowledge and we all enjoy "playing" with our Arduinos. Since I am new to this where do you guys prefer to order your parts? I'd like somewhere in the U.S.A. that is priced reasonably with fast shipping and good customer service. Of course I'd pay slightly more providing the last two criteria were exceptional.

where do you guys prefer to order your parts?

As you mentioned you don't get good, fast and cheap at once...

Paying for DHL/FEDEX (about $17 for a physically small order) will get you fast (2 to 5 days) from China. Some Ebay sellers will do it.

DISCLAIMER: Mentioning stuff from my own shop...!! Leave now if you want :-)

I am trying to provide Good, Cheap (on-the-Shenzhen-Street prices) and Fast-If-You-Want with http://YourDuino.com PLUS lots of How-To on the http://ArduinoInfo.Info WIKI. Plus a live (if aged) Engineer who answers Customers's questions. I'm having fun, being very busy, and making a little money added to Social Security so I can buy my wife an Iphone for Christmas. Don't tell her!

Seriously, please critique the WIKI, suggest new topics, and pass the link along. It's at about 2000 hits a day, which motivates me to keep on adding to it.

I am a little off topic but, out of interest, how does a CO detector work?

I can figure out roughly how a smoke detector might work but telling the difference between CO and N2, O2, Ar, and CO2 seems like a neat trick.

Is is a chemical reaction, can the detector be used multiple times?

Ok guys I promise I will stop with the dumb questions... I have a 5 prong relay, I understand where the wires go except for the "trigger" from pin 12 on my Arduino ... using digitalWrite HIGH signal to activate the relay... where do I ground pin 12? To the 12v power supply? It seems if I ground to the Arduino it isn't a complete circuit. Please go easy on me I'm on my first cup of coffee. :-)

Put it to ground with a current limiting resistor, of say 3-5K ohms. If that is too much resistance, drop it to 1K.

Also as stated earlier, make sure you include a diode with that output, so that there is no back flow to the arduino.

DVDdoug also said,

It needs to have a Peak Reverse Voltage rating above the relay's coil voltage, and a Forward Current rating greater than the coil current.

Thanks Hazard, I have a diode on the output .... I'll stick a resistor on the neg side... the neg of the external power supply, not the Arduino correct?

Wait!! If your triggering the relay with one of the pins from the arduino then you need to ground it from the arduino, unless both the external power supply and the arduino have a common ground, then it wont matter. But just in case they dont, ground it to the arduino.

Since I am new to this where do you guys prefer to order your parts? I'd like somewhere in the U.S.A. that is priced reasonably with fast shipping and good customer service. Of course I'd pay slightly more providing the last two criteria were exceptional.

I buy most small parts from digikey.com, mouser.com, and jameco.com. All three have inexpensive Priority Mail shipping that typically takes only 2 days. They also all carry a lot of Arduino stuff nowadays, especially jameco.