Go Down

Topic: ADXL193 Accelerometer Assistance Needed! (Read 4 times) previous topic - next topic

MR_91



That depends on what the project is for. If the project to read the accelerometer IS part of your course work, then paying someone else to write the code is cheating, and we don't support that.

If the project to read the accelerometer data is a personal project that has nothing to do with school then post in Gigs and Collaboration to hire someone.


Ok, thanks for clearing that up. My project is to design and construct a new take on a folding Cycling helmet. Testing the impact resistance is one on many factors. I guess paying for code is like paying for a 3D printed part for a concept though - which is fine.

Thanks

MR_91

Hello,

I have a 3rd year Product Design University project that requires the use of a 250g accelerometer for helmet testing.

I have the following kit:
Arduino UNO board
ADXL193 Accelerometer
Breadboard
Jumpers

I need a code and any other supporting scripts to allow me to visually see the G-force the accelerometer is subjected to.

I am open to payment suggestions and I will pay via Paypal.

I look forward to hearing from you!

Thanks
Mike


JD3

Try this code out - it constantly checks for minimum and maximum recoil.
But it only displays once every second.  The more you display the smaller your sample rate becomes.
If the sample rate is too slow, you will miss the recoil event.

Code: [Select]
/*
Recoil Viewer designed by AB9VH Electronics, James Douglas III - 2012
Sparkfun ADXL193 single axis accelerometer, 5v reference

X axis analog pin 0
Ground, black wire
+5v, red wire  (Vin: voltage input 5v)

ZERO G = 508  (calibration data)
*/

int X = 0;                          // fresh data from accelerometer
int Xmax = 508;                     // maximim recoil data
int Xmin = 508;                     // minimum recoil data
int R = 0;                          // recoil reading in g force
unsigned long time = 0;             // time in millis of recoil event

void setup() {
  Serial.begin(9600);            // opens serial port for LCD shield
  Serial.println("Recoil Viewer by AB9VH Electronics");
  Serial.println();
  time = millis();               // time of recoil event
}

void loop() {
  X = analogRead(0);             // read analog input
  if (X < Xmin) Xmin = X;
  if (X > Xmax) Xmax = X;
  if (millis()-time >= 1000) {      // display every one second
    time = millis();               // time of recoil event 
    R = (Xmin-508)*.5;              // calculate maximum recoil
    Serial.print("Min recoil = ");
    Serial.print(R);
    Serial.print("g     ");
    R = (Xmax-508)*.5;              // calculate minimum recoil
    Serial.print("Max recoil = ");
    Serial.print(R);
    Serial.println("g");
  }
}

That little black caterpillar you just stepped on will set you back a few bucks....

MR_91

I was not aware I crossposted, to be honest. This thread is asking for code for payment. This section of the forum was suggested to me by another forum user - I did not ask for a new code in that thread, as far as I'm concerned, I got my answer out of that thread.

If it needs to be merged, so be it, I had no intension of violating any forum rules. It's the last thing I want to do in my time of need.

Nick Gammon


Go Up