It seems to work quite nicely.
![]()
1) Start value ~0.07 - 0.10G. X-axis = 0 deg, Y-axis = 0 deg.2) Y-axis tilted 90 deg. Should show 1G in this position. OK.3) X-axis tilted ~45 deg.BR,
-Gusse-
It seems to work quite nicely.
![]()
1) Start value ~0.07 - 0.10G. X-axis = 0 deg, Y-axis = 0 deg.2) Y-axis tilted 90 deg. Should show 1G in this position. OK.3) X-axis tilted ~45 deg.BR,
-Gusse-
Nice!
And a LCD that looks identical as the one that I have cannibalized out of a nokia phone and going to solder wires on to use with my PIC's
Do you want to post the updated code too ?
..This is how far I got..
http://www.repulsiv.se/pics/accelero...breadboard.jpg
Your setup is much more elegant
..Note that I already connected a cable for an Z-axis, I bought a prototypeboard with a 3-axis accelerometer from sure electronics that I'm going to use too.
The "normal" value seem to be 120, and using 8bit AD-converter that would be.. lets se..
5v Vref /256 = 0,01953125
120 * 0,01953125 = 2,34375
With a Vref at 5v 1G should be 2.5V, so its a bit strange..
I have to make some effort at making PBP do that math and display the "real" G-value too.. readed Melanies thread about it but.. well![]()
Last edited by Glenn; - 21st January 2009 at 01:52.
Display is from Nokia 3310 and it is easy to play with. Yeah!
I could try to make a code with all neccesary LCD srcipts too. At the moment this accelerometer is just one part of a bigger system and a part of a bigger code bunch. It will take some time, but I'll come back with the code, no problem. Anyway, origin of the display driver is from this forum, therefore I would like to thank those who have done the pioneer work! Thanks!
As said earlier, my primary use case was motion detection (alarm). For that purpose LIS302DL works fine, but then I started to look more advanced solutions; acceleration, speed, range, etc. Nice features, but one problem is causing grey hairs to my.
If device is at fully horisontal level (Z-axis is pointing to center of the earth), then everything is OK. But if it is rotated/tilted X, Y, Z or any combinations (pitch, roll, yaw), then readings are not any more right. Spec also says so.
There are quite lot of discussions about how to get rid of this limitation, but no really simply solution. This is one good post, which describes more accurately the problem http://www.electronicspoint.com/acce...n-t119225.html
BR,
-Gusse-
EDIT: Here is also code for LIS302DL with Nokia 3310 LCD. This one shows captured acceleration values on screen: 1st X, 2nd Y, 3rd Z. No bargraphics included because grachics are located in external EEPROM. LCD is connected to PortB, accelerometer to PortC & D (partial), see file for more details. Change pins to fit you application (I'm using 16F877A).
Last edited by Gusse; - 21st January 2009 at 19:03. Reason: Code added for Nokia 3310 LCD and LIS302DL
Here is an updated demo code for LIS302DL with Nokia 3310 LCD. This shows all three axis with bar graphics and numbers.
Also small video clip, which shows how the system works (I'm rotation PIC and LIS302DL in my hand) http://kotiweb.kotiportti.fi/karl-er...C/LIS302DL.wmv.
My test bench for accelerometer (add-on board) http://kotiweb.kotiportti.fi/karl-er...d_LIS302DL.gif.
And here is the code.
BR,
-Gusse-
EDIT: If your screen is too light or too dark then tune "Contrast" value. I have noticed that there are differences between new and old 3310 LCD displays (tested both).
Last edited by Gusse; - 22nd January 2009 at 14:27. Reason: Guidance added
my lis302dl is not working properly.....no matter which register i tried to read, the data is always 0xFF....shouldnt be right according to the datasheet....even the Who_AM_I register gave me 0xFF...BTW the sensor was working few days a ago. is it detected?help.....
I am using PIC16f877 to interface with LIS302DL. I browsed through some threads available over the net. They said we need to add pullups at the data lines and SCL. why? I dont include any pullups. i just directly connect the sensor to the PIC. anything wrong?
Bookmarks