Getting Started with the Red Hat Co.Lab Robot

Pages
Contributors: D___Run___, Gina Likins
Favorited Favorite 1

Build: Complete the Wiring

In this section, you will add brains of the robot: the micro:bit and SparkFun moto:bit and wire everything up for power.

Find the micro:bit, the moto:bit, and the two moto:bit Mounting brackets.

alt text

Attach one of the moto:bit Mounts by snapping it into one of the vertical slots in the back of the top chassis near the large rectangular opening.

alt text

Attach the other moto:bit Mount by snapping it into the other slot:

alt text

Time to insert your micro:bit into the moto:bit.

NOTE: the “top” of the moto:bit is the side with the pins and chips and the power input on it, but the “top” of the micro:bit is the side that has the LEDs on it (the side *without* the pins and chips and power input). It is possible to put the micro:bit in upside down, (ask me how I know ;-) so be sure to have it oriented as shown in the image below.

alt text

The moto:bit snaps into the second-lowest of the notches on the moto:bit Mounts. Make sure the power jack is facing the left side of the robot. Push gently and evenly until it snaps into place.

NOTE: The extra slots in the moto:bit mounts can be used to hold other robotics controller boards such as the SparkFun RedBoard or the Raspberry Pi.

Here’s what everything looks like before connecting the wires:

alt text

To hook up the motors, put your robot in front of you with the Sensor Array pointing away from you (as if it were going to drive away from you). While you’re making your connections it’s especially helpful to be able to keep the robot oriented correctly, so if you haven’t done so already, you may want to mark the left front corner of the robot in some way.

First, connect the Left Sensor cable bundle (which is the one coming out of the left oval that you didn't mark) to the moto:bit sensor pins labeled P0, 3V3, GND. Since RED was GND when we connected the cable bundle at the sensor end, RED needs to stay GND when we connect the cable bundle at the moto:bit end.

Once the cable bundle is plugged in the YELLOW wire should be closest to the front of the robot, and the RED wire should be closest to the rear of the robot, like this:

alt text

Then connect the Middle Line Sensor (the cable bundle that does have tape on it coming out of the left hole) with the pins P1, 3V3 and GND, again making sure that the RED wire stays connected to GND:

alt text

Connect the Right Line Sensor cable bundle (which comes out of the right hole) with the pins P2, 3V3, and GND

alt text

Next we’re connecting the motors, which is a little weird, but stick with me.

To make a long story short, there’s no way to determine which direction the shaft for each of your two motors will spin before getting it hooked up and running. So, what we’re going to do is hook them up the way the moto:bit board indicates for now. Once we have everything else assembled (and we’re close -- only the power is left to do after this), we’ll load some sample code and see if the motors do what we expect them to do.

If they do -- yah! If they don’t, that’s ok too -- we'll go through how to figure out which of the motor(s) is backwards and how to fix it.

Hook up the left red and black motor wires (which come out of the left hole on the Top Chassis) to the left motor connection on the moto:bit board, plugging the red wire into the hole labeled “red” and the black wire into “black”):

alt text

Connect the right red and black motor wires (coming out of the right hole) to the right motor connection on the moto:bit board in the same way:

alt text

When you’re finished, you’ll have something that looks like this:

alt text

POWER!

Now we need to give your robot some juice. The power -- supplied by 4 (four) AA batteries -- goes into the moto:bit, which then powers the micro:bot. You’ll need the Battery Pack Clip , the 4 AA Battery Holder, and the provided AA batteries:

alt text

First insert the batteries into the Battery Holder, making sure that you face them in the correct direction, as shown in the diagram on the inside of the holder(the flat end of the battery, which is the negative end, goes against the spring end of the battery case):

alt text

With your robot in front of you and pointing away from you, orient the Battery Holder (with batteries) as shown, then insert it into the back cavity of the chassis:

alt text

left side of the robot and the Battery holder sits on top of the hole. Insert the Battery Pack Clip on top of the battery pack (with the open end facing down towards the batteries), twist and position the clip so that it rests on top of the battery pack.

alt text

It worked best for me if I reached in through the hole nearest the sensor to hold the battery pack in place with one hand while I used the other to wiggle the Battery Pack clip into place.

Push the clip down into the vertical slots in the Bottom Chassis so it snaps in place.

alt text

Route the barrel jack cable out of the left side of the chassis and up to the moto:bit and plug the barrel jack cable into the barrel connector on the side of the moto:bit carrier board.

alt text

Pro Tip: there’s a switch on the moto:bit that you can turn off when you’re not using your robot to save power. Super Pro Tip: even when you turn the power switch off there’s still a small amount of power going to the moto:bit, so to conserve as much battery life as possible, unplug the barrel jack if you’re not going to be using your robot for a while.