View Full Version : Wiring The accelorometer
TPekarjr
06-02-2010, 11:08
well funny story, at my robo shop i wired acccelorometers, turns out i wired accelorometers that were a year old and was only 2 axis o.O.... Soo inturn we located the latest accelorometer and its 3 axis.. so i did some homework trying to understand exactly how to wire it but proved to be unseccessful.
can anybody help me with wiring pwm cables to the accelorometer? thank you
Joe Ross
06-02-2010, 11:17
Have you looked at the sensor manual? http://usfirst.org/roboticsprograms/frc/content.aspx?id=452
TPekarjr
06-02-2010, 11:23
yes i have, and i dont quiet understand it. i mean i know the ports... but exactly how, i am a little confused at the moment
Alan Anderson
06-02-2010, 21:22
yes i have, and i dont quiet understand it. i mean i know the ports... but exactly how, i am a little confused at the moment
If you're using LabVIEW, there is an example showing how to use the accelerometer board with its I2C connection. I haven't looked closely at the C++ or Java environments to see what sort of accelerometer examples they have.
The I2C port is found on J2 and was designed to be easily wired to the pins on the Digital Sidecar found directly behind the NXT connector. Connect 5V to 5V, SCL to SCL, SDA to SDA, and (-) to 0V.
Are those directions exact enough, or do you need more information?
TPekarjr
12-02-2010, 18:19
i still quiet don't get it... i read the instructions but still don't understand it... i hate to be a noob but i am wiring it with pwm cable..and using all 3 axis... can someone just tell me what color on the pwm goes to what port on the accelerometer... it would be much appreciated =D
i still quiet don't get it... i read the instructions but still don't understand it... i hate to be a noob but i am wiring it with pwm cable..and using all 3 axis... can someone just tell me what color on the pwm goes to what port on the accelerometer... it would be much appreciated =D
If you're using PWM cable, you'll need to add a fourth wire to use I2C. The number of axes don't matter (for the wiring) and colors don't matter (though it may help to have black wire on 0V and red wire on 5V) - you just need to make sure the wires connect the same pins at each end. That is, the 5V pin on the accelerometer connects to the 5V pin on the digital side car, SDA to SDA, SCL to SCL, and 0V to 0V. Make sure you don't reverse one of the connectors and connect 5V to 0V or vice versa.
Well, that's the trouble.
It's not a PWM cable; it has 4 connections.
5v, GND, SCL, and SDA
You can find the 4-pin header on the digital sidecar, right next to that female RJ-14 (modified phone jack).
However, beware that on the accelerometer, they are in a different order than on the digital sidecar.
You must solder a pigtail or header to the accelerometer.
LinuxArchitect
17-02-2010, 21:19
The other way to wire the accelerometer might be easier if you just have the three wire pwm cables.
The SPI port is found on J4 and was setup to be easily wired to the Digital I/O on the Digital Sidecar. Although the pins can be connected to any GPIOs in any order, it is easiest to use Digital I/O 1-4. Connect 0V and 5V to the (-) and PWR pins that are just beyond Digital I/O 1, and [CK, DI, DO, CS] in order.
Looking at the 8 J4 connections, wire two pwm cables to the bottom 6. Plug the first one into the digital IO port 1 like a normal connection. Plug the second one across the signal pins of ports 2 , 3, and 4. This is slightly different from the doc quoted above which says to use the power pins located just below the port 1 pins. Not sure why it would matter.
Then go run the ADXL345 SPI Accelerometer example program and verify that you have everything wired correctly. It seemed to work for us today.
Just a note, but keep in mind that this is a digital accelerometer and not an analog accelerometer. Years before they have given us analog ones the digital ones are a little more interesting to wire.
We are using last year's 3-axis analog accelerometer for ease of use.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.