Overview

Skill Level: Advanced

Requires both hardware, software, programming understanding

This recipe shows how to build a phone controlled toy car using Arduino/ESP8266 as an IBM Watson IoT Platform managed device and display the movement in Bluemix charts.

Ingredients

ESP8266

Wifi Car

Smart Phone

Paper & Stickers

Step-by-step

  1. Overview - this is the video of the end result

    Unnamed-QQ-Screenshot20160909112708

  2. 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.

     IMG_20160410_173000-1024×769

  3. 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.

    IMG_20160410_172953-1-1024×769

  4. 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.

    wifi-car_software-1024×643

    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.

  5. 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.

    car-code

    Where to see the acceleration data? You just need to get the IP address and view it in the browser.

  6. 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

    1. A Bluemix Account,
    2. Cloud Foundry Command Line Interface,
    3. Phone.

    Below is the architect. (The diagram is taken from the same article.)

    image001

    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.)

    image015

    image029-1024×512

  7. 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.

    IMG_3226-1024×771

    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.

    IMG_20160410_172934-1024×769

    The tagline of Bus Annie is Share Innovation. The stickers are from redHat.

    IMG_20160410_184120

Join The Discussion