Page 1 of 1
MMA7361 Accelerometer
Posted: Mon May 06, 2013 1:09 pm
by Frank607
Hi,
I have here a MMA7361 accelerometer module and want to connect this to a PIC16F690 with LCD. Does someone have a quick example of a flowchart. Just the basics, XYZ.
I look in this forum and the examples folder from Flowcode but there is no example for a accelerometer.
(OT: @Martin; I’m still waiting for my 20MHz crystals from the shop….

(SR04 topic))
Thanks and regards,
Frank
Re: MMA7361 Accelerometer
Posted: Mon May 06, 2013 1:21 pm
by JohnCrow
Hi Frank
Have a look at one of my projects using an accelerometer
http://www.matrixmultimedia.com/mmforum ... ter#p46326
Re: MMA7361 Accelerometer
Posted: Mon May 06, 2013 2:25 pm
by Frank607
Thanks John,
I will “strip dowm” your flowchart to what I need. On this moment I try to figure out the connections between the accelerometer component and the MMA7361.
The component has:
Data Available
Power
SDA / SDI
SCL / SCK
N/A / SDO
N/A / CS
The MMA7361 has pin’s:
X
Y
Z
ST
GS
OG
SL
How can I know which connections to use with the component? Can I use X to SDI, Y to SCK and Z to SDO ?
Re: MMA7361 Accelerometer
Posted: Mon May 06, 2013 3:24 pm
by JohnCrow
Hi Frank
This is the device Im using
http://www.001tech.co.uk/Forum/viewtopic.php?f=8&t=3
This is the data sheet for the actual chip.
http://www.001tech.co.uk/Projects/MoACC ... LV02DQ.pdf
I've just had a quick look at the datasheet for the device you have and I dont think it will work with the flowcode component.
It needs to have either a I2C or SPI bus, which I dont think yours has.
My impressions from scanning the data sheet is it has a direct mV/g output.
I can certainly recommend the board I have used, and it will be a lot simplier to setup. It does need to run on 3.3V so a seperate voltage regulators such as I've used will be needed to power the device from a PIC, though the data lines are 5V tolerent.
Re: MMA7361 Accelerometer
Posted: Mon May 06, 2013 5:17 pm
by dazz
Hi Frank
have a quick try with this flowchart, i don't own one but had a look at the data
sheet this should read in the raw x,y,z values and display them on an lcd
you will need to change the chip to the ones you use also the adc pins and switch need changing to your chip
I don't know if it works try it and have a play, the display variable G= should change to a 1 if all the axis =0
Let us know if it worked
Regards
Dazz
Re: MMA7361 Accelerometer
Posted: Mon May 06, 2013 6:18 pm
by Frank607
Thanks for helping me!
Tomorrow I can test and read the two new topics. I will let you know.
Regards,
Frank
Re: MMA7361 Accelerometer
Posted: Tue May 07, 2013 4:07 pm
by Frank607
Hi Dazz,
I tried today your flowchart and made it compatible for my pic. Unfortunately it can’t get this to work.
The XYZ numbers are “dancing” from 0 to 100 without moving. Do I miss something ?
Attached is the flowchart what I use now.
Re: MMA7361 Accelerometer
Posted: Tue May 07, 2013 4:27 pm
by dazz
Hi Frank
So the readings don't Vary when the sensor is moved is that correct ??
if so try this flowchart
you will need to connect the sleep pin to b4 this should hold sleep high ,which will allow the senor to operate (if it doesnt change the sleep variable initial value to 0 and reprogram and try again)
Also i think that the g select must be held either high or low so add a switch to port if you can b5 and the GS pin to port B4 on the pic if you can if not set port B4 to either high or low and connect to the GS on the sensor, this should make the reading range change
Let me know how you get on
Regards
Dazz
Re: MMA7361 Accelerometer
Posted: Wed May 08, 2013 5:34 pm
by Frank607
Hi Dazz,
Thanks, its working now. I always power my breadboard with a simple 12V battery pack and this is always working. In this case I take my multi meter and measure the voltage from pin Y. When I moved the accelerometer nothing happened. Then I power the accelerometer with a LAB power source and all is working very well. Strange, but ok
The 0G ( zerro G) function is also working. When I drop the accelerometer to my table I see a short activation on the LCD from 0 to 1.
The needed information I get from this video:
http://www.youtube.com/watch?v=-4WvADos_eg (very long annoying but good

)
I have a little bit modified your flowchart to my conditions and have attached it for other people who want also to have this.
Explanation flowchart:
PIC16F690
MMA7361 (Complete board from eBay)
Connections to the pic:
X to port A0
Y to port A1
Z to port A2
GS to port B4 (G Select)
0G to port B5 (Zerro G, free fall)
SL to port B6 (Sleep)
LCD to port C
5V Power