Playing with Arduino

I finally managed to start playing with the Arduino again – I’ve had one for a couple years, and played with it a bit as soon as I got it, but then it sat on my shelf of unfinished projects.

My collection actually has three Arduinos – one is a Freeduino with a USB interface, and the other two are intended for use on a breadboard (a Boarduino and a Bare Bones Board). For a while, I’ve been intending to use the Freeduino to program the chips on the other boards since I don’t have the right cable to connect them otherwise, but I hadn’t realized that on the arduino.cc site, they actually have instructions for doing that. In addition, they show the most minimal setup possible – which only requires an AVR, a resistor, a capacitor and a few wires if you use the internal oscillator. How much else you need depends on what you are using the Arduino for, but it certainly makes the idea of embedding the Arduino in a project more interesting since it drops the base cost under $10.

I’m currently playing with two projects – reading a SD card, and controlling a servo. The SD card is to see if a ‘dead’ card that a friend has can be accessed via SPI. I’m assuming that the typical USB readers use something other than SPI since that is a slower mode of access, and is optional on microSD cards. I’m going to set up a breadboard with a circuit to access my test card (a 32 Mb Canon card) until I get a chance to pick up a 74AHC125. The issue is that SD cards run at 3.3V, while the Arduino is at 5V. I can use a resistor divider setup to interface to SD cards, but if I want to support SDHC cards, I need to be able to meet the 10ns risetime requirements in the spec, which the 74AHC125 should manage.

The servo is going to be controlled by the Arduino via an IR remote. I have an IR receiver module that keeps things simple – feed it power and it spits out a clean signal that you can connect to the Arduino. From there you need to decode the pulses to figure out what key was pressed, and take appropriate action.

As far as the servo goes, I have never used one before, so when I hooked one up today, I wasn’t sure how difficult it was going to be. There is a sample sketch that is provided with the Arduino IDE that sweeps the servo back and forth, and I loaded it up on the Arduino and expected to see some motion. No such luck…. no motion at all. I checked with Google, and found some forums where other people were having trouble, but nothing that appeared to be my problem.

Then I did a check on my setup – power and ground hooked up? Check. Control signal? Check. Servo voltage of 5V enough to drive it? Yup. Control signal hooked up to the right Arduino pin? Uh-huh. I finally tracked the problem down to the jumper wires I had used to connect everything. I had soldered some pins to each end of some lengths of wire to make it easy to get a good connection with the stranded wire I was using – unfortunately, the control wire had a bit of extra solder on the one side. And wouldn’t you know it, that was the side that was facing the power connection. I had a short between 5V and the control signal, so as far as the servo was concerned, there was no control signal.

Once I fixed that little issue, the servo started turning back and forth as expected. Now all I have to do is remember how to decode the IR input and make it control the servo. That shouldn’t be very hard, should it? In any case, I’m going to play with it tomorrow and see where I get. I’ll try real hard to do a decent write-up if I manage to get it working – same for the SD card reader….