Primo: It’s done!

Yay,  finally I finished my Primo project! After some blood, sweatring and tears it’s done.


It was pretty obvious that for some reason I couldn’t get the wireless connection to work using the XBees. Luckily I had other options around.

I used some 315Mhz RF transmitter and receiver as I thought they were pretty straight forward to use. But when I hid the receiver/transceiver behind some plywood I could see that not all messages were received.

Next try was using HC-05/06 bluetooth modules. But I never managed to get the two Arduinos to connect.

So I digged even deeper into my parts box and found some nRF24L01 modules I acquired some time ago on ebay for 2$/piece. Setup was surprisingly easy and I got the connection going in almost no time.

But having the Cubetto on battery power I still had the problem that the motors didn’t turn fast enough. Even though my batteries (4x AA) said they  were 2000mAh somehow they didn’t provide as much juice.

I found a rc helicopter in the basement that crashed only after one afternoon of usage by my son. I put it away thinking of some spare parts I might use. And from this helicopter I took out the batterypack. They are NiMH 7.2V 500mAh but are working very well in the cubetto.

I also made some changes to the code. I thought I could improve the code when the Cubetto is moving. Now it’s like:

while (counterL <= steps && counterR <= steps)

This means the Cubetto counts the spikes of the wheels and keeps the wheels turning until it reaches the number of steps.
But as the control board will send its directions after 1500ms (straight) and 1000ms (turns) respectively the Cubetto might miss this commands if it’s low on batteries.

So I added the functionality that the Cubetto will suspend the wheel counting activity after 1350ms or 850ms respectively so even if it ran very slow it would not miss a command being sent.

long t = millis();
while ((counterL <= steps && counterR <= steps)
|| (millis()-t)<MAX_DURATION_STRAIGHT) {

The reception by my kids was great: They loved it. Even though the four year old does not really get the full understanding of it. But she loves her robot!

I’d definitely love to receive Primo’s lesson plan:

My version of the Arduino code is on GitHub.

6 thoughts on “Primo: It’s done!

  1. Would you please share all information about your version of cubetto i would love to replicate it.
    But i am not engineer so i need the full details for that :).
    Thank you

  2. Hi!
    I´m already making the prototype and it´s almost done. We follow your tips and exchange the xbees for the NRF2401L modules. We are experiencing two issues: the arduino mega sketch uploaded smoothly but the cubetto´s are showing an error. The other question is about how you address the modules as transmitter/receiver? Cheers!

    • Hi Eduardo
      Important is that both have the same pipe id like here
      RF24 radio(4,10);
      const uint64_t pipe = 0xE8E8F0F0E1LL;

      And then the Mega uses write
      Serial.begin(9600);
      radio.begin();
      radio.openWritingPipe(pipe);

      while the cubetto reads
      radio.begin();
      radio.openReadingPipe(1,pipe);
      radio.startListening();

Leave a Reply

Your email address will not be published. Required fields are marked *