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:

L3G4200D

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

ADXL345

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

HMC5883L

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

BMP085

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.

Nov 23

Gift Ideas for the Maker in Your Life

For anyone who has a maker in their life you know it can be hard to find a gift for us, especially if you are not a maker yourself. I’ve put together a couple ideas for this holiday season. Below you will find gift ideas for people who are just getting started and some for more experienced makers.

Gifts for Beginners

  • SparkFun Inventor’s Kit for Arduino – This is the kit that started it all for me. It’s great for anyone who wants to get started in the maker world
  • Subscription to Make Magazine – Make Magazine is full of project ideas and news from the maker world
  • Adafruit Tool Kit – Having the right tool for the job makes all the difference. This kit includes all the necessary instruments to get anyone started with DIY electronics

Gifts for Intermediate Makers

  • Arduino Due – This is the latest board from Arduino and it’s still in short supply so check Sparkfun, Adafruit and MakerShed
  • Arduino Micro – This miniature version of the Arduino is great for smaller projects (for those of you reading this on December 24th it’s also available in-store at Radio Shack)
  • Raspberry Pi – This credit card sized computer packs a punch and is hacker friendly
  • Tackle Box – Over time makers collect a lot of parts, sensors and wires. A tackle box is great to help organize all of their supplies. The Plano 7771 is the one I use and it’s been great but it is pretty big, Plano makes a smaller version that would also work well

Gift Certificates

Normally I wouldn’t recommend gift cards because they are impersonal, however many times a project will call for a specific part that you may not anticipate needing. For times like this it’s good for a maker to have a credit available at their favorite website to fill in the necessary parts they need. I would recommend a Sparkfun, Adafuit, MakerShed or HobbyKing Gift Certificate as an additional gift or stocking stuffer.

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:

Supplies

  • 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

Construction

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

Sketch

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
  nunchuck_setpowerpins();
  nunchuck_init();
}

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

    nunchuck_get_data();
    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
    RightRotate=speed-direction;
    LeftRotate=(180-speed)-direction;

    // Writes the rotation speed to the servos
    RightWheel.write(RightRotate);
    LeftWheel.write(LeftRotate);
  }
  loop_cnt++;
  delay(1);
}

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.