This was designed as a proof of concept for our tiny lsm303 library. It is based on a Attiny85, 9g servos and our LSM303DLHC breakout board.
Although the accelerometer is not the best solution for a stabilizer due to the data noise induced by the vibration, for this proof of concept (and for some basic applications) it was enough.
This is meant as a cost controlled stabilizer for a frontal mounted camera in our SUGV series the HOUND that we will be showing in future posts.
- Attiny LSM303 Library
- Atmel Attiny85
- 2x Micro Servos
- Power Source (3.3v and 5V)
- Lsm303DLHC breakout
We assume that you have basic knowledge of the arduino IDE and electronics
- Install Tiny LSM303 Library and all dependencies
- If not installed, install Arduino Core in the Attiny85 (good tutorial on how to do it)
- Upload the example sketch TinyStabilizer from the tiny LSM303 Library
- Connect the attiny and the LSM303DLHC as described in the wiring section
- Connect the Servos signal to the attiny if using different power supplies remember to have a common ground
- Power up servos and Attiny
- Move the breadboard to see the servos “compensate” the movement
The data itself from the accelerometer is very noisy, and don’t allow a smooth operation of the servos, so the best way to “clean” this data is to pass a low pass filter with a very low alpha (0.2 in this case)
The different outputs can be seen in the below graphic took with our DT Serial Chart , as you can see the “yellow” line has a much smoother curve in contrast with the raw data from the blue line.
We will soon make a post about how to get the data on the chart with our software.