NodeMCU ESP8266 Mini-bot controlled from Scratch

Note:Driving motors directly like this is likely to lead to the NodeMCU pins getting destroyed due to back EMF – this is only for the foolhardy amongst us 🙂

Having managed to program a Scratch broadcast listener using Lua on the NodeMCU, and used it to control a 4Tronix Agobo2 bot designed for the Pi, I decided to try and build a minimal mini-bot.

So I used a 3xAA battery box as the chassis and mounted 2 micro-gear motors – a 3rd wheel slider made out of polymorph and LEGO(ping pong ball would have done just as well) and an older style NoeMCU which necessitated cutting a mini-breadboard in half!

2015-10-11 15.32.49 2015-10-11 15.48.44
2015-10-11 15.35.13 2015-10-11 16.15.07

To setup your own NodeMCU ScratchBot

Software is available at esp8266 in the Other and Scratch Projects folder

Load the script  into Scratch on your computer (or Pyonkee on an Ipad)

Find out the IP address of your computer.

Load the Agobo2.lua script into your NodeMCU and alter the IPaddress in it to be the one of your computer or IPad.

Run it with altered IPAddress and it should say connected.

You can now control the pins with commands like

Wire up a motor to D3 and D4 (or any 2 pins apart from D0) and issue

on space key

broadcast motorxyzzz  (replacing x with 3, y with 4 and zzz with a value from -100 to 100)


Videos of it in action 🙂



You may also like...

Leave a Reply

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