ELECT 30: Acceleròmetre de tres eixos
Acceleròmetre MMA7260QT
Tinc aquest acceleròmetre (MMA7260QT):
Description: This is a breakout board for Freescale's triple-axis MMA7260QT accelerometer. With a low power shut-down mode, high sensitivity output with selectable ranges (�1.5, 2, 4, and 6g), this was one of the very first sensors to market with three accelerometers built onto a single IC! Board comes fully assembled and tested with external filters installed. The MMA7260QT is a 3.3V part and outputs an analog voltage for each of the three outputs. This voltage is in ratio to the measured acceleration and to the supply voltage (ratiometric). You will need some extra hardware to convert this analog signal to a usable digital one. Luckily, many uCs have a built in Analog to Digital converter.
- http://itp.nyu.edu/physcomp/sensors/Reports/MMA7260Q (Tom Igoe tutorial)
The MMA7260Q operates on 2.2-3.6VDC, and uses very little current (500uA). It has three analog outputs, one for each axis. Acceleration on each axis generates a voltage from 0 to approximately 3.3V.
When there's no acceleration on a given axis, the output for that axis outputs half the supply voltage, or about 1.65V. With acceleration in a positive direction along the axis, the output voltage for that axis rises. With negative acceleration along the axis, the voltage goes down. In other words:
* at rest the voltage is in the middle; * at full forward acceleration, the voltage is at its highest; * at full backward acceleration, the voltage is at its lowest.
Pins:
1. Vcc - Voltage, 3.3VParts list:
* MMA7260Q accelerometer on Sparkfun breakout board
* MIC29150-3.3BT 3.3V voltage regulator
* 2 - 10Kohm 0.25-watt resistors
* 2 - 1N5226B-T 3.3V zener diodes
2. GND - Ground
3. X - X axis output, 0 - 3.3V
4. Y - Y axis output, 0 - 3.3V
5. Z - Z axis output, 0 - 3.3V
6. GS1 - G-select 1
7. GS2 - G-select 2
8. SLP - sleep
La sensibilitat es pot programar:
GS1 GS2 G-range Sensitivity GND GND 1.5g 800mV/g GND 3.3V 2g 600mV/g 3.3V GND 4g 300mV/g 3.3V 3.3V 6g 200mV/g
In the schematic below, the accelerometer is connected to a PIC microcontroller running on 5V, so a 3.3V zener diode and 10Kohm resistor were added to the GS1 and GS2 pins to limit the incoming voltage to 3.3V.
En el meu cas igual. El arduino opera a 5V, i amb els diodes Zener puc aplicar 3.3V a l'acceleròmetre. Per l'aplicació que vull, crec que la sensibilitat de 1,5g serà suficient, i per tant GS1=GS2=GND.
Parts list:
* MMA7260Q accelerometer on Sparkfun breakout board
* MIC29150-3.3BT 3.3V voltage regulator
* 2 - 10Kohm 0.25-watt resistors
* 2 - 1N5226B-T 3.3V zener diodes
S'utilitza un regulador de tensió de 3.3V per alimentar l'acceleròmetre.
En el fòrum de l'arduino algú utilitza aquest xip:
- http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1256257137/4
- http://www.arduino.cc/en/Tutorial/ADXL3xx
NOTA: aquest acceleròmetre treballa a 3.3V, i mirant el datasheet, el màxim voltage supply que accepta és 3,6V. Per tant, seria una mala idea alimentar-lo a 5V.
Efectes de llum amb LEDs RGB
Per fer funcionar un LED RGB, està explicat a ELECT_28:_Balança_basada_amb_Arduino
He de poder fer efectes de llum multicolors amb 6 LEDs RGB.
- http://www.arduino.cc/playground/uploads/Learning/multiple_leds2.jpg
- http://pixelriot.com/pmatp/node/15
- http://labs.ideo.com/2010/03/10/animation-of-multiple-leds-with-arduino/
Valors típics per a un LED 0,06W 20 mA 1.2 V caiguda entre terminals
els pins de l'arduino poden fer 40 mA (o altres valors):
You can sink 60mA at 25C and get down to a voltage of 1.5v. That means sinking current you will not get the full 5v across the load but 5 - 1.5 = 3.5v Sinking 40mA gets you down to under 1V on the output where as 20mA gets the output voltage down to 0.5v
LED RGB a Sparkfun (el que tinc jo és de Diotronic. Serà igual?):
Una opció és utilitzar LED Drivers:
- LTC3220/LTC3220-1 - 360mA Universal 18-Channel LED Driver
- 4051
- Texas Instruments 5940
Potser la millor solució:
El Arduino (Diecimilia) té 6 sortides PWM (són pins digitals amb sortida PWM). Jo tinc 6 LEDs RGB. Es tractaria de fer tres grups de 2 LEDs, i només utilitzar dues de les potes: el 1r grup RG; 2n grup RB; 3r grup GB. Agrupar dos LEDs reduirà la lluminositat (fer la prova), però l'efecte s'haurà de veure clar. Encara que no utilitzi les tres potes, l'efecte de llums serà suficient.
creat per Joan Quintana Compte, abril 2010