SmartCar 2016

Modifying a children’s car with Beagleboard and Arduino

modified smart car

Development: John Stoltidis, Maria Matziouni

Supervision: Dr. Minas Dasygenis, Laboratory of Digital Systems and Computer Architecture.

 

This project was developed for the course of Embedded Systems as a semester task. It took place at the Department of Informatics & Telecommunications of the University of Western Macedonia, Greece.

A short video is online.

Introduction

The project provides the ability to control a modified children’s car via Internet connection. It consists of a PC program with GUI, a gamepad and a modified children’s car. The purpose of the project is a safe, low cost communication and control of a device through the Internet.  

 

Design

Main program GUI

Main program GUI and video streaming

In order to start the communication and the control of the car, the program (guiWopencv.exe) needs to be started. Using the user friendly GUI, it is easy to get the car’s IP and establish an SSH connection with it. The car runs an SSH server and a Motion server in order to have live streaming. Through the GUI, we have access to a live stream video and other information, as the distance of an obstacle in front of the car (front sonar), car’s coordinates (GPS) etc. The program works with any kind of gamepad using DirectX input (DX library), although XBOX gamepads are used as Xinput devices (NVGamepad library) for better performance (the choice is made manually through GUI). A button/stick/trigger event is translated (in guiWopencv.exe) to an SSH command which writes a command to a file located at the car’s software. The file is mounted on the RAM for better performance and gets accessed from a sell script (my_script.sh) which forwards the command (2-3 letter string) to Arduino, writing at the proper USB port. Also there is a second script (second.sh) which reads Arduino’s output from the USB port periodically (1 sec) and updates sonar information. Arduino can stop the car and/or override the Move_forward command if an obstacle is observed, less than 45cm away, avoiding the impact.

Hardware

The car is controlled by an Arduino Uno R3, which is connected via USB to a Beagleboard-Xm Rev C. On Beagleboard, except from Arduino there are connected a WiFi USB adaptor, a Web cam and a smartphone for GPS measurements. For the web camera rotation, two SG90 9G servo motors are used, controlled by Arduino. Arduino also uses an HC-SR04 ultrasonic sonar for distance measurement, and a Dual H Bridge Stepper Motor Drive Controller L298N LC for the control of two 6V DC motors responsible for the car movement (moving forward and steering).

 

Modification

Except from 2 DC motors and a 6V battery every other electronic part provided with the car has been removed. At first, the sonar at the front of the car was installed. For the web camera mount, we had to make an appropriate well-shaped hole at the hood of the car, and glue the camera rotation mechanism. Then, we placed the rest of the equipment (Arduino, Beagleboard, breadboard and H-bridge) in the space under the hood, all properly connected.

 

servo motor rotator

Servo motor's rotator strongly glued

 

BeagleBoard-Xm Rev C

BeagleBoard-Xm Rev C mounted and connected with webcam, Arduino Uno R3, Wifi adapter and power

 

Dual H Bridge L298N LC

Dual H Bridge L298N LC connected with Arduino Uno R3

 

Full modification view

Full modification view

 

Hardware Schematics

Download detailed schematics

 

Main program project

Download the Visual Studio 2015 project of the main program

 

Necessary Libraries

Download NVgamepad, libssh, opencv , Open SSL Libraries

 

Arduino Source Code

Download Arduino source code

 

Shell Scripts

Download linux shell scripts

 

Bill of Materials

Component

Quantity

Unit Cost

Arduino Uno R3 clone

1

2.90

HC-SR04 Ultrasonic Sonar

1

1.27

5V AC/DC Adapter

1

3.00

Web camera

1

5.00

USB Wi-Fi adapter

1

5.00

USB Gamepad

1

10.00

Dual H Bridge L298N LC

1

1.60

SG90 9G Servo motors

2

1.36

Beagleboard-xm Rev C

1

50.00

Camera rotation mechanism

1

1.00

Total Cost

 

81.1