Introduction: Environmental Monitoring Rover - Powered by Intel Edison
This is a instructable inspired by the Mars Curiosity Rover , I don't expect this rover to make it to Mars !! but you mimic it and implement some cool features using the Intel Edison. Having said that ,on mother Earth you can find industrial applications for this, to monitor hazardous condition.
Here are some features implemented using
- A modified toy truck, which will act as the rovers chassis
- Using a python-flask web app running on Intel Edison to control the Motors on the rover
- Using a web cam to stream video to the web app to check the rovers line of sight
- Add sensors to monitor the environment variable (click the Sensor button for real time sensor values)
- Gas sensor
- UV sensor
Step 1: Collecting Components Parts You'll Need
Here are the components you'll need
- 9V battery (i am using a recharge-able 9v from banggood.com)
- 9V battery snaps
- UVC webcam(Logitech HD Webcam C270)
- Grove starter kit plus- basically from this kit I am using Base Shield v2 × 1
- and Grove – Temperature × 1 sensor
- In addition you will need Grove gas sensor MQ5
- and Grove - UV Sensor
- Jumper wire male-female and male to male
- Mini Solderless PCB Circuit Test Breadboard
- Rover kit , in my case I have modified a monster truck toy from Walmart which retails for about 20$
Tools and other material
- Zip ties
- Wall mount DC12V ~1.5A to connect to the Edison during setup
- Mini USB cable to connect to the Edison
- 3D printer and Filament(this is optional but I would suggest at-least to print the Motor Driver STL file for easy mounting and wiring )
- machine screws(about 10 ) if you plan on printing the STL files attached in the steps below.
Step 2: Selecting a Chasis for the Rover
In my case, I am using the same toy monster truck as a chassis which I used on an older project.(the truck, retails for about 20$ at a superstores like Walmart etc). Here you can use any robotic chasis that would hold the Edison Arduino break out.
Remove the screws from the Monster truck and gently dis-assemble the parts.
Be careful and patient ! while getting the circuit board and the battery holder out to prevent it from damaging the battery holder.
Step 3: Test the Motors and Solder Wire to the Battery Pack(Optional)
Before you get to interesting bits below test to check if the DC motor are still functional , in my case I used a 4 AA battery holder to test both the motors as shown in the picture above.
Now desolder the circuit board using a soldering iron from the battery holder.
Once done add batteries to holder and do a quick voltage test using a multimeter as shown in the picture above, in my case the battery holder uses 5 AA batteries , which means a output voltage of about 8-8.5 Volts.
Solder some breadboarding wire to the two ends of the battery holder as shown in the picture above.
Note: This is an optional step, if you are using a rover kit of some kind,just ensure that the Intel Edison Arduino break out is mountable on the rover.
Step 4: 3D Print the STL to Hold Motor Driver to the Grove Shield (Optional)
Download the STL file attach and 3D print. It should take about 5-10 mins .This part attaches to the Grove Base Shield which is mounted on the Edison.
First using a zip tie, secure the Sparkfun motor driver to the 3D printed part.
Now connect the Grove Shield on the Intel Edison Arduino Base board.
Then screw the 3D printed part to the base shield as shown in the picture above with 4X40 machine screws.
Step 5: Preparing the Intel Edison - Flashing Yacto Linux Using Flash Tool Lite
Now to prepare you Edison download the latest version of the Yacto linux image from the Intel website at
While writing this instructable, the Yacto release version is - edison-image-ww25.5-15.
As part of this install as shown in the picture above we are going to use Flash Tool Lite tool instead of the old command line method which include the command (reboot ota) was used in one of my older instructable(Getting Started with Intel Edison - Python Programming)
You can find the manual to use the Phone Flash lite tool at
Tip : We are using the Phone Flash lite to flash Yatco so that we can make use of the ~900MB of space in the root partition , this will be handy as we will be installing a lot of packages and can use the space to store picture taken by the webcam.
Step 6: Configuring Intel Edison -WiFi and Password for SSH
Connect the Edison Arduino breakout as shown in the picture
- basically connect the lower most USB port to the cable that will be connected to your computer. This is the Serial over USB port.
- And connect another micro USB cable to the port which is closer to the switch. In this scenario this port will be used to power up the Intel Edison and the expansion board.
Now on your Mac, open the Terminal App
To get into the Edison via the Serial port use the following command screen/dev/tty.usbserial-A
and then hit the Tab key, this will populate the complete device name then type 115200 –L(in my case screen /dev/tty.usbserial-A402IDIL 115200 –L)
The Intel Edison has an Wifi chip on-board,so take advantage of it! if you have have a WiFi router at home..
To configure the Wifi on the Edison, type in the following command
and hit the enter key It takes about 10 seconds for the Edison to scan for Wifi networks and list them as shown in the screen shot above. Type the number which matches with you WiFi router name , in my case "androidpod" is my network name which corresponds to 40 in the list
Type in your password, and once done make a note IP address and web url which in my case is http://edisonhub.local/. Bookmark the URL above as you will need this to know your IP address to SSH in.
To set a password for the Edison use
Once done using another terminal window, check if you are able to SSH in using
Now if you choose you can use ssh terminal or the screen terminal to setup the urls for the official packages repository for the Edison.
echo "src intel-iotdk http://iotdk.intel.com/repos/1.1/intelgalactic" > /etc/opkg/intel-iotdk.conf
Now to complete the build you will also need the unofficial packages repository ,for this update the /etc/opkg/base-feeds.conf file, followed by the update command
Then add the following line and !wq to save the file in vi editor
src/gz all http://repo.opkg.net/edison/repo/all src/gz edison http://repo.opkg.net/edison/repo/edison src/gz core2-32 http://repo.opkg.net/edison/repo/core2-32
the run an update
Note: Do not run "opkg upgrade" for the unofficial repo, this will unnecessarily eat up space in your root partition.
For more info refer to AlexT's blog at http://alextgalileo.altervista.org/edison-package-...
Step 7: Wiring Up the Intel Edison to the Sparkfun Motor Driver
Now for the wiring first connect the signal half of Sparkfun motor driver(TB6612FNG break out which is dual H-Bridge) to the base shield as shown in the first picture , here are the connections
- STBY to pin 10 on the base shield which act as the Standby
To control back motor of the truck
- PWMA to pin 3 - this is a PWM pin to control the speed of the motor
- AIN1 to pin 9
- AIN2 to pin 8 - both these pins decide the direction the back wheels will spin.
To control the front motor which provides direction to the truck
- PWMB to pin 5
- BIN1 to pin11
- BIN2 to pin 12
Now insert/mount the board on your rover and complete the other side of the connections, that is
- A01 to one terminal of the back motor as shown in the second picture above
- A02 to the other terminal
- B01 to one terminal of the front motor
- B02 to the other terminal
Then to Power up the motor
- Connect VCC to the battery +ve
- and GND which to the GND of the battery back , here is where I use the Mini bread board to make a common ground connection to the Grove base shield
Tip: This is a pretty expensive piece of hardware so a suggestion here would be to use, zip ties to secure the board to the base. And also use electrical tape where ever necessary to prevent short circuits..
Step 8: Testing Motors a Basic Test With the Python Code
Now it time to test you rover/tuck motor and decide the direction the wheels are spinning.
Place you rover up side down and power it up using the 9V battery.
Download the code attached and upload the code to the Edison using a FTP tools like FileZilla/Winscp
And then run the following
Step 9: Installing Packages for the Flask Web App
To install flask for the web app we will use pip to install it, which means that we will have to install the python pip package first, use the following command once you have ssh'ed into the edison.
opkg install python-pip
Now that pip is successful installed as shown in the screenshot above install flask
pip install flask
Tip: I prefer using vi editor, but if you new to Linux or like prefer the nano editor over Vi, which will make it easier to edit file, if you have to, using the following command to install nano
opkg install nano
Step 10: Testing the Flask Install
Using an editor(vi/nano) of your choice create a file and add the python code for a simple flask app, this will test if our flask installation was successful.
Add the following lines of code
from flask import Flask app = Flask(__name__) @app.route("/") def hello(): return "Hello Intel Edison!" if __name__ == "__main__": app.run(host='0.0.0.0', port=800, debug=True)
Save the file using ctrl+X
and then at run the python file
Now test the app using you browser ,using the ipaddress of the Edison, as shown in the second picture above.
Note: if you have forgotten/not made note of your ip address use the following command
Step 11: Testing the Rover Using Flask Web App
At this point shutdown the intel Edison using and get it off the wall adapter and power it up using 9v battery.
shutdown -h now
Download the zip file attached and upload it to the Intel Edison using an FTP tool like filezilla.
SSH into the Edison and navigate to the basicflaskController folder and then run the command
Now use your smartphone/table to bring up the app using your Edison IP address followed by the port :800, which in my case is
Congratulations !! on getting this far, you can now use the web app to control the Truck/rover as shown in the Video above
Step 12: 3D Print the Part to Hold the Webcam and Mount It Using Zip Ties(Optional)
Now to add a line to sight to the rover we are going to add a UVC webcam to the USB port of your Edison.
3D printing the parts is optional here, if you can find other alternatives to secure the webcam to the rover.
If you plan to 3D print and have the same web camera, that is the Logitech HD Webcam C270, download the STL file and slice it and 3D print it. Based on your setting 3D printing should take about 15-20 mins.
Now snap the 3D printed part on the camera and using Zip ties secure it to the top of the rover.
Finally add the USB to the USB port of the Edison as show in the picture above.
Step 13: Installing Packages You Need to Run the Webcam
Now to use the webcam connected to the USB port, you will need the following modules/packages to be installed on the Edison.
Before you install the kernel modules, you will need to backup , increase and restore the boot partition, or you will run into the error as shown in first screen shot above.
Use the following command to back-increase and restore the boot partition, as shown in the second screen shot
mkdir /home/root/boot-backup cp -rp /boot/* /home/root/boot-backup/ umount /boot mkfs.vfat -v -nboot -F16 /dev/mmcblk0p7 mount /boot cp -rp /home/root/boot-backup/* /boot rm -r /home/root/boot-backup
Now you good to go and install kernel modules , which will extend the kernel for USB devices
opkg install kernel-modules
Now type the following command to validate if your web cam is detected,
in my case it shows up as "Logitech Inc, webcam C270 "
Note: Here see that you flip the switch near the USB connector toward the power input if your camera does not show up.
Step 14: Testing the Streaming From the Web Cam
Now to the fun part, streaming from the Intel Edison WebCam!!
For this you will need to install the mjpg_streamer package
opkg install mjpg-streamer
And then use the following command to test the stream
mjpg_streamer -i "input_uvc.so -y -n -f 30 -r 640x480" -o "output_http.so -p 8080 -n -w /www”
And then got to you browser on your laptop and type the following, and use should be able to see yourself on in the browser as shown in the picture above.
which in my case is http://192.168.0.24:8080/?action=stream, if you just want to see the live stream.
Tip: If you plan on taking picture/selfies with the Edison using your web cam, install fswebcam
opkg install fswebcam
And then to take picture use
Step 15: Selecting the Grove Sensors to Add
Now to get to the environmental monitoring part, choose your sensors, here I choose the following sensors
Since I am using python-flask , I have converted the Arduino Library into the equivalent python library, which you can find in the next step.
Step 16: 3D Print the Holder to Mount the Grove Sensor
3D print the STL file attached. Here I have attached 2 STL files which should take about 10-15 mins to print base on the one you select
#1 - Sensor Holder V2- this is ideal if you are planing on select in the same set of sensor, and already has mounting holes
#2 - Basic Sensor Holder - this is a simpler version so that you can drill holes after 3D printing and mount the sensors of your choice.
Screw the sensor to the 3D printed base and using zip ties attach them to your rover.
Step 17: Testing the Grove Sensors
Connect the sensors to the base shield
- Gas sensor MQ5 to A0
- Temperature to A1
- and UV Sensor to A2
If you prefer to test each of the sensor individually download the zip file attached and upload it to your Edison to test each sensor.
For example to get the temperature printed to the terminal use
Step 18: Using Intel IoT Cloud Analytics to Send Sensor Data
To take advantage for the Intel IoT Cloud Analytics, follow the steps to setup and test uploading sensor data to the cloud.
Follow the link below for a overview and setup steps
In our scenario, we need to setup two new sensor instance for the UV index sensor and Gas Sensor once you have setup your login at
Basically the temperature is setup by default at My Account -> Catalog at the web site above.
Got to My Account -> Catalog and click on Add Catalog Item button, and add the following values, as shown in the first screen shot above
Add the following catalog item
- Component name = UVIndex
- Type = Sensor
- Data Type = Number
- Unit of Measure = mV
- Format = Float
- Display = Time Series
And on the same line add values from Gas Sensor
- Component name = GasDensity
- Type = Sensor Data
- Type = Number
- Unit of Measure = mV
- Format = Float
- Display = Time Series
And then SSH into your Edison and follow the link above to check date,testing network connectivity,changeing the device Id and activating the Intel Edison.
Now register the UV index and Gas Sensor
iotkit-admin register uvindex uvindex.v1.0
iotkit-admin register gasdensity gasdensity.v1.0
And to list the catalog item use the following command as shown in the screenshot above
Now to test posting values to the Intel Cloud use
iotkit-admin observation uvindex 60
iotkit-admin observation temp 21
And once you post a couple of values you should be able to setup a graph in the My Charts section on the intel IoT website as shown in the 3rd screen shot above.
Step 19: 3D Print the Fake Solar Panels (optional)
Now to add looks! to your rover,3D print the fake solar panels STL file attached.3D the STL file should take about 10-15 mins based on your printer setting.
Then use a white paint pen to mark the groves in the 3D printed parts.
And then zip tie the 3D printed parts to the rover.
Step 20: Download the Code for the Monitoring App
Download the flask web app attached and upload it to the Edison using a FTP tool like filezilla.
SSH into the Edison and run the flaskcontroller.py file
This will start the flask web app, you are now ready to open the web app on your tablet/mobile web browser
Congratulation !! you are done and now ready to drive your rover around using the controller web app and take temperature,Gas density and UV index readings at real time by clicking the Sensor button, and also post the values to Intel's IoT Analytic cloud, for a graphical view as shown in the screen shot above ..
Github link for the latest revisions to the code.
Step 21: Rovers Future Enhancement
Here are some planned few future enhancements for the rover
- Reduce the form factor using Intel Edison blocks from Sparkfun
- Add some more interesting sensors like the Air Quality sensor
- Add GPS to track the routes taken by the rover
- And improve on the code, use openCV for spot detection(~something similar to face detection) as part of the flask app instead of mjpg-streams.
- Power up the rover and Intel Edison with real solar panels , suggested by instructable members @GuthrieM1 and @VIVEK PRAKASHT
Please leave a comment below if you come up with some interesting suggestion..