Reports.H48C History

Hide minor edits - Show changes to output

Changed lines 5-7 from:
%rframe% http://itp.nyu.edu/~es1629/h48.jpg
to:
Attach:HitachiH48C3.jpg
Changed line 40 from:
Attach:HitachiH48C3
to:
Attach:HitachiH48C3_sch.jpg
Changed line 38 from:
%rframe% http://itp.nyu.edu/~es1629/pindescription.jpg\\\
to:
Attach:HitachiH48C3
Changed line 40 from:
'''How it Works\\\'''
to:
'''How it Works'''\\\
Changed line 67 from:
'''Application Notes\\\'''
to:
'''Application Notes'''\\\
Changed lines 11-12 from:
Applications
to:
'''Applications'''
Changed line 20 from:
Features:
to:
'''Features:'''
Changed line 40 from:
How it Works\\\
to:
'''How it Works\\\'''
Changed line 67 from:
Application Notes\\\
to:
'''Application Notes\\\'''
Changed lines 2-3 from:
Edited by Merche Blasco, 1 March 2012
to:
Edited by Merche Blasco, 1 March 2012\\\
Changed line 69 from:
I am using the Hitachi H48C 3-Axis Accelerometer to do a sonic interpretation of the asymmetry of the arm swing magnitude during gait. Therefore I am attaching one accelerometer to each of my wrists and measuring the angle as the excursion of the wrist with respect to the pelvis. The DATA is sent to MAX/MSP via SerialPort and from there is translated into MIDI DATA sent to Ableton Live.
to:
I am using the Hitachi H48C 3-Axis Accelerometer to do a sonic interpretation of the asymmetry of the arm swing magnitude during gait. Therefore I am attaching one accelerometer to each of my wrists and measuring the angle as the excursion of the wrist with respect to the pelvis. The DATA is sent to MAX/MSP via SerialPort and from there is translated into MIDI DATA sent to Ableton Live.
Changed lines 53-59 from:
1/ CLK>> PIN 10 arduino
2 /DIO >> PIN 11 arduino
3 >> Ground
4>>
5 / CS>> PIN 9 arduino
6>> 5V arduino
to:
1/ CLK>> PIN 10 arduino \\\
2
/DIO >> PIN 11 arduino \\\
3
>> Ground \\\
4>>
\\\
5 /
CS>> PIN 9 arduino \\\
6>>
5V arduino
Changed lines 62-63 from:
http://arduino.cc/playground/Main/ParallaxH48C
to:
[[http://arduino.cc/playground/Main/ParallaxH48C]]
Deleted line 69:
Changed lines 13-17 from:
Tilt measurement in robotics applications
Multi-axis vibration measurement in transit and shipping systems
Multi-axis movement/lack-of-movement for alarm systems
to:
* Tilt measurement in robotics applications
* Multi-axis vibration measurement in transit and shipping systems
* Multi-axis movement/lack-of-movement for alarm systems
Added lines 49-69:

For my test I was interested on reading the values collected form the three different axis and I used a small breadboard and arduino UNO connected like this:


1/ CLK>> PIN 10 arduino
2 /DIO >> PIN 11 arduino
3 >> Ground
4>>
5 / CS>> PIN 9 arduino
6>> 5V arduino

I took the code from kiilo for ARDUINO in this link:

http://arduino.cc/playground/Main/ParallaxH48C

and the values for three axes oscillated between -500 and 500.


Application Notes\\\

I am using the Hitachi H48C 3-Axis Accelerometer to do a sonic interpretation of the asymmetry of the arm swing magnitude during gait. Therefore I am attaching one accelerometer to each of my wrists and measuring the angle as the excursion of the wrist with respect to the pelvis. The DATA is sent to MAX/MSP via SerialPort and from there is translated into MIDI DATA sent to Ableton Live.
Changed lines 2-3 from:
to:
Edited by Merche Blasco, 1 March 2012
Added lines 6-16:
Currently the sensor is no longer available for single purchase in Parallax, but it is included in the Sensor Sampler kit:

http://www.parallax.com/tabid/768/ProductID/468/Default.aspx


Applications

Tilt measurement in robotics applications
Multi-axis vibration measurement in transit and shipping systems
Multi-axis movement/lack-of-movement for alarm systems
Changed lines 24-25 from:
(6) Vdd +5V\\
to:
(6) Vdd +5V\\\
Changed line 28 from:
How it Works
to:
How it Works\\\
Changed lines 26-27 from:
%rframe% http://itp.nyu.edu/~es1629/pindescription.jpg
to:
%rframe% http://itp.nyu.edu/~es1629/pindescription.jpg\\\
Changed lines 34-35 from:
Here 4095 is the maximum output count from ADC channel. 3.3 is the H48C supply voltage, and 0.3663 is the H48C output voltage for 1g(when operating at 3.3)
to:
Here 4095 is the maximum output count from ADC channel. 3.3 is the H48C supply voltage, and 0.3663 is the H48C output voltage for 1g(when operating at 3.3)\\\

The only thing that I don't understand is that what is the vRef. I understand that it is the reference but how do we tell the sensor to give me the reference voltage and the axis voltage. Datasheet doesn't say what message to send to get vRef.
Changed line 11 from:
* Supply Voltage of +2.2V to 3.6V
to:
* Supply Voltage of +4.5V to 5.5V
Changed line 23 from:
(5) CS\ Chip select input; active-low (Stand-by selection?)\\
to:
(5) CS\ Chip select input; active-low \\
Changed lines 28-29 from:
to:
How it Works
H48C provides voltage output to the built in ADC on the module. With Pics this data can be read with SHIFTOUT or in Arduino with PulseIn command.
To convert that voltage value to gravitational force we can use following formula.\\\

G=((axis-vRef)/4095)x 3.3/ 0.3663)\\\

Here 4095 is the maximum output count from ADC channel. 3.3 is the H48C supply voltage, and 0.3663 is the H48C output voltage for 1g(when operating at 3.3)
Changed lines 15-18 from:
* "Free Fall Detection" : Sends the pulse simultaneous 0g on all axes.\\\
* Has standby mode

The table for the pin description is pretty straight forward. \\
to:
* "Free Fall Detection" : Sends the pulse simultaneous 0g on all axes.
* Has standby mode\\\

The table for the pin description is pretty straight forward. \\\
Changed lines 18-25 from:
The table for the pin description is pretty straight forward.
(1) CLK Synchronous clock input
(2) DIO Bi-directional data to/from host
(3) Vss ground
(4) Zero-G "Free-fall" output; active-high
(5) CS\ Chip select input; active-low (Stand-by selection?)
(6) Vdd +5V
to:
The table for the pin description is pretty straight forward. \\
(1) CLK Synchronous clock input\\
(2) DIO Bi-directional data to/from host\\
(3) Vss ground\\
(4) Zero-G "Free-fall" output; active-high\\
(5) CS\ Chip select input; active-low (Stand-by selection?)\\
(6) Vdd +5V\\
Changed lines 19-25 from:
to:
(1) CLK Synchronous clock input
(2) DIO Bi-directional data to/from host
(3) Vss ground
(4) Zero-G "Free-fall" output; active-high
(5) CS\ Chip select input; active-low (Stand-by selection?)
(6) Vdd +5V
Changed lines 27-29 from:
%rframe% http://itp.nyu.edu/~es1629/h48_2.jpg
to:
Changed lines 6-7 from:
The datasheet is found [[http://www.parallax.com/dl/docs/prod/acc/H48CDatasheet.pdf |here]] ,but actually Parallax has a great [[http://www.parallax.com/dl/docs/prod/acc/HitachiH48C3AxisAccelerometer.pdf|documentation]] on it.
to:
The datasheet for H48C is found [[http://www.parallax.com/dl/docs/prod/acc/H48CDatasheet.pdf |here]] and the documentation for the Parallax module is [[http://www.parallax.com/dl/docs/prod/acc/HitachiH48C3AxisAccelerometer.pdf|here]] .
Changed lines 16-17 from:
to:
* Has standby mode
Changed lines 15-16 from:
* "Free Fall Detection" : Sends the pulse simultaneous 0g on all axes.
to:
* "Free Fall Detection" : Sends the pulse simultaneous 0g on all axes.\\\
Changed line 18 from:
\\\
to:
Changed lines 14-15 from:
* ""bold"" "Free Fall Detection"""bold"" : Sends the pulse simultaneous 0g on all axes.
to:
* Built -in temperature sensor. Module operation range -25 to 75 d. Celcius
* "Free Fall Detection
" : Sends the pulse simultaneous 0g on all axes.
Changed lines 14-15 from:
* ""bold"""Free Fall Detection" : Sends the pulse simultaneous 0g on all axes.
to:
* ""bold"" "Free Fall Detection"""bold"" : Sends the pulse simultaneous 0g on all axes.
Changed lines 14-15 from:
to:
* ""bold"""Free Fall Detection" : Sends the pulse simultaneous 0g on all axes.

The table for the pin description is pretty straight forward.
Changed line 17 from:
%rframe% http://itp.nyu.edu/~es1629pindescription.jpg
to:
%rframe% http://itp.nyu.edu/~es1629/pindescription.jpg
Changed lines 1-2 from:
Report by evrim, 14 February,2007
to:
Report by evrim, 14 February,2007\\\
Added lines 15-17:

\\\
%rframe% http://itp.nyu.edu/~es1629pindescription.jpg
Changed lines 6-64 from:
Accelerometers are simple MEMS (Microelectromechanical System) devices and are used to measure position, motion, tilt, shock, vibration, and acceleration (the rate of change of velocity). They are available with one, two, or three axes.

!!!Applications

Accelerometers are used everywhere. In transportation, they are used in aircraft stability and control systems, missile guidance systems, and testing the smoothness of paved roads. Domestically, they are being added to washing machines that can balance loads, leading to faster drying times. Accelerometers are also being included in car alarms to detect if the car is being towed away. They are also used in user interface devices, most notably in cell phones and video game controllers, where the user rotates the device to control the screen instead of pushing buttons.

For fun, [[http://web.media.mit.edu/~nvawter/projects/smoothride/index.html| here is a project]] by a MediaLab student, measuring the roughness of Cambridge roads on his bike ride home.

!!!Datasheets

Sparkfun gave a spare [[http://www.sparkfun.com/datasheets/Sensors/ADXL-E8-Breakout.pdf|schematic]] of how they hooked up the pins of the ADXL202E to their breakout board. Paired with the thoroughly detailed Analog Devices [[http://www.sparkfun.com/datasheets/ADXL/ADXL202E_a.pdf|datasheet]], I had all the information I needed to hook up the board and spit out data.

!!!Electrical Characteristics and Pin Descriptions

http://itp.nyu.edu/~gak217/fall05/sensor/final/sparkfun.jpg

The Sparkfun breakout board for the ADXL202 has two analog outputs (volts) and two digital outputs (digital pulses), two for the x axis and two for the y axis. On the Sparkfun breakout board, the analog output pins are labeled as "XA" and "YA" (X and Y Analog on the sheet) and the digital output pins are labeled "XP" and "YP" (X and Y PWM on the sheet). If you used the accelerometer with a 3.3 power source, as I did, the analog pins output a minimum of 1.2V and a maximum of 1.8V and the digital output pins send a minimum of 31% and a maximum of 69% duty cycle. At rest, the analog output pins send 1.5V and the digital pulse out pins send out 50% duty cycle.

I tried using both types of output to my pic and they both gave out steady values.

Other than the 4 output pins, there are 3 additional pins on the ADXL202: VCC, GND, and ST. ST stood out right away when I first started reading the datasheet and after a bit of research, I found out that the "self test" pin is activated when sent a logical 1. This causes the chip to apply a deflection voltage to the inner structure of the accelerometer. It will send out -5g of force. By measuring this output, the user can verify that the accelerometer is working. In practice, this means that if you connect the "ST" pin to power, and you notice that the output values drastically decrease, your accelerometer is okay.

!!!A Bit More About the ADXL202


On a micro level, The ADXL202 uses moveable polysilicon masses to detect various movements. Any movement drives the mass out of phase with the plates that surround it, inciting the differential capacitor formed between them to produce a square wave whose amplitude is proportional to acceleration.

http://itp.nyu.edu/~gak217/fall05/sensor/final/acc_graphic1.jpg

http://itp.nyu.edu/~gak217/fall05/sensor/final/acc_graphic2.gif

''Images from Microchip.com''

--What is a duty cycle?

A duty cycle describes an output pulse, measured in percentage. The percentage indicates what percent of the output cycle is high. When it detects forward acceleration (above 0g), it outputs a duty cycle above 50%. When it detects backwards acceleration (below 0g), it outputs a duty cycle below 50%.

!!!Microcontroller Connections

I connected the ADXL202 with a PIC 18F252 and powered it with a 3.3 voltage regulator. Here is how I did it:

http://itp.nyu.edu/~gak217/fall05/sensor/final/hookup.jpg

!!!Code Sample


I'm planning on using the accelerometer in a wearables project. In brief, the accelerometer (sewn into the hem of a skirt) will detect when its wearer sping. As the wearer spins faster, more lights on the skirt will illuminate. To visualize this, I made a processing application.

[[Code.ADXL202Pic | Pic Code]]

[[Code.ADXL202Processing | Processing Code]]

Note that in this version of the code, I used the PWM pins on the accelerometer instead of the analog pins. It is very important that you don't have both sets of pins hooked to the microcontroller at the same time, or else you won't get any output.

Also, note in the Processing code that there is a delay set in the function "processByte" before the code sends an A out to the pic to let it know that it's ready for more data. Otherwise, Processing will not receive any data. My theory is that the pic is a bit slow in spitting out data from the accelerometer, so if Processing sends an A out right away, the pic won't be ready. I could be wrong, though.

!!!Application Notes

I was able to get steady, consistent values out of the accelerometer. It can easily be used to detect tilt or acceleration. My project, however, might need to detect BOTH tilt and acceleration at the same time. If I wanted to restrict the reaction of the lights to a spinning motion, I would need to make sure that the hem was tilting AND accelerating in a negative or positive direction. Therefore, in addition to sensing tilt along the Y-axis (which I have already done in my code samples), I will also need to sense acceleration along the X-axis. Testing this will be a bit tricky. Right now, I'm envisioning taping a breadboard attached to a REALLY LONG serial cable to my skirt and spinning around in the pcomp lab. Recommendations for alternative procedures are welcome.
to:
The datasheet is found [[http://www.parallax.com/dl/docs/prod/acc/H48CDatasheet.pdf |here]] ,but actually Parallax has a great [[http://www.parallax.com/dl/docs/prod/acc/HitachiH48C3AxisAccelerometer.pdf|documentation]] on it.

Features:
* Measures 3g on three axes simultaneously.
* For most app.s doesn't need calibration due to "compensation IC".
* Supply Voltage of +2.2V to 3.6V
* detects static tilt as well as movement.
* Small and breadboard friendly(YAY!): 0.7" x 0.8"

%rframe% http://itp.nyu.edu/~es1629/h48_2.jpg
Changed lines 1-64 from:
'''Strong'''HITACHI H48C
to:
Report by evrim, 14 February,2007

The Hitachi H48C Tri-Axis Accelerometer is an integrated module that can sense gravitational (g) force of 3g on three axes (X, Y, and Z). It is made by Hitachi Metals and available through [[http://www.parallax.com | Parallax.com]] They sell if for $39.95
%rframe% http://itp.nyu.edu/~es1629/h48.jpg

Accelerometers are simple MEMS (Microelectromechanical System) devices and are used to measure position, motion, tilt, shock, vibration, and acceleration (the rate of change of velocity). They are available with one, two, or three axes.

!!!Applications

Accelerometers are used everywhere. In transportation, they are used in aircraft stability and control systems, missile guidance systems, and testing the smoothness of paved roads. Domestically, they are being added to washing machines that can balance loads, leading to faster drying times. Accelerometers are also being included in car alarms to detect if the car is being towed away. They are also used in user interface devices, most notably in cell phones and video game controllers, where the user rotates the device to control the screen instead of pushing buttons.

For fun, [[http://web.media.mit.edu/~nvawter/projects/smoothride/index.html| here is a project]] by a MediaLab student, measuring the roughness of Cambridge roads on his bike ride home.

!!!Datasheets

Sparkfun gave a spare [[http://www.sparkfun.com/datasheets/Sensors/ADXL-E8-Breakout.pdf|schematic]] of how they hooked up the pins of the ADXL202E to their breakout board. Paired with the thoroughly detailed Analog Devices [[http://www.sparkfun.com/datasheets/ADXL/ADXL202E_a.pdf|datasheet]], I had all the information I needed to hook up the board and spit out data.

!!!Electrical Characteristics and Pin Descriptions

http://itp.nyu.edu/~gak217/fall05/sensor/final/sparkfun.jpg

The Sparkfun breakout board for the ADXL202 has two analog outputs (volts) and two digital outputs (digital pulses), two for the x axis and two for the y axis. On the Sparkfun breakout board, the analog output pins are labeled as "XA" and "YA" (X and Y Analog on the sheet) and the digital output pins are labeled "XP" and "YP" (X and Y PWM on the sheet). If you used the accelerometer with a 3.3 power source, as I did, the analog pins output a minimum of 1.2V and a maximum of 1.8V and the digital output pins send a minimum of 31% and a maximum of 69% duty cycle. At rest, the analog output pins send 1.5V and the digital pulse out pins send out 50% duty cycle.

I tried using both types of output to my pic and they both gave out steady values.

Other than the 4 output pins, there are 3 additional pins on the ADXL202: VCC, GND, and ST. ST stood out right away when I first started reading the datasheet and after a bit of research, I found out that the "self test" pin is activated when sent a logical 1. This causes the chip to apply a deflection voltage to the inner structure of the accelerometer. It will send out -5g of force. By measuring this output, the user can verify that the accelerometer is working. In practice, this means that if you connect the "ST" pin to power, and you notice that the output values drastically decrease, your accelerometer is okay.

!!!A Bit More About the ADXL202


On a micro level, The ADXL202 uses moveable polysilicon masses to detect various movements. Any movement drives the mass out of phase with the plates that surround it, inciting the differential capacitor formed between them to produce a square wave whose amplitude is proportional to acceleration.

http://itp.nyu.edu/~gak217/fall05/sensor/final/acc_graphic1.jpg

http://itp.nyu.edu/~gak217/fall05/sensor/final/acc_graphic2.gif

''Images from Microchip.com''

--What is a duty cycle?

A duty cycle describes an output pulse, measured in percentage. The percentage indicates what percent of the output cycle is high. When it detects forward acceleration (above 0g), it outputs a duty cycle above 50%. When it detects backwards acceleration (below 0g), it outputs a duty cycle below 50%.

!!!Microcontroller Connections

I connected the ADXL202 with a PIC 18F252 and powered it with a 3.3 voltage regulator. Here is how I did it:

http://itp.nyu.edu/~gak217/fall05/sensor/final/hookup.jpg

!!!Code Sample


I'm planning on using the accelerometer in a wearables project. In brief, the accelerometer (sewn into the hem of a skirt) will detect when its wearer sping. As the wearer spins faster, more lights on the skirt will illuminate. To visualize this, I made a processing application.

[[Code.ADXL202Pic | Pic Code]]

[[Code.ADXL202Processing | Processing Code]]

Note that in this version of the code, I used the PWM pins on the accelerometer instead of the analog pins. It is very important that you don't have both sets of pins hooked to the microcontroller at the same time, or else you won't get any output.

Also, note in the Processing code that there is a delay set in the function "processByte" before the code sends an A out to the pic to let it know that it's ready for more data. Otherwise, Processing will not receive any data. My theory is that the pic is a bit slow in spitting out data from the accelerometer, so if Processing sends an A out right away, the pic won't be ready. I could be wrong, though.

!!!Application Notes

I was able to get steady, consistent values out of the accelerometer. It can easily be used to detect tilt or acceleration. My project, however, might need to detect BOTH tilt and acceleration at the same time. If I wanted to restrict the reaction of the lights to a spinning motion, I would need to make sure that the hem was tilting AND accelerating in a negative or positive direction. Therefore, in addition to sensing tilt along the Y-axis (which I have already done in my code samples), I will also need to sense acceleration along the X-axis. Testing this will be a bit tricky. Right now, I'm envisioning taping a breadboard attached to a REALLY LONG serial cable to my skirt and spinning around in the pcomp lab. Recommendations for alternative procedures are welcome.
Added line 1:
'''Strong'''HITACHI H48C