Hi guys, I plan to do project use accelerometer sensor + arduino uno to control 6 servos. My plan is when my head tilt forward/backward, the sensor + arduino will move 2 servos at the same time. Then they will move 2 other servos . And when my head looks to the left/right, the sensor + arduino will move 1 servo.
The problems are:
I don't know which accelerometer/sensor I should use. I should use 1 sensor for all or 1 sensor for backward/forward and 1 for left/right?
Are the sensor+arduino capable to control to 2 servos at the same time? If not, can I use 1 sensor and send info to 2 separate arduino then each arduino control 1 servo at one time?
Waiting for answers or any suggestion. Thanks you guys,
Question 1:
You should be looking for a 3 axis accelerometer. Since you are only using one to measure tilt. You dont need to get a more expensive, high precision/high load accelerometer. A small simple accelerometer should suffice.
(eg. this simple one is 5 bucks Fermion: BMA220 Digital Triaxial Acceleration Sensor (Breakout) - DFRobot, tho you could spend as much money as you want on a higher precision sensor, its up to you.)
Question 2:
You are in luck, because arduino Uno's have 6PWM pins, which means they cant directly control up to 6 servos independently without any modifications, at the same time. These pins are denoted by the ~ sign next to the output pin numbers. If the sensor you use sends information via I2C, then the arduino will read the sensor using the A4 and A5 analogue pins.
The accelerometer measures acceleration, and gravity will be measured as an acceleration towards the ground.
A 3 axis accelerometer will measure acceleration in 3 dimensions (imagine an x,y,z plane) and when the accelerometer is not moving, the measured (x,y,z) values will always give you to a vector pointing towards the ground. (if your accelerometer is upright, you will measure a vector pointing straight down. If it is upside down, you will measure a vector pointing straight up.)
Using mathematics, you will be able to use this information to calculate orientation and measure tilt.
Question 1:
You should be looking for a 3 axis accelerometer. Since you are only using one to measure tilt. You dont need to get a more expensive, high precision/high load accelerometer. A small simple accelerometer should suffice.
(eg. this simple one is 5 bucks http://www.dfrobot.com/index.php?route=product/product&product_id=1085, tho you could spend as much money as you want on a higher precision sensor, its up to you.)
Question 2:
You are in luck, because arduino Uno's have 6PWM pins, which means they cant directly control up to 6 servos independently without any modifications, at the same time. These pins are denoted by the ~ sign next to the output pin numbers. If the sensor you use sends information via I2C, then the arduino will read the sensor using the A4 and A5 analogue pins.
The accelerometer measures acceleration, and gravity will be measured as an acceleration towards the ground.
A 3 axis accelerometer will measure acceleration in 3 dimensions (imagine an x,y,z plane) and when the accelerometer is not moving, the measured (x,y,z) values will always give you to a vector pointing towards the ground. (if your accelerometer is upright, you will measure a vector pointing straight down. If it is upside down, you will measure a vector pointing straight up.)
Using mathematics, you will be able to use this information to calculate orientation and measure tilt.
Question 1:
You should be looking for a 3 axis accelerometer. Since you are only using one to measure tilt. You dont need to get a more expensive, high precision/high load accelerometer. A small simple accelerometer should suffice.
StefL
From what I learned, accelerometer + gryo sensors may be better for orientation sensing. I recently purchased a MPU9150 device which has 3-axis accelerometer, 3-axis gyro and 3-axis compass and has adjustable sensitivity range. I still haven't figure out how to use it properly yet. The maths for calculating tilt is more complex than I expected.
theinlinaung2010:
From what I learned, accelerometer + gryo sensors may be better for orientation sensing. I recently purchased a MPU9150 device which has 3-axis accelerometer, 3-axis gyro and 3-axis compass and has adjustable sensitivity range. I still haven't figure out how to use it properly yet. The maths for calculating tilt is more complex than I expected.