This instructable is a description of the build process of the custom robotic kits designed for and used by University College Dublin ElecSoc. These kits are designed as an introduction to robotics and the arduino ide. The kits use easily accessible parts and is designed to accommodate modification and hacking. Some sample code is available here (https://github.com/Chris-j-hill/sumo_test) and is designed to work with a variety of different hardware setups, which is aimed to abstract away the low level operations required to control individual pieces hardware and simplify the process of getting the kits up and running. The aim of these kits is to remove the complexity of dealing with a lot of different motor drivers and sensors while providing a flexible platform for interacting with this hardware with relative ease.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Mounting the Motors
The first step is to attach the motors to the motor mounts. The motors are just held in by friction as can be seen in the image. There should be four motors with a mount for each. It is preferred to mount the motors in such a way so as the wires will, when mounted to the chassis, face inwards towards the centre. This way the wires to the motors can be kept neat. Note that the Arduino can only be mounted to one side and the sumobot is designed so as it is on the top side. This will guide which side the motors should be mounted, as they should be on the bottom side. The mounts can be mounted using a combination of 10mm screws and two 20mm screws. The longer screws are required at the front of the chassis as the same screws will later be used to mount various sensors. It can be useful to feed the motor wires through the circular hole in the center of the chassis to keep things neat if the wires are particularly long.
Step 2: Mount the Arduino
The Arduino can now be mounted to the chassis. There are four holes in the Arduino that should match up with four holes near the middle of the chassis. The Arduino can be mounted using four or three 10mm screws. It can sometimes be difficult to mount the screw nearest the usb port, so if it doesn’t fit, three screws can suffice as can be seen in the pictures.
Step 3: Mount the Motor Driver
The next step is to mount the motor driver on top of the Arduino. The male header pins on the driver for the most part should line up with those of the female pins on the Arduino. However there are a couple pins that will be left unused on the Arduino. To line the two boards correctly align the pins furthest away from the power and usb ports on the Arduino with those of the corresponding pins on the motor driver, and make sure to then push the two together fully.
Step 4: Mounting Sensors
Next you can mount the sensors to the sumobot. To start with, try mounting two line sensors and a distance sensor to the front of the chassis using the longer screws of the motor mounts to attach to. We found it works best to mount the line sensors first. The hole in the line sensor can be used to mount it to the same screw.The distance sensor will need to be slotted into a holder as can be seen. The distance sensor mount then should be able to slot onto the same screws on top of the two line sensors. Using a couple nuts, the distance sensor can be secured, also securing the line sensors
Step 5: Mount the Battery
The next step is to mount the battery. There is an area near the rear of the chassis marked with the location of where the battery should be mounted. This can be done using some velco, attached to the battery itself and the chassis. Using velco will allow for secure mounting will also allowing for easy removal if the battery needs to be removed to be charged or for another reason.
Step 6: Connect the Boost Converter and Set Voltage
The battery must not be connected directly to the motor driver. This is because the battery voltage will drop as the battery is used. In the case of the green nimh batteries provided the voltage can drop to near zero volts, which would not be able to provide enough power to maintain the performance of the sumobot. To deal with this issue the sumobot uses a dc dc boost converter. This should be connected between the battery and the driver input power terminals. There should be a black and red soldered on the input to the boost converter. This can be attached to the battery. Before attaching the output of the converter to the input of the driver, we must first check the output voltage of the converter. The converters provided can be set to a relatively high voltage (above 25v) but which is enough to cause damage to various components on the driver or Arduino. There are multimeters provided on the benches in the lab, which can be used to read the output voltage. The boost converter has a small screw on it which is what is used to control the output. Using a screwdriver adjust this until the output is in the range of 6-8 volts. Once this is set, connect the converter to the driver input. The output of the converter marked out- is the ground wire and the out+ is the positive wire, which should be connected to the screw terminals marked ground and m+ respectively. It can be useful to attach the boost converter to the top of the battery using another tab of velcro, to keep things neat.
Step 7: Preliminary Test
It is a good idea at this point to upload a test code to the driver. This is because the motors are rated for 3v while the input of the motor driver is somewhat higher than that. In order to overcome this problem there is a function implements in the file “functions” which is used to step down the output to the motors. In this file there are two constants defined. One which is the input voltage to the driver, this is what you set the dc dc converter to earlier, which should be between 6 volts and 8 volts. Change this value in the code to be the appropriate value for your setup. The other value is the rated voltage of the motors. In the case of the kits provided the motors are rated at 3v so this should be set as such. Once this is set, go back to the file sumo_test. Make sure the line “AF_Shield mybot(1,3, scale);” is included near the top of the file. Then change the code with the block called “void loop()” to only have the line “mybot.drive(100);” then upload the file to the arduino using one of the usb cables provided. This should set the output on the screw terminals marked m1 and m3 as 3v if everything is connected and set up correctly. This can be checked again using a multimeter.
Step 8: Connect the Motors
Once the output is confirmed to be operating within the correct range (ie up to 3v), you can connect the motors, connect the motors on the left side of the chassis to the motor driver screw terminals on the left hand side and the right motors to the terminals on the right side as shown. Note that the motors should be connected in parallel, meaning one wire from both left motors should be wired into the same terminal and the other wires of the left motors both connected the other associated screw terminal. As of writing this the code does not support connecting one motor to each terminal, though it is possible which would allow control or each motor individually.
Step 9: Attach the Heat Sink
Next, attach a heat sink to the top of the motor driver as shown. This is because the driver chips in the board can get hot when trying to supply the current for all the motors for extended periods of time. The heat sink can be used to help in dissipating this heat more effectively. You can use some double sided tape to attach the heat sink.
Step 10: Check Motor Wiring
Now you can check that the motors are wired the correct way around. When the battery is plugged into the driver all four motors should spin after a moment. If one or more do not spin they are probably connected incorrectly to the output screw terminals, or are under powered. Check first that they are wired correctly and double check the output voltage on the screw terminal. If the battery is very low on battery it might not be able to supply the power required to spin the motors. If one or more spin in the wrong direction then they are simply connected with the wrong polarity. This can be fix by swapping the wires for the motor in question at the screw terminal. Note that if your still using the code from before the robot should drive forward, which should be a guide as to which direction the motors should be turning.
Step 11: Wire the Sensors
Wiring the sensors can be done using some jumper wires. Note that you cannot use the servo extension cables for this as the pin layout on most of the sensors is incorrect for these cables. When connecting the sensors, use the group of headers soldered onto the driver, and connect the ground of the sensor to the ground header pin on the driver. Do likewise with the V+ pin. The sensor pin should be connected also, and should match whatever pin you choose to define for the sensor in code. So for example, if you choose to connect a line sensor to pin A0, which is also called digital pin 14, so in code it would be represented as “digitalLine sensor1 (14);”
Step 12: Finished
Now the hardware of the sumobot is complete. It is up to you to experiment with the code and see what you can get it to do.