Arduino

This page has moved, click here to be redirected.

I had seen the name Arduino pop up many a time on Hack-A-Day or Make Magazine Blog with wide ranging uses and projects. In June 2012, on a whim, I decided to pick up a board and get back into hobby electronics. Some time in 2011 I had started a project to make an animatronic hand. The mechanical side of it was started and the micro servos had been bought but the project was shelved before the two were combined. The Arduino was bought with the intention of completing the animatronic hand, these pages describe my experience along the way and some other projects I have in mind for the Arduino.

Projects

Digisparks, lots of them

Status: Only just begun

I backed the Kickstarter for these small Arduino-compatable ATTiny85 boards. They're pretty compact yet pack a decent punch. Each has 6 I/O pins, with 2 directly tied to the built-in USB plug. The pins are capable of Analog, Digital, PWM and Serial/I2C etc as you would expect to see on an Arduino and I envisage using one or two of these in simple applications where a full-blown Arduino would be overkill. Since the Kickstarted did splendidly they were able to add 'shields' and I picked up a few RGB LED shields, a motor driver shield and a few others besides. The motor driver shield was my first forray into surface mount soldering and thanks to the solder station at MAKLab it was a relatively painless experience. I have two small motors wired up to the driver shield and intend to turn this into a very tiny

48-wheeled Rover 5

Status: Started / Remote Control Only

Name is only temporary as this robot base is a test platform and I haven't decided what I'm going to do with it yet. The Rover 5 arrived with SPANR (see below) and other robot bits and pieces from ebay. It is 4-wheel drive with quadrature encoders built into each gearbox. Combined with the Dagu 4-Channel Motor Controller (which it appears was designed for this robot base), an Arduino UNO (though I intend to upgrade to a Mega as I've run out of pins before connecting the quadrature encoders) and a APC220 serial wireless transciever the platform has become a radio controlled car. The original wheels/hubs were broken so I went looking for alternatives (buying replacements was expensive due to shipping costs) and I ended up printing and building Mechanum Wheels from files on Thingiverse. The robot can drive forward, back, strafe left and right, move diagonally but doesn't like turning on the spot (results in the o-rings popping off the wheels). He drives well on carpeted surfaces and some hard surfaces but lacks the suspension to handle uneven hard surfaces well.

The remote control is practically an Arduino project in itself. An Arduino Mini is hidden within an old RC Tank controller with the digital and analog stick wired to the inputs of the Mini. A 16x2 LCD and a spare potentiometer were added to the controller and I may return to add a few push-buttons at a later date. Wireless control is handled by another APC220 serial wireless transciever, which allegedly has a 1km (line of sight) range though I've not yet put that claim to the test.

SPANR

Status: Started / Remote Control Only

SPANR, acronym for Self Propelled Acer Netbook Robot and pronounced 'spanner', hasn't seen much modification from the form in which I bought him. Part of a collection of robotic bits and pieces I bought on ebay. I've wired up the Arduino Mega to the Dagu 4-Channel Motor Controller and added a 4-port USB hub. These are all housed in the project box which sits above the Acer Aspire One netbook (which has been stripped of all housing). The original LCD is mounted on the back face of the robot and, with the use of a Processing sketch I wrote communicates with the Arduino Mega (running firmata), displays data on each of the four motors (desired speed, actual speed (PWM) and current consumption). The four gearmotors are attached to chunky wheels and driven by the motor controller and a large 12v battery sitting down in the base (Lynxmotion 4WD). Experimenting with adding sensors such as ultrasonic rangefinders, compass, gyro and acclerometers. I intend to add quadrature encoders to the wheels, though not yet determined how.

This isn't really an Arduino project, since the Mega is just a glorified Input/Output board at present. This might change with the addition of sensors and I may program the Arduino to handle more of the low-level interfacing side of things to let the Processing (or other software running on the Acer) handle higher level thinking. Adding webcams and vision software is one aspiration for this robot but I'm not sure I'm up to the task yet of programming for that.

stEve

Status: Done / Perpetual

A toy robot named stEve (as he was built on Christmas Eve but didn't suit the name Eve), built around a robot-shaped tin using an Arduino Duemilanove, two 5v stepper motors. The stepper motors drive elliptical wheels so that stEve 'waddles' along. The wheels were hand-made from polymorph (aka shapelock), plastic that melts at 60degC. The chassis is balsa wood and lifts out of the tin for modifications or for reprogramming the Arduino. Thanks to some comments on the robot's page on LetsMakeRobots.com I've been investigating the addition of audio to stEve and ended up hacking up the Auduino code (grain synthesiser on an Arduino) to work with my stepper motor code. Originally I had the sound produced by a piezo but I'm now building a small amplifier from a 386N IC to drive a small 8Ohm speaker.

Light Painting Arm

Status: Set Aside

Currently working on a prototype to generate light spheres in long exposure photographs. The prototype is assembled from spare parts I had lying around: two hobby servos, some balsa wood, LEDs and my Arduino Mega (with Ethernet Shield for the SD card reader). The arm is held together with zip ties which makes for a quick, non-permanent assembly perfect for a testbed.

Software run on the Arduino scans the LEDs across a hemisphere (limited to 180deg scan due to the servos) while selectively lighting the red, green and blue LEDs to blend colours.

Animatronic Hand

Status: Set Aside

Mechanical: Hinges from RC Airplane control surfaces and Polymorph (plastic that melts at 60degC) with cable guides from bent brass tube. Fishing line threaded through the cable guides run to micro servos which are mounted on a block of balsa wood. Each finger has a single channel which runs down the back of the finger and instead of the fishing line connecting to a servo, this connects to a spring. The spring tension should be enough to return the fingers to their extended position when the servos slack off / feed out enough fishing line.

Electrical: The 15 micro servos are powered by 4 D-cell batteries. The servos signal lines are directly tied to 15 pins on an Arduino Mega ADK. I used a simple perfboard shield to keep this tidy. The Arduino Mega ADK has a built-in USB Host shield, used to connect to my Android phone (Samsung Galaxy S II for those who are curious, though any Android phone with OS > 2.3.2 should do). A 16 x 2 character LCD gives feedback when the phone is not connected, although serial commands can also be picked up on my PC for debugging.

Software: Running on the Arduino just now is a sketch which connects a Wii Nunchuck and uses the joystick for control of individual servos or groups of servos. Different modes of operation are selected by tilting the nunchuck on its side (calculating the roll from the nunchuck's 3-axis accelerometer). There are also some pre-canned skits which are acted out by the servos and scripted by tracking the milliseconds since the skit started and conditional statements to perform different servo movements based upon the time. The Arduino-Android interface is taken care of using HandbagDevices. Buttons and text on the Android phone are created in the Arduino sketch and communicated over the USB connection to the phone. This means I don't need to concern myself with writing an Android app (something I think I'll be putting off for quite some time) and can concentrate on Arduino sketches.

Using code fround at circuitsathome.com I was able to interfacing a PS3 controller to an Arduino with a USB Host shield using the USB cable (as opposed to using bluetooth). In using this code I have lost the ability to connect my Android phone both because the USB port would be used up but more importantly because the libraries it uses are not compatable with HandbagDevices. With the PS3 controller I made use of the two joysticks for controlling two servos or two sets of servos simulatenously. Direction pad swapped between selections and modes while the LEDs displayed feedback on the current mode.

I took the animatronic hand to a meeting of the Glasgow Open Source Hardware Group at the hackerspace Electron Club in Glasgow's CCA. I adapted my code to accept either PS3 controller over USB or the Wii Nunchuck. This way I was able to demonstrate both but I didn't attempt Handbag as it uses specific libraries adapted from USB Host v1 while PS3 controller support is part of the USB Host v2 library. If I can take a look at the difference between the libraries (which might be way over my head) perhaps there is some way to support both or select between either of these input devices at Arduino reset.

Tinkering

Status: Done / Perpetual

Before using the Arduino to control the animatronic hand I played around with various components that I had in storage from when I experimented with PICmicros. I had bought a few sensors and scavenged many components from dead VCRs, TVs and PCs. To aquaint myself with the Arduino I plugged these components in and played around. I read through a few of the books available though I didn't follow through any of their projects (either too simple or needed specialist components that I wasn't willing to buy just to follow their example).

Ethernet connected Arduino

Status: Waiting

I bought the Ethernet shield when I bought my Arduino. I didn't have any plans for it at the time and still don't yet though I had seen projects on HaD & Make-zine that use it to interface with websites or host interactive webpages. The ethernet shield also has an SD-micro slot and would lend itself well to data-logging, though I'm currently using the SD facility to display images on my Light Painting Arm.

Toy Robot Arm Kit

Status: Planning/Long way off

Certainly not breaking new ground with this project idea. I was given an OWI Robot Arm Kit (OWI Robotic Arm Edge from Elenco Electronics Inc) for Christmas two or three years ago and promptly built it, played with it and shelved it. I intended to go back to it at some stage and improve the controls (hard-wired remote control with a double-pole three-position switch for each motor). I've since seen this same kit show up on Hack-A-Day and Make Magazine once or twice with the most memorable being internet-controlled and observable via web-cam. The kit is available with USB connectivity but (a) I'm not interested in buying another kit and (b) would find more enjoyment from wiring it up myself. Possible modifications would involve some sort of position feedback (potentiometer, rotary encoder, limit switches) and/or changing the end effector (currently a gripper with an LED).

Cybot platform

Status: Long way off

Bought an old Cybot off e-bay many years ago and had it fixed up and running with the peripherals that came with it. It could make a good starting point for a mobile arduino platform if I ever decide to get back into the roaming robot tinkering.

Hexapod/Octapod

Status: Long way off

I'd love to build a hexapod or octapod walking robot base. I'm on the lookout for some cheap and cheerful servos and if I find some I'll start looking at options for fabricating the legs and body.

Notes

Using the USB Host Shield 2.0 library with Arduino Mega ADK

Took me a little too long to figure this one out. In the avrpins.h file within the USB Host Shield 2.0 library (project home page circuitsathome.com) uncomment the line #define BOARD_MEGA_ADK to use the built-in MAX3421e USB Host port. After seeing comments online which alluded to this I tried defining this line in different files until I struck upon the complete comment which explicitly stated that it was in the avrpins.h file. Once I did that I had the PS3 controller up and running with the USB cable and was able to use USB_desc on any USB device I plugged in (this sketch just simply returns descriptions/configurations/details about a USB device connected to the host shield).

Links

Tutorials

Books

Disclaimer

You follow these links and instructions at your own risk. I accept no responsibility for the contents of external website or for your actions.