Hitachi H48 C3 Axis Accelerometer
Hitachi H48 C3 Axis Accelerometer
Hitachi H48 C3 Axis Accelerometer
Features
• Measure ±3 g on any axis
• Uses MEMS (Micro Electro-Mechanical System) technology, with compensation for calibration-free
operation
• Onboard regulator and high-resolution ADC for simple connection to microcontroller host
- compatible with BASIC Stamp 2 series SHIFTOUT and SHIFTIN commands
• Free-fall output indicates simultaneous 0g an all axes
• Small, breadboard-friendly package: 0.7" x 0.8" (17.8 mm x 20.3 mm)
• Wide operational range: -25° to 75° C
Application Ideas
• Tilt measurement in robotics applications
• Multi-axis vibration measurement in transit and shipping systems
• Multi-axis movement/lack-of-movement for alarm systems
Packing List
Verify that your H48C Accelerometer kit is complete in accordance with the list below:
Copyright© Parallax Inc. • Hitachi H48C 3-Axis Accelerometer Module (#28026) • 7/27/2007 Rev 1.2 Page 1 of 6
Essential Connections
Connecting the H48C module to the BASIC Stamp 2 controller is a straightforward operation, requiring
just three I/O pins (the CLK and DIO pins may be shared in systems requiring the use of more than one
H48C module). See Figure 1 for connection details.
How It Works
Through MEMS (Micro Electro-Mechanical System) technology and built-in compensation, the H48C
accelerometer provides simultaneous outputs through analog conditioning circuitry to an MCP3204 ADC.
To "read" g-force of a given axis we actually read the voltage output from that axis and calculate g-force
using this formula:
In the formula, axis and vRef are expressed in counts from the ADC, 4095 is the maximum output count
from a 12-bit ADC channel, 3.3 is the H48C supply voltage, and 0.3663 is the H48C output voltage for 1g
(when operating at 3.3v). In practice this can be simplified to:
Using the BASIC Stamp 2 module as a host controller, we should multiply the 0.0022 by 100 (to 0.22) to
express the result in units of 0.01g. Using the ** operator, we are able to multiply by 0.22 and convert
the raw readings to g-force with this bit of code:
Note the IF-THEN structure which prevents a negative number from being divided – this is illegal in
PBASIC 2.x and will not return the correct result. By restructuring the conversion equation for negative
g-forces we can indeed arrive at the correct value. The output value, gForce, is a signed integer.
In application the analog signal conditioning circuitry affects the rate at which readings can be taken
H48C module. The filter/buffer circuit is designed to minimize noise while maintaining the highest
possible signal resolution into the ADC. By design, the filter circuit limits MC48C axis output rail-to-rail
rise/fall time to about five milliseconds. Since MCP3204 has a significantly higher sample rate, the
Copyright© Parallax Inc. • Hitachi H48C 3-Axis Accelerometer Module (#28026) • 7/27/2007 Rev 1.2 Page 2 of 6
sampling rate of the module is dictated by the filter circuitry and works out to about 200 samples per
second.
Copyright© Parallax Inc. • Hitachi H48C 3-Axis Accelerometer Module (#28026) • 7/27/2007 Rev 1.2 Page 3 of 6
Demonstration Program
This demonstration uses the BASIC Stamp 2 series microcontroller to read the reference voltage and
output channels from the H48C using the onboard MCP3204 analog-to-digital converter. For each
channel the raw count, channel voltage, and g-force for the X, Y, and Z axes are displayed as shown
below:
Copyright© Parallax Inc. • Hitachi H48C 3-Axis Accelerometer Module (#28026) • 7/27/2007 Rev 1.2 Page 4 of 6
VRef CON 3
Reset:
HIGH CS ' deselect module
DEBUG CLS, ' paint display
"=========================", CR,
"H48C 3-Axis Accelerometer", CR,
"=========================", CR,
CR,
" Count Volts G ", CR,
" ----- ----- -----", CR,
"VRef ", CR,
" X ", CR,
" Y ", CR,
" Z "
Main:
FOR axis = XAxis TO ZAxis ' loop through each axis
GOSUB Get_H48C ' read vRef & axis counts
Copyright© Parallax Inc. • Hitachi H48C 3-Axis Accelerometer Module (#28026) • 7/27/2007 Rev 1.2 Page 5 of 6
DEC (mVolts / 1000), ".",
DEC3 mVolts
' Reads VRef and selected H48C axis through an MCP3204 ADC
' -- pass axis (0 - 2) in "axis"
' -- returns reference voltage counts in "rvCount"
' -- returns axis voltage counts in "axCounts"
Get_H48C:
LOW CS
SHIFTOUT Dio, Clk, MSBFIRST, [%11\2, VRef\3] ' select vref register
SHIFTIN Dio, Clk, MSBPOST, [rvCount\13] ' read ref voltage counts
HIGH CS
PAUSE 1
LOW CS
SHIFTOUT Dio, Clk, MSBFIRST, [%11\2, axis\3] ' select axis
SHIFTIN Dio, Clk, MSBPOST, [axCount\13] ' read axis voltage counts
HIGH CS
RETURN
' -------------------------------------------------------------------------
RJ_Print:
LOOKDOWN dValue, >=[10000, 1000, 100, 10, 0], dPad
DEBUG REP " "\dPad, DEC dValue
RETURN
Copyright© Parallax Inc. • Hitachi H48C 3-Axis Accelerometer Module (#28026) • 7/27/2007 Rev 1.2 Page 6 of 6