Arduino Robots

by chunkyhampton in Circuits > Robots

14744 Views, 91 Favorites, 0 Comments

Arduino Robots

IMG_20150318_102941_sm.jpg
IMG_20150318_094049_sm.jpg
IMG_20150317_182858_sm.jpg

These are my take on a small re-programmable robot using an Arduino as the brains.

These were built as part of my work as Maker in Residence at Derby Silk Mill in the UK.

I wanted to integrate something physical with the Code Club that is being run at the Silk Mill museum. I also wanted to have something that could be altered, changed and upgraded using the tools within the Silk Mill.

This is a simple plastic base with two motorised wheels and a motor driver which is controlled by an Arduino. There are two sensor switches on the front, which could be changed for, maybe, an ultrasonic sensor.

There is an area of breadboard for adding additional circuitry.

There is more information about my residency here and about the other Makers in Residence here.

Parts and Tools Required

IMG_20150317_164722_sm.jpg

The parts you will nedd are:

  • 4 x 12mm hex threaded spacers
  • 8 x 6mm hex threaded spacers
  • Various M3 fixings, machine screws and nuts
  • 1 x 2.1mm barrell jack plug - to fit Arduino input power socket.
  • Wire

Tools you will need are:

  • Soldering iron and solder
  • Drill with countersink bit.
  • Access to a Laser cutter

Laser Cut the Base Plate

IMG_20150317_164830_sm.jpg
2015_03_13_MiR_Arduino_Robot_base_No_OUTLINE_2_A4.png

Cut out the attached .dxf or .svg file in the 3mm acrylic using your handy laser cutter (or one at a loacl hackspace). Maybe come down to the Silk Mill to use their laser cutter?

You will have 5 pieces - the main base and four identical motor holders.

You might need to alter the switch hole for your exact switch shape.

Add PCB Stand-offs

IMG_20150317_165034_sm.jpg
IMG_20150317_165059_sm.jpg
IMG_20150317_165409_sm.jpg
IMG_20150317_165441_sm.jpg
IMG_20150317_165615_sm.jpg

We dont want some of the screws to stick out, so I used counter sunk head screws and a countersinking drill bit to ensure the screw heads are flat.

The screws that are under the breadboard and under the battery holder all need to be countersunk.

This means countersinking two lots of four holes and adding spacers to attach the Arduino and to attach the motor driver. The Arduino will sit on the top of the board, so the countersunk holes are on the bottom.

The motor driver is on the base of the unit, so the countersunk holes are on the top.

Screw on 6mm or 10mm threaded hex spacers using short countersunk M3 machine screws, as shown.

Add Battery Holder

IMG_20150317_170237_sm.jpg
IMG_20150317_170242_sm.jpg

Add the 6 x AA battery holder to the underside of the base using 2 x M3 machine screws.

Add Motors to Base

IMG_20150317_170714_sm.jpg
IMG_20150317_170815_sm.jpg
IMG_20150317_172705_sm.jpg
IMG_20150317_172740_sm.jpg
IMG_20150317_172746_sm.jpg
IMG_20150317_175137_sm.jpg
IMG_20150317_175350_sm.jpg

Solder 15cm wires to each of the motors.

Attach the motors using the plastic motor holders. One of these fits through the slot and the other has a notch to stop it sliding down.

The machine screws which hold the motor need to be 28mm long. This is difficult to find so I used 30mm screws and cut them down slightly. Using the 30mm screws meant they hit into the battery pack.

Do this on both sides and tighten to hold the motor.

These pictures show this being done after the battery holder has been added - this is not ideal as the holder gets in the way of the nuts. Next time I would put the motors on first then attach the bvattery holder.

Add Bump Sensors

IMG_20150317_171514_sm.jpg
IMG_20150317_171609_sm.jpg
IMG_20150317_171614_sm.jpg

Add the two microswitch sensors on to the front of the unit.

There are mounting holes for both smaller and larger standard microswitches.

I used two smaller microswitches with 37mm levers. The levers are not quite long enough and I will add a longer piece to them in the future.

I used M2.5 machine screws and nuts, as the holes were too small for M3.

Add Power Switch

IMG_20150317_172052_sm.jpg
IMG_20150317_172057_sm.jpg

The power switch pushes through the hole at the back of the base.

I used a single pole switch in this version and switched everything in the negative line - this is not ideal and I should have use a douple pole single throw switch to switch both the motor power supply and the Arduino power supply.

Two power supplies are required as the motors only need 3 or 4.5V, where as the Arduino input needs to be 6-12V.

I sorted this by tapping the 6 x AA battery holder at the mid point, so there is a supply of 3 x AA batteries (4.5V) and 6 x AA batteries (9V). This will mean that half the batteries will run down more quickly, but they can be rotated.

Add Back Caster Wheel

IMG_20150317_181215_sm.jpg
IMG_20150317_181341_sm.jpg
IMG_20150317_181418_sm.jpg
IMG_20150317_181426_sm.jpg

The two motors can be driven to stee the robot.

The back swivel caster spins depending on the direction the robot is travelling.

I wanted the robot base to be level, so used some spacers to make the caster wheel a bit lower.

Iused 4 x 12mm M3 PCB spacers for this, but layers of acrylic could be used for this.

Ensure the heads of the screws do not interfere with the caster wheel spinning around.

Add Motor Driver

IMG_20150317_181918_sm.jpg
IMG_20150317_181957_sm.jpg

The motor driver screws on to the underneath of the base of the unit.

4 x short M3 machine screws are used, so it can be removed in the future.

The output pins of the arduino cannot supply enough current to run the motors (you could damage your Arduino ifd you wire these motors directly).

The motor driver has four inputs to control two motors in two different directions. This motor driver can control up to 2A peak current.

Add Wheels

IMG_20150317_182013_sm.jpg
IMG_20150317_182043_sm.jpg
IMG_20150317_182050_sm.jpg

The wheels just push fit onto the geared motors.

Add Arduino Uno

IMG_20150317_182854_sm.jpg
IMG_20150317_182858_sm.jpg

The Arduino Uno fits onto the top of the robot. Use 4 x short M3 machine screws to hold it onto the spacers we attached.

Wiring Diagram

Arduino_Robot_MiR_bb.png

We are going to wire up the robot accroding to the attached wiring diagram.

Five Arduino outputs are used to control the motor:

  • Motor driver Sleep - controls if the motor driver is on or off
  • Motor 1 forwards
  • Motor 1 backwards
  • Motor 2 forwards
  • Motor 2 backwards

There are two digital inputs:

  • Left microcswitch sensor
  • Right microswitch sensor

There are two power supplies - one at 4.5V and one at 9V.

(Note: I used a Kitronik motor driver, rather than the poloulou one shown in the diagram.)

Wire Motor Driver

IMG_20150318_091219_sm.jpg
IMG_20150318_091334_sm.jpg
IMG_20150318_091346_sm.jpg
IMG_20150318_091421_sm.jpg
IMG_20150318_091535_sm.jpg
IMG_20150318_091703_sm.jpg

We solder the wires from the two motors to the outputs of the motor driver.

Use the vaious holes in the base so wires are kept neat and contained.

There are 7 wires to attach to the motor driver inputs:

  • +4.5V power
  • Ground
  • Sleep
  • Motor 1 forwards
  • Motor 1 backwards
  • Motor 2 forwards
  • Motor 2 backwards

The ground wire will be connected to the common ground from the AA battery pack.

The +4.5V wire comes from a tap in the middle of the 6 x AA battery pack.

This goes through one pole of the On/Off switch.

Add Power Wiring

IMG_20150318_092530_sm.jpg
IMG_20150318_092601_sm.jpg
IMG_20150318_092624_sm.jpg
IMG_20150318_092628_sm.jpg
IMG_20150318_091807_sm.jpg
IMG_20150318_091905_sm.jpg
IMG_20150318_092039_sm.jpg
IMG_20150318_092128_sm.jpg

Add a wire to the middle of the 6 x AA battery pack, as shown.

I looped the wire around the metal spring and soldered it, but being careful not to melt the battery holder plastic too much.

I extended the red wire from the 6 x AA battery holder and took this through the other pole of the power switch and to the Arduino power input.

I used a 2.1mm barrel jack to power the Arduino - this means we can easily unplug it and replace the Arduino, if required.

Wire the +ve wire to the inner pin and the ground to the outer of the barrell plug. Remember to put the cover on before you solder....

We now have power to everything.

Finish Motor Controller

IMG_20150318_092837_sm.jpg
IMG_20150318_093102_sm.jpg
IMG_20150318_093113_sm.jpg

The wires form the motor controller are wired to inputs on the Arduino.

These can be changed in software, but I cohose the following:

  • D8 - Motor 1 forwards
  • D9 - Motor 1 backwards
  • D10 - Motor 2 forwards
  • D11 - Motor 2 backwards
  • D12 - Sleep

I soldered these wires on to header pins which I plugged into the socket on the Arduino.

Wire Bump Sensors

IMG_20150318_093203_sm.jpg
IMG_20150318_093338_sm.jpg
IMG_20150318_093423_sm.jpg
IMG_20150318_093610_sm.jpg

The microswitches connect to ground whne activated.

I used a ground wire which goes to the common pin of the two microswitches.

Two other wires god back to digital inputs on the Arduino - I used D6 and D7, but this can be changed in software.

Add Breadboard

IMG_20150318_093632_sm.jpg
IMG_20150318_093641_sm.jpg
IMG_20150318_093928_sm.jpg

The breadboard is for future changes and is stuck onto the top of the front of the robot.

A commonly available ultrasonic distance sensor can easily be added to give thre robot more sense.

Program Arduino

IMG_20150318_093928_sm.jpg

I wrote a very simple Arduino sketch, given here.

This is a 'bump and go' sketch which makes the robot back away and then turn slightly when one of the front sensors are activated.

You need to upload this using a USB cable via the Arduino IDE.

Add Batteries and Let It Run!

IMG_20150318_094336_sm.jpg
IMG_20150318_094346_sm.jpg
IMG_20150318_102944_sm.jpg

These robots have been designed to be highly configurable and reporgrammable.

The plan is to use program them using Scratch and a converter which converts the Scratch code into and Arduino sketch.

I will try and add instructions for doing this when I can.

I produced four of these simple robots for the Silk Mill code club - hopefully they will be programmed to do amazing things by our next generation of skilled coders....