Go Down

Topic: beginner question about connecting two components.. (Read 537 times) previous topic - next topic

uztnus

I think this is a bit of a beginners question, but im totally stuck with it at the moment.

Im trying to find a way of connecting the sparkfun atomic imu (http://www.sparkfun.com/products/9184) with my arduino uno board.

firstly is it possible? as i know the uno has two serial ports, the first for the usb and the one free i think?

and secondly how would i go about doing it so i can actually print the sensor positions to the screen.

I understand how to do that for accelerometers where you connect the x,y,z to analog inputs.. but the atomic IMU doesn't seem to have these.. so im pretty stumped on how to do it as the data sheet isn't that helpful with me being new to electronics.

Thanks for your help


johansson_81

To my knowledge, the Uno (i.e., the Atmega 328 chip) has only on serial port, and that is used to USB-communicate with the PC.

However, you can use those pins to communicate with an external device (such as Xbee, etc.), if/when you are not using USB communication with your PC.

The other, very useful, option is to use SoftwareSerial/NewSoftwareSerial, which allows you to use other I/O pins on your Arduino for Serial communication:
http://arduiniana.org/libraries/newsoftserial/

James C4S

Quote
firstly is it possible? as i know the uno has two serial ports, the first for the usb and the one free i think?

No.  The only hardware serial port is connected to a serial-to-usb converter.  The Mega variants do have multiple hardware serial ports.

NewSoftSerial probably won't help.  I think it maxes out at 56kps and this board is running 115kps.

Quote
I understand how to do that for accelerometers where you connect the x,y,z to analog inputs.. but the atomic IMU doesn't seem to have these..

No, this board has an onboard processor to process the analog data coming from the sensors.  If you use a FTDI-breakout board you can just hook this breakout board directly to your PC and see the values printed.
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

johansson_81


NewSoftSerial probably won't help.  I think it maxes out at 56kps and this board is running 115kps.


Good point James. Although this page does mention success with 115 kps, so I would give it a try:
http://arduiniana.org/libraries/newsoftserial/

uztnus

ah i had wondered as the Uno just has inputs labelled Tx and Rx also. but i'd been told it wouldnt work.

For reading in data, i've purchased the ftdi break out (waiting on shipping) and some headers to connect it and read outputs, and upload the starter code.

what im wondering though, is how (provided i go and buy the mega with more serial ports) to connect it to the mega to use those values on the fly.

(im trying integrate the two systems to make a type of autonomous vehicle). rather than just view the values to a laptop, can i use the Tx and Rx ports on both chips? or is there more too it, as it was said it has its own chip to read values etc.

thanks again!

Graynomad

Quote
the Uno just has inputs labelled Tx and Rx also

It does but they are also connected to the USB chip and this usually causes problems.

Quote
to connect it to the mega

The Mega has inputs labeled TX1,2,3 and RX1,2,3, just pick a matching pair (say 1) and

Serial1.begin(115200)
Serial1.available() etc etc

Quote
to connect it to the mega to use those values on the fly

Don't know what this means. What is "it".

Quote
on both chips?

What's the second chip? If you mean the IMU then yes, just connect IMU Tx to the Mega RXn and IMU Rx to Mega Txn.

______
Rob




 
Rob Gray aka the GRAYnomad www.robgray.com

MarkT

Do note that the IMU is running at 3.3V, not 5V.
[ I won't respond to messages, use the forum please ]

uztnus

thanks again all for your help,

im trying to design an underwater vehicle with zero experience in arduino.. so it's going to be tough.

in regards to the atomic IMU being 3.3v, does that simply mean to power it, i have to bring the voltage down to 3.3v?

Or does it mean aswell as that, i have to boost the output through the Tx port as that is  also 3.3v compared to ardunio's 5v HIGH?

sorry if that doesn't make sense, i'm just not sure if the Tx outputs as voltages etc, as i've never touched the Tx,Rx ports in my UNO obviously as i've found out it doesn't have them.

thanks.

Graynomad

The 3.3v TX output from the IMU will "probably" work if fed directly to the AVR RX input. (anything over 2.5-3v should be seen as a logic high)

The IMU may have "5v tolerant" inputs, if so you can feed the AVR TX directly to the IMU RX. (check the data sheet)

If not you can use two resistors as a voltage divider to reduce the AVR 5v to 3.3.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Go Up