Hardware:
Connect the following pins.
Arduino --- IMU
RX --- TX
TX --- RX
3.3V --- 3.3V
GND --- GND
On the IMU board, CTS (Clear To Send) and DTR (Data Terminal Ready) do not require a connection for Serial. They are used for the FTDI Serial to USB connection.
Software:
On the Arduino Uno - Below is the simplest, baseline code you need to read the output from the IMU using another Arduino (I say another because the IMU contains its own ATMega chip):
When writing new sketches to the Arduino, you'll need to unplug the RX/TX
On the Sparkfun Razor IMU - load the code found on here: https://github.com/ptrbrtz/razor-9dof-ahrs/wiki/Tutorial If you want to change the Serial output of the IMU, modify Output.ino within the Razor_AHRS folder in this conditional:
Hi Ben, I was wondering if you could provide some tips on how to convert the serial data into float or integer types. I would like to use the Razor 9DOF IMU as a sensor connected to Arduino Uno that would trigger an LED to be lighted up. Thanks.
ReplyDeleteHi Nathan, you can use something like an atoi function. Arduino has a version here: https://www.arduino.cc/en/Tutorial/StringToIntExample
DeleteYou can then type cast to the variable type that you'd like. Let me know if that works!
Hey Ben, even I m working on retrieving 9DOF RAZOR SPARKFUN IMU values.
ReplyDeleteI am using Arduino UNO. And i have done the connection just as you mentioned. While uploading the code(Razor_AHRS) on the IMU, i remove the Rx--Tx( UNO---IMU). And then I make the connection again, and open the serial output window. The issue is that I get no values, as in YawPitchRoll(0,0,0)..may be float.(0.0,0.0,0.0)...Please share your insight on it. I am trying to develop a system out of 9DOF IMU..Please help...
Truly appreciate for your time and consideration.
--Sovik
Hi Sovik, maybe check if the indicator LEDs on the IMU are blinking to see if it's indeed sending information. Also check your transmission baud rates to see if your devices are talking at the right frequency. Sorry for the slow response and let me know if that helps!
Deletehai ben, what type of ftdi can we use for these razon imu
ReplyDeleteAnything that converts between serial and USB.
Deletei am using CH340g usb to ttl. circuit break board. but its not working. while upload a program, its just shows uploading.... upload can't be completed.
ReplyDeleteTry swapping out either your board or cable to identify where the fault is occurring.
Deletewhat is the unit for values of three sensors(accele, gyro, magno) inside these imu.
ReplyDeleteI have done exactly the way you said. but the comport isn't showing anything. can you tell me the reason.
ReplyDelete