Need help from arduino experts
May 19, 2011 2:12 PM   Subscribe

Arduino! I want to build a very basic network connected battery operated alarm system. What's the best kit for doing so?

The device is supposed to beep loudly if the network is down, a particular port on an internet host doesnt respond, or a socket connection is made on a specific local port.
Is an arduino ethernet shield enough? I am guessing i will also need an arduino board and software? Is there a board with builtin speaker, or a board that has slots for batteries?
Is there something like this that i could buy? Or, alternatively, is there a forum or place on the net where i could find someone to make this for me?

Sorry for all the questions, any help is appreciated.
posted by 3mendo to Computers & Internet (12 answers total) 3 users marked this as a favorite
 
Looks to me like the Ethernet Shield will work just fine. It only uses 4 pins, leaving you a pin for a beeper.

A quick browse through Digi-Key has a handful of "Sonalert" siren speakers that'll give you 85dB for a few mA so you can drive 'em directly off a pin. Just wire one side to one of your unused output pins, the other side to ground, and raise your output pin when you want noise.

In fact, it looks like there's even a Power over Ethernet (PoE) Shield, which would let you do away with the battery bits (let your UPS tell you when the power's gone...). At that point, building this thing is a matter of that shield, one of those speakers with a few leads soldered on to it stuffed into the auxiliary sockets on the shield, and a little bit o' code.
posted by straw at 2:36 PM on May 19, 2011


Best answer: An ethernet shield is no good without an arduino. You could buy an arduino, or alternatively buy a cheaper arduino clone. Many of them are near-identical and will take the same shields. You can power the arduino from batteries easily enough.

For the alarm sound you might want to use a piezo buzzer. Much easier than having to generate your own sound and play it through a speaker.

As for the individual tests you want to perform, the only problem I can see is with the test for a socket connection on a local port. How will the arduino know that a connection has been made to a different device (i.e. not the arduino, presumably) on a particular port? Maybe someone with a better knowledge of networking can answer that, but it sounds like it might not be straightforward.
posted by le morte de bea arthur at 2:41 PM on May 19, 2011


Best answer: le morte de bea arthur, I interpreted the test to be that the Arduino based device would attempt to connect to a port at some interval, and if that connection failed then the alarm would sound.

(Which suggests that you also want an LED (with appropriate resistor) in parallel with that alarm and a disable switch to turn the audio portion off...)

Oh, super easy way I've used to power an Arduino device with rechargeable batteries: Just use a Minty Boost (though in my case I omitted the USB plug and just soldered the wires over directly). Or you could use a 6v lantern battery with a diode to drop the output voltage .7v to bring it down to within specs on the Atmel chip.

One thing I don't know is how much power the various Ethernet Shield options draw, or whether you need to have the Arduino running while waiting or a connection, which is an argument for PoE.

Too much more than this and I start charging for answers, but on the "get someone else to make it for me", what you're talking about is simple enough that I think you should build it yourself, because once you do you'll suddenly start to see places you can use computers for other interesting tasks. Sure, you'll probably let the magic smoke out of a few components, but once you get the whole thing working it'll open up a whole different set of ways to solve problems.
posted by straw at 2:59 PM on May 19, 2011


Response by poster: I will definitely use a piezo beeper, the sonalert sounds just like what i want..

le morte: any idea what is the best board for a beginner? I seem to understand you can code for arduino in various languages; since I will be making use of net libraries i would like to start with something easy..

non-arduino solutions are welcome too.. This will never leave working prototype stage.

thanks for the tips so far!
posted by 3mendo at 3:03 PM on May 19, 2011


Response by poster: btw, i just realized that i could used USB power for this project, so i suppose i could draw a little more power for the speaker.
posted by 3mendo at 3:05 PM on May 19, 2011


Response by poster: i am also not currently set up for PoE, so i think i will go with whatever is easier at this stage -- USB i guess - so maybe this could influence my choice of board & shield.
posted by 3mendo at 3:09 PM on May 19, 2011


Best answer: You don't need a slot for batteries, you just need to put a barrel connector on a battery pack of some sort and plug it into your arduino. That one assumes a typical board with power protection/conversion circuitry allowing a 6v-20v input. I'm a little perplexed exactly where you're going to have an ethernet connection and no mains power to just use a wall wart but, hey, it's your project.

Unfortunately using USB power isn't necessarily a slam-dunk; The larger boards with conversion circuitry expect 6v+ so they can provide a stable 5v output line. You may want to use a boarduino style which will run off USB power levels.

That's probably what I'd do. Get a wave shield and socket it into the breadboard and jumper the 4 I/O lines necessary to use it. You could put it together on the breadboard but for something like this I'd personally prefer to have a known quantity and concentrate on the other aspects.

For your buzzer there's plenty of options or you could drop another $20 and get the WaveShield and just play any audio file that it amuses you to do. Again, you'd not be using the shield in the traditional way but if, like me, you don't tend to have all these bits around and handy it might be worth it just to buy a ziploc baggie with all the bits.

I'm honestly still a little perplexed about why you're doing this in an embedded system rather than just scripting it in a few lines of perl...
posted by phearlez at 3:41 PM on May 19, 2011


Response by poster: i found this enclosure which supposedly supports powering via usb or 9v battery, and will probably use it (using usb for now) -> http://www.robotstore.it/open2b/var/catalog/b/233.jpg

phearlez: i have done it already in slightly more lines of nodejs, with speech-synthesizing bells and whistles; this device is supposed to alert me (and the whole neighborhood) if that system goes down.
posted by 3mendo at 3:57 PM on May 19, 2011


Just had a "duh" moment: yeah, most Arduinos have a power jack that'll take pretty much anything with a barrel connector from 6v to 25v. So you can easily run it with a wall wart.

To phearlez, one of the reasons to DIY is to learn new tech.

Oh, and if you know anyone with a soldering iron, they probably have a bin full of buzzes like the one I mentioned. If you're anywhere near me (North SF bay), drop in and I'll pull one out.
posted by straw at 5:45 PM on May 19, 2011


Don't try to do multiple complex things (eg, Ethernet + Waveshield) in your first project. I'd stick with Ethernet + piezo buzzer. The Arduino environment does a good job concealing some of the ugly microcontroller programming, but it makes debugging library conflicts (eg, Ethernet vs. waveshield) a complete pain in the butt. Unfortunately you cannot import a bunch of arbitrary libraries at the same time and expect them to coexist peacefully.

About 2 weeks ago I had to talk another faculty member off a ledge when, in the course of helping her debug her "intro" project, we found out that two libraries she was using (in this case Wire/Servo.h and Waveshield) both wanted to hook into the Timer1 compare interrupt (a feature of the microcontroller totally concealed from most users by Arduino), suddenly converting her Tinkertoys-style beginner project into varsity-level microcontroller hacking.

tl;dr: When given the option of making it more simple, make it more simple. Someday I may even be able to heed this advice myself in addition to giving it to others.
posted by range at 8:25 PM on May 19, 2011


I would heed range's advice... especially when dealing with sound + Ethernet. I imagine the Ethernet library modifies the timer interrupt, and probably any sound libraries would too. If you're going to DIY it's a simple matter to change the speaker to a different PWM output, while if you're stacking shields you can run into conflicts.

As for the Arduino itself, if you don't have a soldering iron just get the basic Arduino Uno. If you do have a soldering iron and want to DIY, there are kits available for significantly cheaper, although I don't know of any offhand that are shield-compatible. There's also Sparkfun's premade Ethernet shield, which actually costs more than the Arduino does...
posted by neckro23 at 9:45 PM on May 19, 2011


Response by poster: range, i should keep that in mind.. instead i am looking at a bifferboard now. Hard to resist an x86 and it costs about the same when you count an Uno+Shield.
posted by 3mendo at 6:33 PM on May 20, 2011


« Older What is the name of this film?   |   How can I get my cat to eat? Newer »
This thread is closed to new comments.