Page 1 of 1

Accelerometer DataLogger

Posted: Sun Sep 16, 2012 10:54 am
by JohnCrow
Accelerometer DataLogger

This is my first project using the “001-Tech” Accelerometer Board. It is fully compatible with the accelerometer module in Flowcode 5.
It is designed to show the principles of operation and test the unit.

The sensor used is the the LIS3LV02DQ 3 axis accelerometer. This device has a full scale of either 2g or 6g.
This project utilises the 2g setting.

It is supplied on a small “postage stamp size” pcb along with a couple of other components and an 8 pin SIL header.

The board operates of a 3.3V supply, so cannot be connected to PIC without voltage conditioning.
The interface is either I2C or SPI

I have chosen to use a TO92 style 3.3V 3-pin regulator.
Due to the low power drain of the board it can be powered from a pin on the microcontroller.
This allows it to be connected without a separate power wire as is normal for most e-blocks

Hardware:

As most of my projects uses the EB006 programmer board I have had a change with this one and used my ECIO40 System

EB061 ECIO40 Application Board
ECIO40 Micro-Controller Device
EB016 Prototype Board (Port B)
Custom 4 Line 20 Character LCD Display (Port D)
EB634B 500mm Ribbon Cable – To connect the accelerometer and allow freedom of movement.
EB037 SD Card Reader (Port A)
EB007 Switch Board (Port C)

3.3V 3-pin Voltage Regulator
Jumper Wires To Suite

Connections:

The Accelerometer is connected as follows

VDD 3.3V Regulator Output
GND 0V
RDY Port B Pin 0 (Data Ready)
SDO No Connection
SDA Port B Pin 1 (Data Out)
SCL Port B Pin 2 (Clock)
CS 3.3V
VDDIO 3.3V


Port A Pin 0 Data Available
Port A Pin 1 SDA
Port A Pin 2 SCL
Port A Pin 3 Power to 3pin regulator


The current drawn by the accelerometer is small enough to allow it to draw power from the PIC itself.
NOTE it must not be connected to 5V.
Either a 3pin regulator, zener diode or a pair of equal value resistors as a voltage divider, (the accelerometer can run at 2.5 V) must be used.

Operation:

Reading Raw Data:

The program is used to sample the outputs of all 3 axis of the accelerometer over a short period of time.
They are displayed on the lcd along with a counter showing how many samples have been taken.
All 3 data points are saved to an SD card as a data string using CSV file format.
This means the data can be read back and plotted as a graph using Microsoft Excel.

For simplicity a sample of about 100 sets of reading will be taken.

The manufacturer’s data sheet shows the outputs are nominally ±1024 at full scale, when running at 3.3V.

Press the reset button on the ECIO.

After the system has booted it will request a card be inserted.

Insert a suitable memory card, the system will check if it’s clear, if not the card will be wiped first and the data file created.

Move the accelerometer about in all 3 planes, take care not to bang or jar the device as this can cause damage.

Once enough data has been acquired, press switch 0 on the switch board to stop logging. Just removing the card can cause data loss.

The system will show a remove card message.
After a couple of seconds the system will restart and wait for a new card to continue logging.

The memory card was then read in the PC and a graph plotted of the first 50 data points.
(50 was chosen as its shows the principles without being overly cluttered.)


The actual full scale raw data will according to the data sheet, vary depending on both the actual sensor and the supply voltage. The full scale must be determined experimentally.
Accelerometer_DataLogger-2G V1.fcf
(32.61 KiB) Downloaded 494 times
Graph.jpg
Graph.jpg (93.46 KiB) Viewed 7759 times
The attachment Accelerometer_DataLogger-2G V1.fcf is no longer available

Re: Accelerometer DataLogger

Posted: Tue Sep 18, 2012 11:03 am
by Benj
Cheers John,

Great article.

Just noticed this. "The attachment Accelerometer_DataLogger-2G V1.fcf is no longer available" though the file does seem to be available a bit higher up :D

Re: Accelerometer DataLogger

Posted: Tue Sep 18, 2012 11:10 am
by JohnCrow
Yes Id originally uploaded the FC file twice by mistake, and deleted one instance, but it still left that on the post.

The long ribbon cable is great for testing things like this :)

Re: Accelerometer DataLogger

Posted: Thu Oct 18, 2012 1:13 pm
by Sparkoids
I've got one of those 001-Tech boards and will look at this later - thanks John... (again!)


James :-}

Re: Accelerometer DataLogger

Posted: Thu Oct 18, 2012 3:08 pm
by JohnCrow
They are a nice little board

Re: Accelerometer DataLogger

Posted: Tue Mar 19, 2013 8:27 pm
by Mark
John,

Thanks, I pinched your SD_Card setup macro as I could not get my card working on an EB037.

Works fine now - a platform to make my own routine.

Regards,

Mark

Re: Accelerometer DataLogger

Posted: Tue Mar 19, 2013 8:40 pm
by JohnCrow
Hi Mark
That's fine. Glad you got it to work.