2021 Christmas is in two months, I would like to do a special gift to my 3yo son. He loves Lego and trucks , I like hardware and programming. Why not try to embed a board with servos and motors inside a Lego truck. I know Lego already provides a set with motors but it’s expensive and very limited.

I started to search a good board and found a very promising one, the Cytron Maker PI. It a brand new board having the new RP2040 from Raspberry. Here is the main features of this board:

  • 4 Servos driver
  • 2 Motors driver
  • 13 LEDs and 2 RGB LEDs
  • 7 Grove ports
  • Multiple ways to power the board LiPo/LiIon/USB/VIN with Power on/off switch
  • Some switches
  • A buzzer (this is cool !)
  • 4 holes specially sized for Lego
  • It’s pretty cheap, ~$10

In the past my son shown interest in my PS4 controller. Well why not use the PS4 controller to control the Lego truck ? The Maker Pi board can act as a host for a USB dongle but for now I don’t want to use this functionality. It’s not straightforward to decode the PS4 controller stream, and I need time to experiment (and I don’t have lot of time…).

Instead I will use some kind of gateway between the board and the PS4 controller. I just need DS4Windows on my PC to get the PS4 inputs, then encapsulate the commands and send it to a Bluetooth chip connected to the Maker Pi. Here is a perfect Grove sensor that gives a Bluetooth support.

On the mechanical side, some servos/motors compatible with Lego are available for cheap. Here is what I will most likely buy.

For this project I will have to write two pieces of Software: one for the board (supporting MicroPython, CircuitPython, or C/C++), one for the gateway in C++ with MFC, it should be straightforward and fun !

2 Replies to “The Project”

  1. Bonjour, votre projet est original, créer un jouet n’est pas simple et vous devez être sacrement bon en algorithmie. Et avec la nouvelle carte avec le nouveau RP2040 de Raspberry, vous pouvez toujours ajouter de nouvelles fonctionnalités.
    Je pense que le projet est abouti on est en février 2022, se serait bien un lien vers une vidéos YouTube sur votre projet.

    1. Le projet est terminé mais j’ai changé de hardware en cours de route. Le lien bluetooth était limité en portée et avait une latence de 50-60ms. Je me suis tourné vers un lien NRF24L01 et 2 Pi Pico car l’autre board n’était pas adapté pour l’interface SPI du NRF. J’ai maintenant un bonne latence de 3-5ms avec PC->PiPico1->NRF ——- NRF->PiPico2->Servos/Motors. Malheureusement je n’ai pas beaucoup de temps pour décrire tout ca sur le blog 🙂

Leave a Reply to JULIEN Cancel reply

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