::::: : the wood : davidrobins.com

New Arduino, project progress

News, Technical ·Saturday December 17, 2011 @ 21:56 EST (link)

I have an idea for a project, and I remembered an IEEE Spectrum article about a guy that set up a microcontroller called an Arduino to respond to tweets and update his office door ("Send a Tweet to your Office Door", June 2011). I looked into it; it seemed right for the project, based on what others had done with it, and the price was right: the board sells for under $30 (an explicit goal of the creators, a group in Italy). So I ordered a bundle with the Arduino Uno (1.0) and a breadboard and pack of jumper wires, which arrived last week. I ran the Blink example, worked fine; then I looked for something bigger and better. First I had to brush up a little on current, voltage, and resistance—I never took any formal electronics courses, but the Internet has plenty of information, although it requires sifting as always. (The Lounge was also very helpful.)

I wanted remote control, and this post had some great information, so I picked up the Radio Shack 38kHz IR module and connected it to the 3.3V Arduino power via the breadboard and the other side to ground. (I later added a 220Ω resistor, although it was working fine without it, but I didn't want to burn anything out.) In that first trip to the Shack I also grabbed a 9V snap connector (actually I had to buy a pack of them) and a size "M" DC power plug (5.5mm outer diameter, 2.1mm inner diameter) to connect it to the Arduino. It is normally powered via the USB connection, but of course that won't be possible at a remote site. I wired the signal pin of the IR receiver to a digital input pin of the Arduino, and built a basic program around the IR library from this page to decode and dump received input, and then write a basic program to turn the on-board LED on and off when the power button of an old Sony remote was pressed.

The project requires moving a motor, however (or an actuator perhaps, such as one of Firgelli's line of micro linear actuators), but since a motor is so much cheaper I started there. The Radio Shack 1.5-3.0V DC motor I had picked up drew 0.98A of current, or 980mA, and the Arduino is only rated for 40-50mA. I definitely needed another power source.

Back to Radio Shack (and I'd buy somewhere else if I knew somewhere cheaper with good selection, but I haven't found anything, although I've joined a local microcontroller meetup group and will ask there). This time, I picked up some resistors (a few to have around: pack of 5 each of 100Ω, 220Ω, and 1kΩ), an SPST reed relay, and a 2-AA battery holder. The relay allows for opening and closing a switch in another circuit (which might be passing more current) by energizing its coil. Since the relay itself is a 250Ω resistor, I didn't add a resistor there; I just added it in parallel to the existing 3.3V connection, put batteries into the holder (1.5 x 2 = 3.0V) and connected it to the second power strip on the breadboard, and made a circuit with the motor, battery, and the switched pins of the relay. I connected an Arduino digital output pin to the coil (other side to ground) and (once I remember I had to configure the pin to OUTPUT), was soon toggling the motor on and off with the remote, although I don't have a good setting or connector for the motor: I need to pick up some alligator clips and something to hold the motor. I may eventually want to slow it down (first by just using one battery, perhaps, and then with something more complex such as an H-bridge), but I'll see how it does with a moderate load first.

Nonetheless, I was glad to have it working thus far. The next steps are going to be more on the mechanical side of things: picking up bits and pieces from Home Depot to build the frame of the device, a gear to attach to the motor, etc. Eventually I'll want a soldering iron and PCB, project box (a tidy-looking box to put all the non-exposed parts in, with a hole for the IR receiver and motor control leads), and other finishing touches, but it's still very much in the design stage so I don't have to learn to solder just yet. (Keeping this equipment kit link here for reference.)