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.

Jan 05

How to Build a BlinkM Clone

The original BlinkM was the first in a series of I2C controlled RGB LEDs from ThingM. It’s easy to integrate into projects and control with anything that supports I2C. At its base level it is an ATtiny45 and a Piranha RGB LED. For anyone who wants a simple, elegantly packaged component I would highly recommend that you buy one of these. I am more of a do it yourselfer so I decided to build my own out of parts I had laying around.

Build

Here are materials I used in my project:

  • ATtiny chip (I’ll be using the ATtiny85 but an ATtiny45 will work too)
  • RGB LED with a Common Cathode
  • 3 resistors
  • Jumper cables

This project is very tolerant to variation and you can really do it however you see fit. If you don’t have an RGB LED and want to use individual LEDs that will work. If you have a common anode LED instead of a common cathode LED you will need to use a different firmware package but it’ll work as well. The point is to have fun and learn.

Firmware upload

The firmware for the BlinkM is currently closed source. The reason for this is that the patent for controlling RGB LEDs over I2C is owned by Phillips/NXP. ThingM has licensed these patents to produce their line of BlinkM products. You’ll notice that the license for the BlinkM firmware states that it is for personal use only, not for internal business purposes or for commercial gain. Keep this in mind if you would like to produce a product using this technology.

Because this is closed source it led to the development of an open source alternative: CyzRgb. This firmware is fairly similar to the BlinkM firmware with some additions (like a logarithmic curve for more accurate colors) and some subtractions (it only has 1 script as opposed to the 18 BlinkM has). Some people have noted it’s buggier but if you want to make something that is physically different from the BlinkM (like using a common Anode LED) you will need to use it.

ThingM offers a simple way to upload the firmware through which is called the ReflashBlinkM. This program can be used with the ArduinoISP and can be used to load raw ATtiny chips with their firmware. To do this you’ll need to setup the Arduino ISP wiring as described in the Run Arduino Code on an ATtiny article. Once it’s all connected then start the ReflashBlinkM program:

  1. Select the BlinkM firmware to use (if you are using CyzRgb, select custom and pick the .HEX file from their binary zip file)
  2. Click ArduinoISP on Arduino
  3. Select the port your Arduino is currently on
  4. Click Reflash

ReflashBlinkM using ArduinoISP

It will show the progress in the text at the bottom. When it says “Reflashing Done!” you now are ready to use your ATTiny as a BlinkM.

NOTE: This worked for me when using my UNO but not with my Leonardo.

Wiring

Now that you have an ATtiny programed with the BlinkM (or CyzRgb) firmware it’s time to build the rest of the circuit around it. It’s important to make sure the correct colors are attached to each pin. This circuit can run on 5v or 3.3v.

ATTiny blinkm clone wiring

Use

Now that it’s all hooked up it’s time to test it out. When you first power up a newly flashed BlinkM it will run a default script which flashes through white, red, green, blue and off then starts again.

ThingM offers a package of example code which includes a handful of sketches for controlling it with Arduino. I found it easier to just extract the whole zip file to my Arduino Sketch folder. The all-in-one sketch for controlling everything the BlinkM does is BlinkMTester. With it you can use the serial monitor in ArduinoIDE to view a menu of options. If you are using ArduinoIDE 1.0.2 this will not work, it functions properly on version 1.0.3. If you are using a Leonardo you need to send “?” to get the menu to show up.

BlinkMTester Arduino Sketch Menu

Next Steps

This is an easy component to work with on its own or to integrate into existing products. I created mine as an exploration of the product but I foresee it having functionality in future projects where a diagnostic light is needed. In addition, since it works over I2C it’s compatible with a variety of development boards including the 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.

Oct 01

Arduino DUE Announcement

I made the trip to New York last weekend for The World Maker Faire. In the past this event has produced some big announcements from the Arduino team so understandably I spent a lot of time around the Arduino events. I was not disappointed, there were several exciting announcements out of the event that I’m really looking forward to.

The biggest announcement is something I’ve been waiting for since September of last year: The Arduino DUE! It’s expected to hit stores on October 22nd and is going to be around $50. As expected it has a 32bit ARM processor and the footprint resembles the Arduino Mega. This is major change in hardware from existing Arduino boards so questions of compatibility were asked several times. Thankfully Massimo Banzo assured the crowd that compatibility was a key concern when developing the DUE. It is compatible with the physical R3 layout published last year and the software team did a lot of work under the hood of the IDE to make sure that the user has the same experience regardless of the hardware used. This all adds up to an existing element of interoperability where you can swap shields, libraries or the Arduino board and with existing sketches be able to compile and upload seamlessly.

The Arduino DUE also has some really cool new features that will be a lot of fun to experiment with:

  • The DUE has a USB On-The-Go port allowing USB devices (like mice, keyboards, USB flash drives, etc) to be used directly with the Arduino. This opens huge possibilities for affordable and interesting add-ons for inputs and outputs. Later in the day Massimo did a simple demo of using a mouse as an input for a synthesizer type device. Using these devices will require libraries so don’t expect everything to work out of the box but the community will certainly step in and expand the field once the DUE comes out.
  • Multi-tasking is an option on the DUE. As expected the increased horse power of the ARM processor allows for running multiple tasks. Essentially you create multiple loops and run them at the same time. There are a few caveats though: it is cooperative multitasking meaning that the different threads need to take turns on the processor and the library is still experimental but they expect it to be developed quickly.
  • It supports CAN bus which is the protocol that subsystems within cars use to communicate. Expect to see some exiting instrument cluster replacement based on Arduino.

For more of the technical specs here is the flier they were handing out: ArdunioDUE

Also to hear about this and some of the other new stuff out of the Arduino camp you can check out the full session here: