Project tutorial
Arduino Spybot

Arduino Spybot © GPL3+

This four wheeled car can be controlled through a node web server where a custom camera view can be displayed.

  • 7,472 views
  • 5 comments
  • 25 respects

Components and supplies

A000066 iso both
Arduino UNO & Genuino UNO
×1
HC-06 Bluetooth Module
×1
Rhxvhx2dhljmbtloxexc
Arduino Proto Shield
You can use any other solder-able breadboard with pin headers
×1
Adafruit Motor/Stepper/Servo shield V2
×1
SM-S4306R Continuous Rotation Servo
×1
DC motor (generic)
×4
Motor Tire
×4
11026 02
Jumper wires (generic)
You need these for the motors
×8
Adafruit industries ada830 image 75px
4xAA battery holder
×2
61vhxtmzbyl
AA Batteries
×8
Mobile phone
I have used a Nokia Lumia 520 for the project
×1
Mobile phone holder
×1
Custom chassis
I have used a simple wood board
×1

Apps and online services

About this project

Short introduction

This is a simple four wheeled car which is controllable via bluetooth connection. The car can hold any mobile phone which can be used as an IP camera. I decided to make this robot with javascript using a node web server where I can monitor where the robot goes.

You can see the circuit of the main parts in figure 1.

After running the server I get a screen which contains some introduction about controlling and a window for camera view (figure 2).

And yes, this layout is responsive.

The chassis

In this version of the bot I decided to make the chassis on my own. If you do not have a drilling machine or just want an easier solution you can buy from a wide variety of plastic car bodies.

I went the way to make my own chassis and it was not as easy at seems like. The most important rule is that you have to put the tires as close as possible to each other if you would like to choose differential steering for turning around. You can read the main mistakes and basic physics rules in the following link:

http://www.rakeshmondal.info/4-Wheel-Drive-Robot-Design

Another challenge was how to attach the DC motors to the chassis. In my case I haven't got any special part for this so I decided to choose some cable ties (150/3,5) for the task. For proper attaching of the tires I had to drill the holes as precise as possible and use 2 cable ties for one DC motor. Unfortunately there is a chance that the motors won't fit as straight as enough and your car may move a bit to the left or the right when you control forward and backward.

The batteries

For powering the boards and the motors I decided to choose a single DC power supply for the task. The chassis haven't got any space for an 8 x AA battery holder so I had to make some customization so attached two 4 x AA holders with 2 screws to each other. For this I had to drill the plastic as well.

Powering

In my case I power the Arduino Uno board with 8 x AA rechargable batteries. This is enough power to serve the motor shield as well. There is a jumper on this shield which is removable so your motor shield won't get any power from the Arduino. In this case you can power your shield separately using the power pins on it. You can read about different powering options in the following link:

https://learn.adafruit.com/adafruit-motor-shield-v2-for-arduino/powering-motors

Wireless connection

I used an HC-06 bluetooth module to establish connection between the car and my computer. I wanted to use as less cables as possible so I decided to build a custom Arduino shield by putting the bluetooth module to and empty prototype shield, do the wiring under the shield and solder some pin headers for the correct attaching mechanism. You can have a quick view of the result in figure 3 and figure 4.

The good thing is that you have the ability to undock the bluetooth module from the shield anytime because it is not soldered to the board.

For setup the bluetooth module, please follow the instructions from this site:

https://github.com/rwaldron/johnny-five/wiki/Getting-Started-with-Johnny-Five-and-JY-MCU-Bluetooth-Serial-Port-Module

Movement

The robot is able to move forward, backward and turning using differential steering. The camera holder is attached to a continuous rotation servo so you can look around with the phone without moving the car itself. You can view a short demonstration in the following video.

video 1 - Robot movements

Mobile phone

I used a Nokia Lumia 520 for the project and Win IP Camera application which you can find in the store:

https://www.microsoft.com/en-us/store/p/win-ip-camera/9nblgggz4xb1

About the code

As a javascript developer I decided to create a node web server for the control page and use some fancy libraries for the look and feel and code syntax enhancement. You can see the full list on my github page and the next section.

I decided to choose modularization both in the frontend and backend. Here is the entry point of the application:

var boardModule = require('./src/boardModule'),
    servoModule = require('./src/servoModule'),
    motorModule = require('./src/motorModule'); 
 
boardModule.initBoard().then(function() {
    motorModule.initMotors();
    servoModule.initServo();
});

In the front end side I also use separation for each module:

import {moveWheels, stopWheels} from './wheelsControl';
import {moveServo, stopServo} from './servoControl';
 
document.onkeydown = checkKeyDown;
document.onkeyup = checkKeyUp;
 
function checkKeyDown(e) {
    moveWheels(e.keyCode);
    moveServo(e.keyCode);
}
 
function checkKeyUp(e) {
    stopWheels(e.keyCode);
    stopServo(e.keyCode);
}

For the full codebase check my github repository above.

Sortware libraries

  • johnny-five - for using Arduino Javascript controlling API
  • socket.io- for using web sockets to establish communication between back-end and front-end
  • susy - for creating the layout and responsive design
  • gulpJS - for task automatization
  • BabelJS - for transpiling EcmaScript 6

Last words

I am a beginner of this IoT world and this is my first project. I do not want to tell that I used optimal solutions but hopefully you can find some useful information from this guide.

Code

Schematics

Fritzing diagram
arduino-spybot.fzz

Comments

Similar projects you might like

Arduino Node Tank

Project tutorial by Dominik Filkus

  • 3,025 views
  • 2 comments
  • 11 respects

BE∆ST: Bluetooth Vehicle Final Designed Chassis

Project showcase by Matthew Chiang

  • 2,702 views
  • 0 comments
  • 15 respects

2WD Voice Controlled Robot with Arduino and BitVoicer Server

Project tutorial by Marcio Tamagushi

  • 10,203 views
  • 11 comments
  • 32 respects

Voice Controlled K'nex Car

Project tutorial by Austin Wilson

  • 10,148 views
  • 4 comments
  • 53 respects

WaterPi: Houseplant Remote Watering and Monitoring System

Project tutorial by Demirhan Aydin

  • 29,485 views
  • 14 comments
  • 128 respects

BLE Bot 9000

Project tutorial by 5 developers

  • 24,779 views
  • 7 comments
  • 74 respects
Add projectSign up / Login