“ArdiPi” Wireless Arduino and R-Pi Rover

“ArdiPi” The Wireless Arduino and Raspberry Pi Rover

By: Greg

So basically let me tell you how this project works. You simply have an Arduino (Uno or Leonardo) which you use to connect to two motors and control them. Then you have a RaspberryPi which is controlled by your iPhone, iPad or computer. The RaspberryPi sends data from your device to the Arduino telling it what to do.
Wireless Arduino and R-Pi Rover
#################################################################

MY ASSUMPTION:                                         

—-For this project I am assuming that you are somewhat familiar with RaspberryPi and Arduino.
————-What I mean is that your RaspberryPi is already setup and ready to use (with ssh enabled) and you have a computer to connect to it with and that you have a wireless connection setup with your Pi and your router (this will enable you to control the whole rover)
—————-I am also assuming that you have coded before with Arduino’s, so you will be able to understand much of what the code will do
————Adafruit motor library installed on Arduino IDE to control motors
——–I also assume you have plenty of time on your hands (about one day)
—————-I also assume that you have assembled the chassis to mount everything on
#################################################################

Materials:

-Beginner Bot Chasis (to mount everything on) you can find it here —->  http://www.robotshop.com/2wd-beginner-robot-chassis.html
-An Arduino (UNO) WARNING: The Leonardo will NOT work for this project because it has different timers compared to the Uno which renders the motor shield useless!!
-Adafruit Motor Shield (that’s what I used)
-Duct tape or electrical tape
-A Raspberry Pi
– A wifi dongle (for the pi)
– 3 battery packs (two 4battery packs, and one 5/6battery pack)
-Soldering iron (with solder)
– A button/switch (to control power going to the Pi)
-A Voltage meter (optional)
-2 motors
-Code for the Arduino (will be supplied by me)
-Python script to run Telnet communication to Serial communication (will be supplied by me)
-A computer running Putty or an iPhone running the eTelnet app (free app) (iPhone is optional if you have a computer)
-Batteries
-Wires (to wire everything up) I use the wires that have the little ends(their like little pins) on them to make life easy (we will be modding some of them, so buy at least 10 of the wires)
-HOT GLUE (this would be ideal because then you wouldn’t have to use a bunch of tape like me to hold things down on the rover)
-DC adapter (to plug into Arduino)

“ArdiPi” The Wireless Arduino and Raspberry Pi Rover(516×290) 17 KB

Step 1: Get the Code

You wan’t to begin by getting the code on your RaspberryPi and Arduino, so you don’t have to deal with them later.Below I have a zip file of the Arduino Code, and open it up for later use

I also have attached the Python script to used to handle the incoming Telnet connection to your Pi, it will transfer the code to Serial data for your Arduino to use. To put it on your Pi, you can get a USB and transfer the file over, or you can download it from your Pi browser or use the FileZIlla application and transfer files through ssh (really easy).

You will need to edit the Arduino code later on to suit your rover

Read the comments in the Arduino Code carefully to understand how to use it

The connect.py file below uses special commands that I will show you how to use in the later steps so that you can connect to your Arduino from your RaspberryPi

Step 2: Powering the Arduino

To start you are going to need to power your entire project, and to do this wirelessly you will have to use batteries. This is where the chassis mentioned in the parts list comes in handy. You see, it has 2 levels. We will use the bottom level to hold the battery packs (the two packs that hold 4 batteries).

This part will not require the use of the RaspberryPi because you are simply going to setup the motors and get them working.

The way the power will be distributed is by wiring up the two battery packs in series and then soldering the two ends left over to the DC adapter head that you will plug into your Arduino. In between the connection of the power to the Arduino you will need to connect a switch or button to stop the flow of power, so you can control when the Arduino turn’s on and off. Yes, you are putting in 11V’s to the Arduino, but it’s max voltage input is 20V, so your alright. The voltage is to simply run the motors well.

Below I have a simple schematic of how the setup will look. The two battery packs are really not supposed to have two batteries in each. In our case you will need four batteries in each battery pack.

In the photo below of my rover setup here is the wire lineup:

YELLOW: Connects the Positive and Negative leads of the two battery packs
BLACK: Connects the ground lead of one of the battery packs
RED: Connects the power of one of the battery packs
SWITCH: Controls current flow to power on Arduino
PLUG: To plug into the arduino

Step 3: Wiring the Arduino + Batteries + Motors

Next you will have to connect the motors to the Adafruit motor shield. I will say that all you have to do is unscrew the screws on the terminals for power and plug your motors into the ports labeled M1 and M2. These ports are the ones that will work to power the motor’s properly. Try to keep the wires under the top level of the chassis to make the bot look neater on top and take up less space.

When you screw on the first layer (the platform that will hold the Arduino and Pi) you will need to have all the wires from the batteries under the “hood” of the rover, you will have to conceal the wires alongside the batteries and make sure they don’t tangle up with motors. But you also need to be sure to have the push button sticking out along with the power wire for the Arduino.

After you put the plate over the batteries you will need to find a comfortable place for your Arduino to sit, because we want it to take up the least amount of space as possible. Once you find a good spot for it, wire in the motors.

MOTOR WIRING: When you wire the motors make sure you plug them into the correct ports of the motor shield. It is also recommended to hide the wiring under the top level of the rover to make everything look neat.
Wireless Arduino and R-Pi Rover
The photos below show you the wiring, make sure to follow how the connections are made in the motor shield pictured below.

Now, I noticed that the bottom deck of the rover left a lot of open space, so I decided to use black electrical tape to style the open area and protect it when the rover is in motion.

Step 4: Testing (playing) with the Arduino and Motors

So, once you have the batteries set and the motors plugged into the Arduino, you will now need to test (or as I consider “play”) with the code and try to get the speeds and delays in the code just right for the rover.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top