Jun 03

Using the GY80 10DOF module with Arduino

I recently purchased a 10 Degrees of Freedom (10DOF) sensor from eBay called a GY-80. It’s a compact module that includes a gyroscope, accelerometer, digital compass, and a barometric pressure / temperature sensor.

GY80 Top Labeled

All of the individual sensors are accessible over I2C so you only need 4 connections to access all those sensors. SDA, SCL, Ground and VCC (you can use 3.3v or 5v).

GY80 Bottom Labeled

Each component can be accessed individually. I was planning on doing a write-up on each one, but it looks like Bildr beat me to the punch as they already have a great tutorial for each component. Here are the links to the datasheets and tutorials for each component:


3 axis gyroscope from ST
L3G4200D Datasheet
Bildr Tutorial: http://bildr.org/2011/06/l3g4200d-arduino/


3 axis accelerometer from Analog Devices
ADXL345 Datasheet
Bildr Tutorial: http://bildr.org/2011/03/adxl345-arduino/


3 axis digital compass from Honeywell
HMC5883L Datasheet
Bildr Tutorial: http://bildr.org/2012/02/hmc5883l_arduino/


Barometric Pressure and Temperature Sensor from Bosch
BMP085 Datasheet
Bildr Tutorial: http://bildr.org/2011/06/bmp085-arduino/

Next steps

This module can be used individually as the articles above show but they can also be monitored at the same time. MultiWii is an open source software project that is used as the brain of multi-copter projects. The code runs on Arduino and it is compatible with a large variety of sensors (the GY80 being one of them). It does require a little tinkering to get it working properly. I’ll document the process in a future article. Also since this module works over I2C it can also be accessed using a Raspberry Pi.

Aug 13

One Week on Mars with Curiosity

NASA’s Curiosity Rover has spent a week on Mars and while it has yet to even start its actual mission there this project has produced some of the most exciting and visceral moments out of the space program in recent memory.

For those of you who stayed up late to watch the Entry, Decent and Landing (EDL) you know it was an exciting night. Watching live as the JPL and the audience lived through the 7 Minutes of Terror we were all biting our nails waiting and waiting to hear back that Curiosity landed safe and sound. Thankfully the Mars Odyssey was able to get into position in time to relay the first picture of Mars from the newly landed rover.

The next day we were gifted with a picture of the MSL mid decent with its parachute deployed.

MSL Landing

And even a picture of the aftermath of the EDL phase. Showing all the individual components of the entry vehicle spread across the surface of Mars.

MSL Landing Components

After the landing happened NASA passed over the area to see how close they were to the projected landing zone. It cannot be overstated the precision with which the NASA team was able to land this rover.

After a quick OTA update (if you think updating your smartphone is nerve wracking imagine patching a $2.5 billion device with no way of un-bricking it). We were greeted with some color HD pictures of the surface of mars that makes is seem like it could be right from our backyard.

Closeup of Wheel

The latest is a stitched together Panorama

All of this has been so much fun to watch. NASA has done a great job of showcasing the amazing work being done. In the coming years robotic exploration is going to be the standard. While we wait for the resurgence of a manned space program the work done by NASA and the JPL during this project is truly inspirational.

Apr 26

Basic Arduino Robot

The Arduino is a great way to get started in the world of DIY electronics and robotics. This project pulls together a few key items to interface with an Arduino. This robot is controlled through the joystick of a Wii Nunchuck (although you could just as easily use the accelerometer) and has a 2 wheel drivetrain similar to the design used by iRobot’s Roomba. Here are all the supplies needed for this project:


  • 1 Arduino
  • 1 breadboard
  • 2 full rotation servos
  • 2 servo wheels
  • Breakaway headers
  • 1 Ball Caster
  • 1 Wii Nunchuck
  • 1 WiiChuck adapter
  • 1 9v battery with connector (or other battery pack)
  • 4 AA batteries and holder
  • Blank CD
  • 2 sided tape


The blank CD provides a frame for the robot. The servos are attached to the top with 2 sided foam tape and a ball caster is taped to the bottom of the CD in the front. This is called a two wheel drivetrain and is controlled by the speed each wheel rotates at. If both wheels spin at the same speed the robot goes forward, if one spins faster than the other then the robot goes in the direction of the slower wheel.

Wiring the robot is the next step. An easy way to keep this organized and allow for future expansion is to setup the wiring on a small breadboard. Servo’s typically come with a 3pin female connector; to be able to plug these into the breadboard you need breakaway headers. The Wiichuck is plugged directly into the analog pins of the Arduino.

This robot requires different power sources for the Arduino and for the servos. Servos draw a high current so if only one battery pack is used the Arduino would lose power when the wheels started to spin. One thing to remember when using multiple power sources is to tie them all to a common ground.

Here is a diagram of the setup:

Once everything is connected, all you need to do is stack the components onto the platform and connect the power. You can also wrap a rubber band around the breadboard, Arduino and battery pack to prevent it from slipping


Here is the code to make the whole thing run:

// Simple Robot controlled with Wii Remote
// ForkRobotics

#include <Servo.h>
#include <Wire.h>
#include "nunchuck_funcs.h"

//Create Servo Object for Left Wheel
Servo RightWheel;
Servo LeftWheel;

int loop_cnt=0;
int speed,direction,LeftRotate,RightRotate;

void setup()
  RightWheel.attach(5);  // attaches the Right Wheel to pin 5
  LeftWheel.attach(6);  // attaches the Left Wheel to pin 6

  // initilization for the Wiichuck

void loop()
  if( loop_cnt > 100 ) { // every 100 msecs get new data
    loop_cnt = 0;

    speed  = nunchuck_joyy(); // reads joystick y axis (range of 38-232)
    direction  = nunchuck_joyx(); // reads joystick x axis (range of 25-223)

    // Converts the joystick input to the servo output range
    speed = map(speed, 38, 232,0,180);
    direction = map(direction, 25, 223,-90,90);

    // The joystick floats a little, this reduces jitters when it's near center
    if (speed >= 87 && speed <= 93) speed = 90;
    if (direction >= 87 && direction <= 93) direction = 90;

    // Translates the joystick reading to the rotation speed for each wheel

    // Writes the rotation speed to the servos

If you try to upload or verify this code directly you will get this error:

Before you can compile and upload the code you need to put a copy of the nunchuck_funcs.h file from the WiiChuck Project http://todbot.com/blog/2008/02/18/wiichuck-wii-nunchuck-adapter-available in the same folder as the sketch. Follow these steps:

  1. Save the sketch
  2. Close Arduino IDE
  3. Copy the nunchuck_funcs.h file into the sketch folder
  4. Reopen the sketch
  5. Upload

The result

The result is a basic robot that has direct control through the Wii remote.

I consider this a starting point for more complex projects. Adding bumpers or distance sensors would allow for the robot to do obstacle avoidance or a camera pointed through the hole of the CD could allow line tracing.

Nov 27

MSL & Curiosity

NASA’s Mars Science Laboratory launched yesterday on its 9 month journey to Mars. Now that NASA has retired the Space Shuttle and ended our manned space missions for the time being the future of space exploration is going to be a partnership between robots and humans. The latest version of this partnership is the Curiosity rover. Curiosity is impressive on virtually every level.

First of all, the sheer size of this rover is impressive. It’s the size of a small SUV at 10 feet long, 9 feet wide and 7 feet high. It has 20 inch diameter wheels a 7 foot long arm and it weighs in at just about 2000 pounds.

The Curiosity rover is also referred to as a mobile laboratory. The MSL mission’s overall scientific goal is to explore the landing region and assess the area as a potential habitat for life, past or present. This objective will help to expand our knowledge of the history of Mars and even help determine the feasibility of future manned missions. To accomplish the mission Curiosity is outfitted with 10 scientific instruments that are the culmination of the best sensors developed from groups in the US, Spain, Finland, Russia, France, Canada, and Germany. It’s truly a worldwide effort to advance humanity’s knowledge of another planet.

Even the landing system is revolutionary. For the Spirit and Opportunity rovers NASA used an airbag method to land the rovers. This method was successful, however, the first generation of rovers weighed less than 400 pounds, Curiosity weighs 5 times more. This approach to a landing puts a lot of strain on the rover in the landing process; the sensitive instruments on Curiosity may be damaged if landed the same way. In addition to these concerns, the other limitation is that NASA can only predict the landing site within a 50 mile radius. The solution to these concerns is a new guided entry system with a sky crane.

The rover, inside its heat shield, will enter the atmosphere at 13,200 mph, during decent the speed is reduced to 900 mph before a parachute is deployed at an altitude of 7 miles and slows decent to 80 mph. At about 1 mile off the ground the Mars landing engines activate and slow the decent to 1.7miles per hour. At an about 66 feet off the ground, the sky crane begins to lower Curiosity to the ground. Once Curiosity detects a safe landing, the tethers disconnect and the sky crane flies off to land a safe 500 feet from the rover. This is the first time NASA has tested this landing system. It’ll be an exciting day to watch the decent in action.

The Mars Science Laboratory mission is the latest and greatest project in the robotics field. I’m eagerly looking forward to August 2012 when Curiosity is expected to arrive at Mars.


Further Reading:

Scientific goals: http://msl-scicorner.jpl.nasa.gov/ScienceGoals/

Instruments: http://msl-scicorner.jpl.nasa.gov/Instruments/