Wednesday, September 30, 2015

Tiny Accelerometers Acquisition System

By Giovanni Carrera -

The aim of this project is to realize a small acquisition system of a triaxial accelerometer connected via serial interface to a pc or tablet, using an appropriate adapter as TTL/USB or TTL/Bluetooth.
However, this system can also be used for other sensors with the same output range.

The Circuit
I used the PIC microcontroller 16F688, with minor modifications to the firmware you can use another microcontroller with one UART, three channels ADC and two digital bit.
For the CPU clock I used a 18.432 MHz quartz, the reason is that this frequency is particularly suitable for serial baud rate generation. You can find it easily in a RS232 board for PC.
The following figure shows the schematic of this project.
A quadruple dip switch allows you to set the sample rate and the range of accelerometers. To optimize the input range of the ADC, I used the TL431 regulator as adjustable reference source with a good thermal stability. As indicated in the scheme, the trimmer must be adjusted for a 2.80 output voltage, the same output range of the sensors.  The serial out is TTL 5V level. The following picture shows the arrangement of the components on the board of my prototype.

 The card with the accelerometer module has been removed to better see the mounted components, while the photo below shows the accelerometer module mounted. I used the module DC-SS009 made by Sure Electronics, but you can use an equivalent board. It utilizes the chip MMA7260QT from Freescale Semiconductor.
The J3, 4 pin, connector is used to acquire external analog signals, in this case the accelerometer module must be removed. RS1 is a quadruple sil resistor array. For the voltage divider I used 1% tolerance resistors and a 20 turns trimpot.
For a pc connection I used a TTL to USB adapter, which also powers the system. Are particularly suitable even those contained in the same USB connector, you have to install its driver on the PC.

The software
I set prescaler of Timer#0 to 256 and TMR0= 76, so it overflows every 180 counts. With these settings and with the quartz used, you get an interrupt every 10 ms (f = 100 Hz). This is the base period to generate the sampling periods with appropriate multipliers.
Two dip switches (dip1, dip2) are used to select the sampling period multiplier in order to obtain the frequencies of 5, 10, 50 and 100 Hz. The other two dip switches set the full scale of accelerometers(1.5, 2, 4, 6 g) by acting directly on the chip MMA7260QT and are not controlled by the program.
The serial output is ASCII coded with 38400 baud rate. Every row contains the numbers (0-1023) corresponding to the accelerometers X, Y, Z.  At first, after the reset, the device transmits the selected period in milliseconds .
To get the data in physical quantity (g) it is necessary to make a calibration using the acceleration of gravity, therefore, the conversion may be done on the pc.  I compiled my program  in mikroPascal PRO for PIC (mikroElektronika,
The source and compiled files (hex format) can be downloaded at:

1)      “3 Axis Acceleration Sensor Board User’s Guide”, DC-SS009, Sure Electronics, 2007.

2)      “±1.5g - 6g Three Axis Low-g Micromachined Accelerometer”, MMA7260QT, Freescale Semiconductor, 2007.

No comments:

Post a Comment