Before we get started, we need to make sure that the electronics are working correctly. It´s a good idea to do this first, because finding out that something doesn´t work after building your robot is pretty frustrating. If you have problems with any of these tests, please contact our technical support team (email@example.com) so that they can resolve the issue and change any faulty electronic components.
Don´t worry if you´re missing any of the components needed for the tests, just do the ones that you have the components for. For example, the Renacuajo kit does not come with mini servo or light sensors.
Don´t worry if some of your components are different to the new hexagonal Zum bloqs, as they are totally compatible:
Testing the controller board
The controller is the brain for your robotics projects and PrintBots. Now we will run a program on the board, which will be executed continuously when connected to a power source.
We now offer two types of boards: the FreaduinoUNO model (included with the kits) and the ZUM BT-328 model. They are totally compatible with each other and with the entire range of Arduino UNO and BT boards.
As you will have seen, they have a string of pins with colours prepared for connecting the components. They have a total of 14 digital pins and 6 analogue pins (named A0, A1, A2…)
How is the USB power supply?
Let´s get started. First we will make sure the controller board is working correctly. To do this, connect it to the computer via USB. Does it turn on? If so, a few lights (LEDs) should switch on, which tells us that the current has indeed reached the board.
What about the batteries?
Now get the battery pack and insert the batteries. Connect the board (the USB should be disconnected at this point) and see if the LEDs turn on. All good? If so, this means that the power supply is correct for both the battery pack and the board! If the LEDs don´t light up, there is likely to be a problem with the battery pack. Check that the cables are secured by pulling them gently.
First test program: Making an LED flash on and off
So now we know that the power supply to the board is correct, we will run the first test program. This program will make one LED blink. An LED is a component that lights up and goes off, a bit like a tiny light bulb. We will be using a special LED, which is the one that comes built in to the board and is named D13 (because it´s internally connected to digital pin 13).
Programming with bitbloq
Programming with bitbloq is really simple. You´ll be creating complex programs before you know it. All you need is Google Chrome.
Follow these steps to get started with bitbloq:
- Connect the controller board to the computer via the USB cable.
- Open bitbloq
- Click on Compile and you will see how to compile the code (it might be empty).
- Now click on Run and you will see how to automatically install the desired extension. Once it has been installed, click on Run again.
If everything is to plan, bitbloq will automatically detect the type of board and the port you have connected it to. You can see the result by clicking on History:
If you´re using bitbloq for the first time, you might need to install the drivers so that your computer can recognise the board. A message like this one will appear:
Download and install the drivers for the operating system you are using and try running the program on your board again. If you have any queries, write to us at firstname.lastname@example.org
Now that you have configured bitbloq, why don´t you try creating a program like the one shown in this image:
Don´t know how to create it? No worries robonaut! You can download the program ready to go here.
You can open any project in “.xml” format in bitbloq via More options->Load project
Finally click on “->Load” again to run the program you have created on your board.
Programming with Arduino IDE
If you´ve already used bitbloq and everything is fine, you don´t need to test any other options. However, if you prefer a different method, we will explain here how you can do the same thing with the Arduino IDE. This interface or IDE comes with an example program for making LED D13 flash on and off included as standard. To open the program, click on Archive->Examples->01.Basics->Blink.
As with bitbloq, if you have successfully made the LED D13 blink, this means that your board is working correctly and you have learnt how it´s done.
Testing the continuous rotation servos
Now we will check that the continuous rotation servos are working correctly. Connect one of these servos to digital pin 10 as shown in this diagram:
Load the following program in bitbloq (download the continuous servo test) or create it as shown in the image:
The servo should turn in one direction one second, pause for 3 seconds, turn the other direction in another second and then stop again for three more seconds and so on, again and again.
If the servo does not stop completely and instead it keeps turning slowly when we order it to stop, it´s because it requires calibration. Watch this video to see how to calibrate continuous rotation servos:
Don´t worry if the program says that the servo should turn clockwise and yours seems to be turning anti-clockwise. The reference for the direction of rotation is not actually taken from the front of the servo but rather from the rear.
You will need to test both servos.
Testing the infrared sensors
The infrared (IR) sensor is a digital component that is used to tell the difference between black and white colour. It´s usually used to in familiar robots such as line followers, which follow a black line drawn on the ground. We can say that it is digital because on receiving the value from this sensor, we will able to receive a 0 or a 1 , depending on what is detected.
The first thing you need to do is to calibrate the sensor so that it can easily distinguish black from white. Simply follow the instructions in this video:
Don´t forget to calibrate both sensors! If it doesn´t work as you were expecting, make sure that the cables are connected correctly to the controller board and the sensor.
>> You can finish the checks if you have the PrintBot Renacuajo kit.
Testing the light sensor
The light sensor gives us reading which represents the amount of light that it detects. This sensor is an analogue component (in contrast to digital components, analogue components can return values between 0 and 1023).
Connect the light sensor to analogue pin A1 as shown below:
Now we will create a program to switch LED D13 on and off at a speed that depends on the quantity of light. Load the following program in bitbloq (download the light sensor test) or use these blocks:
This program makes the LED blink quickly if the sensor returns a low value (low light), as the pause is short. Don´t worry about understanding programming in depth now. All you need to do is check that the result turns out as shown in the video:
Once again, if it´s not working as you had expected, check that everything is connected correctly.
Testing the mini servo
The mini servo is a small motor that can turn its axis 0 to 180 degrees, or half a turn. To check that it is working as it should, connect the cable to digital pin 10 as shown in the diagram below:
This time, the program consists of running through each position that the mini servo can take, one by one. A movement that goes from 0 to 180, waits a second and then goes back from 180 to 0. Load the following program in bitbloq (download the mini servo test) or use these blocks:
Check that your mini servo describes an arc like this: