The micro:bit RC car

I was very fortunate in my time at the micro:bit Foundation to be given tons of free kit, often before it hit the market!  I always tried to use it in some interesting or creative way.

One of my favourites was the 4tronix bit:bot:

I built a track in my study and myself and my boys had loads of fun programming paths into the onboard micro:bit to navigate around it.  With each iteration we would add a couple more steps to the path, test, tweak etc.  It was like Logo, except the on-screen turtle was a physical device.

Create a track easily by finding long strips of cardboard.  I used the covers from loads of old note books.  Cut long, low strips and they should be easy to secure to the floor with Bluetack, or make small runners out of Polymorph.

The idea of the bit:bot being driven along a path, remembering it, then repeating the path was inspired by this experience.  I designed an app that would remember the commands it was given, rationalise them (so for example it would combine multiple consecutive changes of direction into a single change) and save them.

  • There were 2 micro:bits – one on board the car and the other used as a remote controller.  The 2 micro:bits communicated over radio.
  • A human would drive the car around using the RC, as you would an RC car.
  • As the car moves and changes direction the path data is saved on the RC micro:bit.
  • When the RC micro:bit is shaken it begins to play-back stored instructions, which are communicated over radio to the micro:bit on the car.

Now I could drive the car around a track, record the path, put the car back at the beginning, set if off retracing the path, et voila!

Check out the finished product in the link below:

Have a go – its quite fun!

All the code is on GitHub, and it should be fairly straightforward to adapt it for other vehicles.  I also uploaded the project to Hackster.

What next?

  1. I always wanted to get the car to run the instructions in reverse order, so you could drive it somewhere then tell it to return to its starting place.  In theory it should be easy enough, just read the instructions array in from end to beginning and ‘invert’ each action (so Forward 100 becomes Back 100).  The next challenge caught my fancy before I got around to it though:
  2. I started to build an autonomous vehicle powered by solar.  The vehicle would seek out the optimal level of sunlight in an area then bask until it had a charge above a certain threshold.  Once sated it would seek out companionship from other similar entities (which would be emitting ‘calls’ over radio).  I built the car and quite a bit of the code:

I got quite far with it, but got discouraged because I could not get the sonar distance sensor to work with 3.3V, and stopped working on it when I started the micro:bit house project.

Leave a Reply

Your email address will not be published.