Go Down

Topic: Single Axis Accelerometer Breakout Board - ADXL193 +/-250g (Read 421 times) previous topic - next topic


I need some help with this sensor. I can't seem to find any sample code and also am not an experienced programmer. If anyone has some sample code for this sensor your help would be appreciated.


Feb 16, 2014, 08:00 pm Last Edit: Feb 16, 2014, 08:31 pm by knut_ny Reason: 1
Sensor output goes to an anlog input.
Read the datasheet..: It says ouput is 8mV/g
Code: [Select]
float a;

void setup()

void loop()
a = (analogRead(A0)-511) * 4.8875855 ; //millivolt
// 5/1023=0,0048875855 V/step
a = a / 8; // 8mV/g
// all calc can be done in one calculation
Serial.println(a,2); // G-value
// shoud be 0 when not moving
// expect small values when 'shaking'


Read datasheet to find if ST shoud be wired hi og low.
Data out to A0 to match example..


Thanks, I am still getting negative values. Im not sure as to why this is happening


small nes is OK .
Change the numer 511 up/down a litte till you get 0 out when still.


thanks it works now. It moves about 1-2 everytime I shake it. Is this expected? thanks for your help.


OK... you mangage to shake it with 2G..
Tap it on the table.. you'll reach 10G+ (if program reads at the right momemt)

This sensor is best used to measure akseleration in rockets at launch..
..or inn collision tests

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131