-
1Overview of installation to running
Pololu Grid Sweep with MQTT
Hardware
-
Pololu 3pi+ 2040 OLED robot (USB-C for programming)
-
ESP32-WROOM-32U (Micro-USB for flashing)
-
Wi-Fi router or LAN access point
-
Type-C and Micro-USB cables
-
Tape grid on the floor (intersections marked)
Power: ESP32 is powered from the Pololu’s 3.3 V rail. Common ground required.
Wiring (per robot):
-
ESP32 TX → Pololu RX (GP29)
-
ESP32 RX ← Pololu TX (GP28)
-
GND ↔ GND
-
VCC (3.3 V) from Pololu → ESP32 3.3 V
Software Requirements
-
Mosquitto MQTT broker installed on your LAN (e.g. on control PC or router)
-
Python 3 with
paho-mqttlibrary on control computer -
Arduino IDE with ESP32 core and
ESP32MQTTClientlibrary -
Pololu MicroPython runtime on the robot
ESP32 Setup
-
Open
esp32_general.inoin Arduino IDE. -
Enter your Wi-Fi SSID and password (use your own network, not defaults).
-
Set MQTT broker IP.
-
Upload to the ESP32 via Micro-USB.
Pololu Setup
-
Copy
pololu_code.pyto the 3pi+ 2040 using Type-C. -
Confirm UART pins in the script: TX=GP28, RX=GP29.
-
This script listens for step/turn/stop commands and reports back
x/ycoordinates or events likelineandbingo.
Hub Setup
-
Install Python 3 and add
paho-mqtt(pip install paho-mqtt). -
Install and run Mosquitto on the same LAN.
-
Edit
MQTT_hub.py:-
Set broker IP.
-
List all robot IDs you will use (e.g.
"00","01"). -
Adjust the hardcoded search pattern to fit your grid layout.
-
-
Run the hub. It subscribes to status topics, publishes move commands, and can broadcast global stop messages.
Running the System
-
Power on the Pololu and ESP32.
-
Make sure Mosquitto is running on your LAN.
-
Run the hub script.
-
Robots begin sweeping intersections according to the hub’s pattern and report events in real time.
-
James Lott
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.