Introduction: WiFi Wall-E
Have you ever had a childhood dream?
One which you consider so ridiculous and unreal, only a child can come up with it?
Well I have - I've always wanted to have a robot friend.
It didn't have to be very smart or have high-tech laser equipped to it, I'd just settle for one that doesn't kill me in my sleep.
Then, on 2008, "Wall-E" movie was released to theaters, and my childhood dream suddenly got a face to it.
Something about this cute little garbage collector made me promise myself I will get me one of those someday.
Anyway, years have passed and I'm about to graduate my studies at the University.
A final project comes a long and I thought to myself -
Hey! this might be the time to build that Wall-E you've been talking about!
so I present to you:
Your little intelligent robot friend.
Wall-E is a cardboard WiFi robot using Wemos D1-mini (esp8266).
- Manually controlled in 4 Directions.
Receives control signals via MQTT broker and Node-Red.
- AI controlled using obstacle avoidance
Transmits path direction choices via MQTT to voice.
Transmits obstacle detection in relative to its body via MQTT to voice.
Who am I?
Proudly created by Guy Balmas, a Computer Science student at IDC Herzliya, Israel.
Huge thanks to Zvika Markfeld, for being an awesome IoT Guru, and for supplying the equipment and assistance I needed.
this is the list of things that I used for the project.
However, every component is replaceable and was chosen due to availability.
For the body unit:
- 1 x Wemos D1-mini: the heart and brain of Wall-E (includes an esp8266 wifi module).
- 3 x AAA batteries: will be the power supply for the body and head units.
- 1 x Mini Bread-Board: used to connect all GND, and relevant VCCs.
For the driving unit:
- 1 x L298N H-Bridge: used to control and coordinate 2 DC motors.
- 2 x TT-Motor: two DC motors to drive Wall-E.
- 1 x 9V battery: a 9V battery with wire connectors will be the power supply for the driving unit.
For the head unit:
- 1 x Ultrasonic sensor: used for obstacle detection.
- 1 x SG90 Micro Servo motor: a simple 180 degrees micro servo motor.
- Hot-glue gun
- 4 x Wheels
- 20 x jumper wires
- Cutting knife or scissors
Step 1: Build the Motors Unit
First step will be building a platform on which we will build Wall-E later on.
1. Cut a 12 cm by 12 cm cardboard square and attach the two TT-motors to the very ends of the square using hot glue.
2. Turn the platform over, and attach the L298N h-bridge to the platform.
3. Make 2 holes in the platform, 1 on each side of the L298N h-bridge, for the motors' wires to come through.
4. Attach each motor's wires to the L298N h-bridge as described in the circuit.
5. Attach the 9V battery connector to the L298N as described in the circuit.
- VCC to 12V
- GND to GND
Step 2: Body Connections
Now its time to connect the L298N to the Wemos D1-Mini.
1. Follow this connections list:
- ENA to D1
- ENB to D0
- IN1 to D8
- IN2 to D7
- IN3 to D4
- IN4 to D3
2. Connect the power supply to the body unit:
- VCC from AAA batteries and 5V on the D1-mini, to the same row on the mini bread-board.
- GND from AAA batteries, GND from 9V battery and GND on the D1-mini, to the same row on the mini bread-board.
Step 3: Installations
First we will need to setup the Arduino IDE in order to be able to program into the D1-mini.
Install Arduino IDE from: https://www.arduino.cc/en/Guide/HomePage
Install relevant "drivers" for the ESP8266 boards to your Arduino IDE:
Second, we will need Node-Red which is a smart integration platform, allows to develop some basic UI as well.
Get Node-Red from:https://nodered.org/
Check out http://nodered.org/docs/getting-started/ for full instructions on getting started
After Node-Red installation, go to your browser and type in '127.0.0.1/1880' to see if you can run it.
If everything went fine, you shuld reach a web page similar to the one in the picture above.
Step 4: WallE Says Hello!
It's time to upload some code
Download the attached WallE.rar file and unzip it.
Now, connect The D1-mini to your computer via USB cable.
Upload the attached files:
- WifiWallESketch.ino to the Arduino IDE:
First set your current wifi settings inside the code:
1. Double click the sketch to open it in the Arduino IDE.
2. Scroll down and find the 'WIFI SETTINGS' section.
3. Update your WiFi details as described in the comments (name and password of your local network).
4. In the same section, insert your name on control_channel and on AI_channel.
5. Install the ESP8266 board:
Add the following 3rd party board manager under File > Preferences > Additional Boards Manager URLs:
Then open Tools > Board > Board Manager and click install for the ESP8266
6. Import the relevant libraries as appears in code, and compile the sketch:
WiFiClient.h, ESP8266WebServer.h, ESP8266WiFi.h, PubSubClient.h, Servo.h.
Then upload it into the D1-mini:
1. Select the 'LOLIN WEMOS D1 Mini' board in the board manager.
2. Select the right port according to your device.
3. Upload the sketch.
- WallE_Node-Red.json to the Node-Red:
1. Upload the flow.
2. Configure the MQTT Nodes as follows:
- Server > Set MQTT server as 'broker.mqtt-dashboard.com', and port as 1883.
- Make sure the topics are set as in the pictures above.
<YourName>/WallE/Control - communication channel for control signals.
<YourName>/WallE/AI - communication channel for self exploration using obstacle avoidance and AI.
Use the same string as you used above (section 4 if it wasn't too obvious).
After you successfully uploaded both and configured everything right,
upload the sketch again from the Arduino IDE or press the reset button on your d1-mini.
You should hear 'WallE says hello!' as it comes to life!
Step 5: Body Unit
After we built a live responsive platform, it's time for some body work!
Basically we need to do 2 things: attach the wheels and make a body box.
1. Attach the front wheels to the motors.
2. Attach the back wheels to the platform.
Since we didn't 3D-printed anything, it's time to use your imagination and mechanical sense to attach the wheels.
For example, I tore down 4 wheels off an old toy truck, and they didn't fit on my motors.
So I took some polymer clay and made custom connectors!
For the rear wheels I used an office pin to make an axle and hot glue to attach it.
1. Cut 5 cardboard squares, size of 12 cm x 12 cm.
2. Take 1 square, and cut a hole in its middle in the size of a servo motor.
That square piece will be the top body piece, on which we will place the head on.
3. Use 4 squares (including the top piece) and build the body.
Leave 1 piece out for door access to the void inside Wall-E.
Step 6: Head Unit
Time to give Wall-E a face!
For the head unit we use 2 components: an Ultrasonic sensor sitting on top of a Servo motor.
There are countless ways to do that, and practically you can make any face you want for your robot.
But I chose to go with the original all made out of cardboard and toilet paper rolls.
I took small cardboard piece, and cut it in a 'B' shape.
Then I cut 2 holes inside the 'B' to push the sensor through it.
After that, I used some more cardboard to build the neck and head shape.
Use you imagination! give it a box face, a barbie doll face, just make sure you don't cover the ultrasonic sensor.
Its Wall-E's eyes.
When your'e done, put the servo in the pre-cut hole we made for it, on top of the body
Now attach the head unit onto the body servo, and move on to connecting the head wires.
Step 7: Head Connections
We're almost there!
Now it's time to attach the head connections to the ESP8266.
Follow this connections list:
- Ultrasonic VCC and Servo VCC to VCC row on breadboard matrix.
- Ultrasonic GND and Servo GND to GND row on breadboard matrix.
- Ultrasonic TRIG to D6 on the ESP8266.
- Ultrasonic ECHO to D5 on the ESP8266.
- Servo DATA to D2 on the ESP8266.
Step 8: Ready to Go!
Wall-E is all wired up and almost ready to go!
We just need to run a quick test run to see if we wired up everything correctly.
- Plug in the batteries - 9V to the motors units, and the 3 x AAA to the body unit.
- Put Wall-E on something so his wheels can go freely without him moving (so we can do a test run).
- Make sure your Node-Red is running, open a new tab and go to 'http://127.0.0.1:1880/ui'.
This will be the controls panel we will use for Wall-E.
- Upload the sketch again or press the reset button on the ESP8266 board and wait for Wall to say Hello.
You can see the communication messages of Wall-E in the Debug panel on Node-Red.
- Play with the controls a bit to see it it responds correctly.
If it's' not then it's probably some wires problem.
Wall-E has two functionalities:
- Manually controlled - use the Forward / Backwards / Right / Left / Stop buttons to control Wall-E's movement.
You can also control his head movements using Head Right / Head Left buttons.
- Explore - under this option, Wall-E will start to explore his surrounding all by himself!
This option operates the obstacle avoidance functionality, and allows Wall-E to decide it's path using some basic AI in decision making.
I'f you choose this option, Wall-E will respond in "Wall-E is exploring!" call, and start wondering around.
Hope you liked it!