I have just installed a micro wind turbine at the bottom of my garden.
At the top of the 6m main pole I fitted a accelerometer from a wii nun chuck. This is in a waterproof container which was filled with candle wax to seal it completely.
Last night I connected the accelerometer to a Arduino and got reading that I expected.
Its wired A4 A5 3.3 GND
I then added some code to switch the RGBW 1200 LED beacon which is also at the top of the tower, everything was fine This is a board of transistors that has been tested OK, wired 6,9,10,11
I then added a LM35 on A0 and the code
Uploaded and all was fine, (after i switch the LM35 round the right way? Very hot!)
after it had been running a while i noticed the accelerometer readings where strange
Accel X -21467
Accel Y -27647
Accel Z -16234
Temp 5
Accel X -21465
Accel Y 23555
Accel Z -24749
Temp 5
Accel X -21467
Accel Y -27647
Accel Z -6171
Temp 5
Accel X -21466
Accel Y 23555
Accel Z -28699
Temp 6
Accel X -21465
Accel Y 12291
Accel Z 15383
Temp 6
Accel X -21466
Accel Y 24579
Accel Z 27770
Temp 6
Accel X -21465
Accel Y 24579
Accel Z 27843
Temp 5
Has anyone got any idea what has happened?
If i load just accelerometer code the readings are still wrong -4567, 3, 5678
The readings before where in the -/+ 500 like i would expect
I can't put schematics or photos yet as I am at work, I was just after "it could be......" answers for now
Basic Wii code
/*
* ArduinoNunchuk Demo
*
* Copyright 2011-2012 Gabriel Bianconi, http://www.gabrielbianconi.com/
*
* Project URL: http://www.gabrielbianconi.com/projects/arduinonunchuk/
*
*/
#include <Wire.h>
#include <ArduinoNunchuk.h>
#define BAUDRATE 19200
ArduinoNunchuk nunchuk = ArduinoNunchuk();
void setup()
{
Serial.begin(BAUDRATE);
nunchuk.init();
}
void loop()
{
nunchuk.update();
// Serial.print(nunchuk.analogX, DEC);
// Serial.print(' ');
// Serial.print(nunchuk.analogY, DEC);
// Serial.print(' ');
Serial.print(nunchuk.accelX, DEC);
Serial.print(' ');
Serial.print(nunchuk.accelY, DEC);
Serial.print(' ');
Serial.print(nunchuk.accelZ, DEC);
Serial.print(' ');
// Serial.print(nunchuk.zButton, DEC);
// Serial.print(' ');
// Serial.println(nunchuk.cButton, DEC);
delay(1000);
}
Code with temp and LED
/*
* ArduinoNunchuk Demo
*
* Copyright 2011-2012 Gabriel Bianconi, http://www.gabrielbianconi.com/
*
* Project URL: http://www.gabrielbianconi.com/projects/arduinonunchuk/
*
*/
#include <Wire.h>
#include <ArduinoNunchuk.h>
#define BAUDRATE 19200
ArduinoNunchuk nunchuk = ArduinoNunchuk();
float tempC;
int tempPin = A0;
int Rled = 9;
int Gled = 10;
int Bled = 11;
int Wled = 6;
void setup()
{
Serial.begin(BAUDRATE);
nunchuk.init();
}
void loop()
{
analogWrite (Rled, 10);
delay(100);
analogWrite (Rled, 0);
nunchuk.update();
//Get TEMP Data
tempC = analogRead(tempPin); //read the value from the sensor
tempC = (5.0 * tempC * 100.0)/1024.0; //convert the analog data to temperature
Serial.print("Accel X ");
Serial.println(nunchuk.accelX, DEC);
Serial.print("Accel Y ");
Serial.println(nunchuk.accelY, DEC);
Serial.print("Accel Z ");
Serial.println(nunchuk.accelZ, DEC);
Serial.print("Temp ");
Serial.println((byte)tempC);
analogWrite (Bled, 10);
delay(100);
analogWrite (Bled, 0);
delay(1000);
}
What i really need someone to say that the accelerometer is NOT broken and I do NOT have to climb my DIY 6M tower! ![]()
I will try another Arduino this evening, but any other suggestion would be wonderful.
Thanks in advance