Science Oxford Logo

Session 4: assembly and testing


You now have everything you need to build your robot

photograph of all components as listed below

Component list
  1. Selection of wires
  2. Soldered power board (from Session 2)
  3. Two wheels (to fit the motors)
  4. Two motors with red and black wires attached
  5. Battery pack (to fit a 9V battery)
  6. Connector for the micro:bit (and your micro:bit, to use with code from Session 1)
  7. Two holders for distance sensors (after testing that your robot can move, you will add in the sensors)
  8. Laser cut robot base (from Session 3)
  9. Castor wheel
  10. Motor driver board (to translate between the micro:bit and the motors)

Assembly

Follow the instructions here to assemble your robot.


Testing your motors

If you have wired up the motors according to the instructions, the test code should:

  1. Turn both motors in the forward direction
  2. Turn both motors in the backward direction
  3. Turn one motor forwards and the other backwards, so that the robot spins left
  4. Turn one motor forwards and the other backwards, so that the robot spins right

Download the test code, open it using the online Python editor, and put the code onto your micro:bit.


Press A on your micro:bit to run the code.

Does your robot move as described in the list above?

If yes, your robot does not need troubleshooting, and you can move on to the next section!

If it is not moving as described, look for your problem here.


My robot isn't moving at all!
  1. Check that the robot is on.
  2. Send the code to the micro:bit again, and make sure no errors show up.

If this doesn't help, ask a workshop leader to help you.


Only one of my motors is turning!
  1. Check for loose wires - has anything come off?
  2. Check the wires on the micro:bit connector - are they definitely in pins 12-15?
  3. Make sure that the micro:bit is pushed very firmly into its connector.

If this doesn't help, ask a workshop leader to help you.


One or both of my motors will not stop turning!
  1. Check the wires on the micro:bit connector - are they definitely in pins 12-15?
  2. Make sure that the micro:bit is pushed very firmly into its connector.
  3. Send the code to the micro:bit again, and make sure no errors show up.

If this doesn't help, ask a workshop leader to help you.


One of my motors is turning the wrong direction!
(it spins when it should go forward, and goes forward when it should spin)
  1. Check the wires between the motor driver and the micro:bit connector. Check the instructions, and make sure that they all go to the right place.

If this doesn't help, ask a workshop leader to help you.


Both of my motors are turning the wrong direction!
(it goes backwards when it should go forward, and turns left when it should turn right)

This can be changed either by moving the wires, or by changing the code.

Ask a workshop leader for help with this.


Test driving

Now that you know your robot works, test out its capabilities by driving it in different directions at different speeds.


Work on your robot's motor code so that you can use the best values in the sensor code next time.

Save your code so that you can carry on next time.


Your robot code

Congratulations, your robot works!

In Session 5, we will add the sensors and test your robot code, so that it can use the distance sensors to decide how to move.

You can choose to either...