Open-Source Software On Wheels V1

 
 

Continuous Delivery and Cloud Software Engineering encapsulated in an exciting and interesting project.

RC-car_v1.gif

Learning about Cloud Software Engineering through hands-on experience with the Internet Of Things, Continuous Delivery, Docker and Azure Web Apps.

An exciting traineeship that arose in the shape of Remote-Control Car. Supported by Ewan Klomp, this car was developed by his brother Joeri Klomp, who will now join our Common Sense Program as a full-time Cloud Software Engineer. Congratulations!

Scroll down to the bottom of the article to take a look at the open-source code.

Overview

The concept is simple. We transformed a radio controlled car into a web controlled car using the following three technologies.

  • Azure Web Apps hosting of web controller.

  • A containerized RESTful API using Python and Docker.

  • A Raspberry Pi that hosts the Docker container.

Web Controller Interface hosted on Azure Web Apps.

Web Controller Interface hosted on Azure Web Apps.

Web Controller

The web application is the control panel of the car and is hosted on Azure Web Apps. Here the direction and speed of the car can be adjusted. The user controls the car through a simple graphical HTML form that triggers a PHP-script. This script formats and sends the user input to the API that is hosted in a Docker container on the car.

The Azure Active Directory handles authentication and authorization for all Search4Solutions employees. On top of that, the IP-Adres and API-key of the car are hidden, as the PHP-script is rendered on the server side.

Containerized API

The containerized API was developed using the Python Flask package and consists of two endpoints. One endpoint for direction and one for speed. Since the API is hosted on the car itself, the car can easily be instructed to perform operations by sending power to the GPIO pins on the Raspberry Pi. For this the RPi.GPIO python library was used.

Do not forget to open port 5000 on the Raspberry Pi network to enable contact with the web controller that sends user input.

Raspberry Pi wiring schema

Raspberry Pi wiring schema

Raspberry Pi Setup

Now the software side is setup, it is time to build the hardware. Let’s get the software on wheels rolling.

The wheels are controlled by two DC-motors. One takes care of steering while the other controls the speed. Since the Raspberry Pi lacks power, a Dual-H bridge controller is used, which connects the internal battery compartment of the car to the motors. This also allows for a variable voltage, which in turn is used to alter the speed of the car.

Final Words

The eventual goal of this project is to build a fully autonomous car through sensors and machine learning. The next steps are:

  • Connecting a 4G-shield to drive wherever we want.

  • Connecting a camera and adding object detection.

Open source repositories

Follow new updates and gain access to the open-source repositories.

  • Click here to view the “remote-control car API” open-source repository.

  • Click here to view the “web controller” open-source repository.