Overview - this is the video of the end result
Get the Arduino board assembled.
This was the chip used in this project. It is ESP8266 Wifi Module. It is placed on top of a motor shield to make it easier to attach wires.
Place it on the mini car and link the wires properly.
The hardware assembly part is not covered here. You can contact me if you need help on this. If wires are mis-connected, when the mini car moved, one wheel could be moving forward, the other wheel could be moving backward. Two wheels going in the opposite direction. Therefore, it has to be connected in the correct way.
Understand the technical logic.
I borrowed this photo from http://www.rudiswiki.de/wiki9/WiFiCar-NodeMCU because I thought this was the best illustration diagram. The logic is to use the acceleration sensor embedded in the phone and convert the acceleration date into motor drive value. The motor then moves according to the motor drive value. At the same time, the acceleration data were captured and displayed on the website.
The enhancement I had done is to display the acceleration data in a real-time chart using Bluemix, instead of numerical data. Later I will explain how this was achieved.
Upload the Code.
Here is the code used in this project. The source is here. After you upload the code, using the method taught in my previous blog, The Ultimate Solution for ESP8266 WiFi Arduino with Bluemix – Part 2/2 to connect the Wifi Module to your network.
Upon successful connection, you will receive the following message on the Serial Monitor.
Where to see the acceleration data? You just need to get the IP address and view it in the browser.
Set up the Bluemix.
IBM employee from Switzerland had contributed a great article on how to Turn your Mobile Phone into an IoT device. Basically, what you need are
- A Bluemix Account,
- Cloud Foundry Command Line Interface,
Below is the architect. (The diagram is taken from the same article.)
Because this step was covered in his article, I won’t repeat it on my blog. It requires a certain level of technical knowledge.
You just need to be patient and follow the step. The result was GREAT! You will be able to view the photo acceleration motion in different types of chart. (The diagram is taken from the same article.)
Design the Car Cover.
Up to this step, I was able to control the mini car’s movement by tipping my phone up/down/left/right. And my phone’s movements was displayed in a chart.
Well, I thought the car looks a bit ugly. So I started decorating it. There was some plastic paper. I cut them off and made a cover.
After I made it cover, the car look like a bus. Then I decided to make it a bus. So I found some stickers and made it Bus Annie.
The tagline of Bus Annie is Share Innovation. The stickers are from redHat.