Pages: [1] 2   Go Down
Author Topic: Interface Arduino with GPS, accelerometer, gyro, magnetometer, barometer  (Read 7596 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,
I rewrite my problem more precisely
I'm not sure in electronics, but for my degree thesis I have to interface many sensors: GPS, accelerometer, gyro, magnetometer, barometer, odometer.
At the beginning I didn't want to use Arduino because I think it's too complicate for my aim, but now I think this is the only way.
My question is: how can I interface Arduino with these sensors? Which modules have I to buy?
I 'm sorry for the banality of the question, but I'm a beginner.
Thanks to any answer.
stiv
Logged

Offline Offline
Edison Member
*
Karma: 9
Posts: 1015
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

To interface all of that, you need some kind of microcontroller. Do you know something simpler than the Arduino?

There are shields (boards you can attach to the arduino) with sensors. Most of those shields have example code and a library.
You could start with a shield with as many sensors as possible.

Sensors with analog outputs are easier to read than a digital serial communication.
So, you could try to find sensors with analog outputs to make it yourself easier.
But if you need all those sensors at the same time, you don't have enough analog inputs.

(1) If you have a Arduino (for example the Arduino Uno), start with the example for a blinking led.
(2) Try to send a message back, with the Serial library.
(3) Try to interface an analog sensor.
(4) Try to interface digital sensors over I2C or other digital serial communication.

It's not hard. The only problem is that most sensors use 3.3V. But the Arduino has 3.3V onboard for those sensors.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, I think that I'll try with some with a platform with some sensors at the same time.
1) So can I link all the digital sensor at the same pin with I2C interface or serial one to Arduino, and Arduino recognizes each sensor with its ID, or have I to link each sensor to a dedicate port?
2) Furthermore, can I link simple sensors directly to Arduino or have I to take a shield (TinkerKit module) with integrate sensor?
Sorry for the simple question but I'm a beginner.
Thanks
stiv
Logged

Offline Offline
Edison Member
*
Karma: 9
Posts: 1015
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

1)  The I2C is designed to have one single master, with many slaves. You only need SDA and SCL (both will pull-up resistors) and you can attach many slaves. Every slave reacts if its ID is transmitted on the bus. But if some sensors use 5V and others use 3.3V, you need extra hardware for level shifting.
2)  Simple sensors like sensors with analog outputs (MMA7361 accelerometer), or sensors with a single digital line (DHT11, temperature + humidity) can be connected to the Arduino directly.

If you want to use the MMA7361 accelerometer, you need 3.3V again. But you need 3 analog inputs.
The digital version MMA7455 is also running at 3.3V and can be attached to the I2C bus. So you use less pins, but you need an example or a library to get the digital communication working.
These MMA... series accelerometers are cheap. Many people use the BMA... series accelerometer which are more expensive.

The whole tinkerkit idea is to have a shield, and with connectors and cables you can attach sensors. It is very fast (just click the shield and cables) and the result is very nice and clean looking.
But to test or develop something by yourself, you could solder the sensors yourself and learn about them along the way.
« Last Edit: May 08, 2012, 12:05:48 pm by Krodal » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, thanks Krodal!
I think I'll return to my original idea, using a Bus Pirate (http://www.sparkfun.com/products/9544) to link all digital sensors (it support 3.3V and 5V sensors). I have to pay attention because I was told that different devices can have the same ID, so I have to control it in the datasheet.  Do you think is it correct?
Thanks for your patience.
stiv
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 50
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Dear krodal,

you state:

It's not hard. The only problem is that most sensors use 3.3V. But the Arduino has 3.3V onboard for those sensors.

The accelerometer i want to use in my project runs on 3V (http://www.bosch-sensortec.com/content/language1/downloads/BMA150_Flyer_Rev1.3_14JAN2008.pdf)

I was in the understanding that i could not use this sensor directly on the arduino UNO since the arduino runs on 5V (and it would fry the sensor). But if you look at the arduino picture:



You see that at the bottom there is indeed a pin which states 3.3V.  Does this mean that the board can run on 3.3v as well, or what is the pin for?

in the tutorial on arduino.cc (http://www.arduino.cc/en/Tutorial/ADXL3xx) it says that the example uses the breakoutboard from sparkfun. http://www.sparkfun.com/products/9814 But it seems that even that board requieres 3.3V. How can they manage?

Thank you,

Jorrit
(i've also put this question in the topic list)
 
Logged

Offline Offline
Edison Member
*
Karma: 9
Posts: 1015
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The 3.3V is an output.

If you use pull-ups on the I2C bus to the 3.3V (NOT the 5V), it is a little compatible with 3.3V.
I'm writing a playground article about level shifting right now: http://arduino.cc/playground/Main/I2CBi-directionalLevelShifter
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, thanks Krodal!
Now, also basing on what you said, I think have two opportunities:
1) Using a Bus Pirate (http://www.sparkfun.com/products/9544) to link all digital sensors (it support 3.3V and 5V sensors). I have to pay attention because I was told that different devices can have the same ID, so I have to control it in the datasheet.  Do you think is it correct?

2) I have also found another solution. It's based on Arduino. Give a look, I think it's quite good, Only there aren't characteristics of IMU:
https://store.diydrones.com/Full_ArduPilot_Mega_kit_from_Udrones_p/kt-apm-02.htm
What do you think about it? I can also take datas out from USB.

Thanks for your patience.
stiv
« Last Edit: May 10, 2012, 06:01:52 am by stiv » Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 50
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


2) I have also found another solution. It's based on Arduino. Give a look, I think it's quite good, Only there aren't characteristics of IMU:
https://store.diydrones.com/Full_ArduPi ... apm-02.htm
What do you think about it? I can also take datas out from USB.

Thanks for your patience.
stiv

you posted a broken link, please edit!
Logged

Offline Offline
Edison Member
*
Karma: 9
Posts: 1015
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The bus pirate uses a PIC processor. If you can find the right software and libraries you might try it. But I have no experience with PIC processors at all.

This is the link? : https://store.diydrones.com/Full_ArduPilot_Mega_kit_from_Udrones_p/kt-apm-02.htm
If you buy that you have: absolute pressure sensor (barometer), gyro, accelerometer, GPS.
That's only 4 sensors, for a high price.
If they come with good explanation and libraries, you can have it working in a short time.

I think the TinkerKit system in the Arduino store is cheaper.
You can use a normal Arduino Uno, so things don't get unnecessary complicated.

The accelerometer and gyroscope can be the same thing. I have ordered such a sensor myself, so I'm still not sure how they can distinquish between accelerometer and gyroscope  smiley-confuse
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks
Krodal, you'll be in my degree credits smiley-wink
However I think that I'll use Daisy-7 with BeeBoard or Full_ArduPilot Mega kit, that is more expensive but it is also expandable in a future.
Stiv
Logged

Offline Offline
Edison Member
*
Karma: 9
Posts: 1015
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That Daisy-7 board has a lot onboard!
But the BEE Board is Arduino "Compatible", I don't know how much compatible.

Have you found Sparkfun and Adafruit ?
http://www.sparkfun.com/categories/23
http://www.adafruit.com/category/35

Time to make a choice and go for it. Have fun!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've connected GPS, accelerometer, magnetometer, and temperature sensor  to Arduino.  See http://www.zbotic.com/index.php/download/ for links to the devices and a library.  The Arduino can easily connect those devices and read from them.  You could then send their output to Arduino USB/Serial monitor on a PC, or save the data to an SD card on the Arduino. 

Unfortunately there are a bunch of different types of connectors for sensors and they have Ground, Signal, and +V  on different pins.  I'm pretty careful but I've managed to melt (literally) three sensors by connecting the wrong polarity - by some miracle my Arduino and all the ports are still working.  You should consider www.seeedstudio.com and use their "Grove" devices.  Grove is a standard set of connectors for sensors and Seeedstudio is pretty cheap (although if you're not in Asia, shipping is slow).  Grove is also available from some sites in North Am (and probably Europe).  Personnally I'm not a fan of tinkerkit - they have a smaller number of sensors and their pinout seems the least popular.

You' may want to get an I/O shield (gives you a bunch of connectors for the sensors).  I2C is good for the more complicated sensors since it's a bus and allows complex communications and multiple devices.  For I2C you might want http://www.seeedstudio.com/depot/grove-i2c-hub-p-851.html?cPath=178_191 since it let's you connect multiple I2C devices (using grove connectors). 
Logged

Offline Offline
Edison Member
*
Karma: 9
Posts: 1015
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Just some extra information for who is reading this thread:

There are boards with gyro, accelerometer, magnetometer, and pressure sensor.
They are used in RC plains and helicopters.
The only thing to add is a GPS module.

This one on Ebay: http://www.ebay.nl/itm/Mini-9-DOF-IMU-with-BMP085-Pressure-Sensor-Use-with-Arduino-Pro-Mini-/200735690678?pt=LH_DefaultDomain_0&hash=item2ebcc78fb6

You can find more if you google: [9dof baro*] or search for [10dof]

If just found some boards that has also GPS. Search for: [11dof]
« Last Edit: May 14, 2012, 03:56:13 am by Krodal » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks, I have found something with 11dof, cheap and with all sensors I need.
But I have another question: I have chosen to buy a something like Daisy7 platform/11dof platform (a kit where I have to merge datas) and something that has a owner software (sbg ig 500).
Now I'm thinking that I can use also an odometer, to increase stability of positioning.
If I wanted to install it on a car it should be easy: I can link it to a wheel, counting wheel cycle.
But I have to install this system for trekking: a solution can be a pedometer, but it isn't too accurate.
Another solution is "reading" the ground to calculate distance and velocity, as a mouse of a pc.
There are 2 possibilities:
1) with the same principle of a optical mouse, interpreting the light reflected from the ground
2) with the same principle of a modern optical mouse, interpreting the image captured by the camera, correlating it with the distance traveled
Do you think can it be possible? Does exist already something for this?
Thanks
Stiv
Logged

Pages: [1] 2   Go Up
Jump to: