Shop OBEX P1 Docs P2 Docs Learn Events
Cheap Accelerometers anyone? - Page 2 — Parallax Forums

Cheap Accelerometers anyone?

2

Comments

  • sylvie369sylvie369 Posts: 1,622
    edited 2009-03-14 10:22
    earl@uphi.net said...
    Talk about cheep accl's. How about $14.95 at Best Buy ? Its a knockoff of the Wii numchuck !

    Now to write some code to talk to it !!!


    A thread on the Wii Nunchuck, including a Prop object:

    http://forums.parallax.com/showthread.php?p=751847

    ·
  • Old man EarlOld man Earl Posts: 46
    edited 2009-03-17 17:17
    Here is what I learned about the Best Buy $15 Wii nunchuck knockoff called the Edge.

    It ha a Freescale MC9S08QE8 8 bit U-proc 32 pin QFN

    (http://www.freescale.com/files/microcontrollers/doc/data_sheet/MC9S08QE8.pdf?fsrch=1&WT_TYPE=Data Sheets&WT_VENDOR=FREESCALE&WT_FILE_FORMAT=pdf&WT_ASSET=Documentation)

    MMA7260QA 3 axis accelerometer 16 pin QFN

    (http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MMA7260QT&fsrch=1)

    Both chips on one side of the board.

    The pinouts on the edge of the n-chuck board

    red wire > 3.3v input
    white >VSS (Ground)
    yellow > i2c clock line
    green > i2c data line

    See pic of how I cut the board in half to save space. (Not necessary if you want the buttons and joystick)(sorry about focus)

    I included the code to read the data and display on prop TV output. Still could use some polish. The code was partly from prop objs.

    Post Edited (earl@uphi.net) : 3/17/2009 5:24:01 PM GMT
  • Old man EarlOld man Earl Posts: 46
    edited 2009-03-18 00:32
    Here is some more pics of me and my lab !
    Ya..I am an OLD man !!
    1200 x 1600 - 978K
    1200 x 1600 - 975K
    1200 x 1600 - 1M
    1600 x 1200 - 1M
    1148 x 843 - 562K
  • Old man EarlOld man Earl Posts: 46
    edited 2009-03-18 03:24
    I was wondering, if the n-chuck I am using has a u-proc in it, and it receives the accelerometer analog data, does it massage the data by some sort of filtering before it is accessed by i2c bus ? The output looks rather stable and constant. Hardly any jittering around.
  • PhilldapillPhilldapill Posts: 1,283
    edited 2009-03-18 04:06
    Wow, Earl, that lab looks vaguely familiar... Oh wait, is that mine? [noparse]:)[/noparse]

    I would assume the micro controller does some sort of data filtering. If they are going to put a uC in there just to aquire analog data, well, that's just a waste. BTW, those gyro's you sent got me interested again, in the idea of a accelerometer/gyro combo board.

    Looking into the idea further, I think my original estimate of $50 might be a little off. For my PropBoard venture, I didn't really factor in any overhead and suprise expenses - big mistake. If I buy a quantity of 50 chips, then I think the price needs to be more like $55-$60 for the gyro and accelerometer mounted on a breakout board with the components soldered on.

    Another thing I realized when looking at the datasheet for the gyro, is that the output is analog! This means that no object needs to be written for it! A simple external ADC(or propeller ADC) can aquire the data just fine. SO, the outputs of this hypothetical board, would be either I2C, or SPI(if I can get an object re-written in SPI), and an analog output for the gyro. The board would work on 3.3V, with a pinout of 6 pins total, power included. Not bad for a 5DOF board, eh?

    Anyway, if anyone is interested in the accelerometer, gyro, or the combo, PM me and I'll add you to the list. I need fairly firm commitments for they are rather costly...
  • Old man EarlOld man Earl Posts: 46
    edited 2009-03-18 14:58
    The advantage of being retired is I get to play with this stuff all day and part of the night ! If this works out, I got the time to help on a full autopilot that would be very affordable for the hobbiest. I still have not got the motor,props,and ESC for the quadrocopter yet. China parts are a LONG way away ! Good thing too. It gives me more time to work on the electronics and programming. I think the prop is a very powerful u-proc to use for this. Paul Hubber has used it for his autopilot on DIY Drones. I used some of his code to do mine.
  • PhilldapillPhilldapill Posts: 1,283
    edited 2009-03-19 04:04
    Well, I ordered some free samples from Freescale today. These are some analog output accelerometers. Since the gyro I plan on using is also analog output, it got me thinking. I have some TLV2543 12-bit, 11-channel ADC chips that work wonderfully, thanks to Tim Moore writing a GREAT object for it. The object for the ADC itself takes one cog, and samples each channel at nearly 4,000 samples a second! It also keeps a running average of the last 8 samples taken to provide a more stable output.

    What I had in mind, is using this other chip from Freescale that is very comparable to the LIS3LV02DL chip I had planned on using. This way, I could put a triple axis accelerometer, a gyro, and an ADC all on one compact board. The ADC would only take 4 pins - CS, Data In, Data Out, and Clock. What you would GET, is the acceleromter, the gyro, PLUS 6 unused ADC inputs for whatever your project needs! This new accelerometer costs a few bucks cheaper, but the ADC costs a bit more, so I think the price range would still be accurate - $55 or $60 for the whole package.

    Any thoughts?
  • SRLMSRLM Posts: 5,045
    edited 2009-03-19 05:40
    Why do you keep improving the design?!? [noparse]:)[/noparse]

    You might as well include a spot on the PCB for a triple axis magnetic field sensor (what is the name?). I'd guess that the actual chip will increase the cost quite a bit, so you can probably leave it off. That would be my wish list, anyway.

    So, the cost is the same and the result is no worse. I say go for it.
  • PhilldapillPhilldapill Posts: 1,283
    edited 2009-03-19 05:59
    Are you thinking of a Hall Effect Sensor? These detect magnetic fields based on electron deflection from the magnetic field. Heck, I could add one! They are fairly cheap, but maybe a seperate board...

    EDIT: oh, btw, improving the design - the curse of engineering. It's NEVER good enough until someone tells you "oh to hell with it, just DO IT already!"
  • Old man EarlOld man Earl Posts: 46
    edited 2009-03-20 03:23
    Hi all,
    Got my ESC, motors, props, ESC programmer, and a couple of 2200ma lo-po batteries today from China!
    I have also been working on the combined Pauls propeller program (V013). It now displays the 3 axis accelerometer data as well as the r/c RX data, servo output data, and the GPS data. I hope Paul comes over to this forum to chime in.
    Now to start on the quadrocopter mechanical stuff. You know, drilling holes, mounting parts, wiring things up...
    The n-chuck accelerometer part is sure working well. There must be some sort of data massaging going on because the output looks real stable and doesn't jump all over the place. The bonus is the prop chip talks to it via I2C !
    So....What's everyone else been doing lately ?
  • PhilldapillPhilldapill Posts: 1,283
    edited 2009-03-20 03:36
    Earl, just curious - how many accelerometer samples can you grab per second via I2C? The LIS3LV02DL chip seems to only output about 30 samples per second MAXIMUM, with it's own cog running. How about yours?
  • Old man EarlOld man Earl Posts: 46
    edited 2009-03-20 05:22
    I think 50 or more. I can walk across the room and see numbers move in a blur...



    Here is the archive as of today

    Make sugesstions please...

    ol man earl....
  • PhilldapillPhilldapill Posts: 1,283
    edited 2009-03-20 16:21
    Earl, you can get a fairly exact samples/sec by measuring the time it takes for one sample to be gathered. Try this:

    Before your "get acceleration" call(or whatever it is in your code), add this line:

    time := cnt

    Then, after the "get acceleration" call, add this line:

    time := cnt - time

    The new value of the time variable is how many clock ticks it took to complete the sample. You can print this to the TV or whatever to view it. If you divide your clkfreq by the "time" variable, you will get samples per second.
  • Ole Man EarlOle Man Earl Posts: 262
    edited 2009-03-20 18:10
    great idea..did it...17 samples/second reported
    BTW are you on spring break or what ??

    Post Edited (uphiearl) : 3/20/2009 6:20:07 PM GMT
  • PhilldapillPhilldapill Posts: 1,283
    edited 2009-03-20 20:51
    Yep. Last official day of spring break, then satuday and sunday it's back to the books... Circuits midterm bright and early on monday morning. [noparse]:)[/noparse]
  • Ole Man EarlOle Man Earl Posts: 262
    edited 2009-03-23 05:39
    I am going out off town for a week. Gonna watch my brother in a senior bowling tournament.in Las Vegas. He is a pro bowler. I hope to get back to the project next monday.
    CUL








    .
  • mikedivmikediv Posts: 825
    edited 2009-03-25 01:00
    Hey guys does anyone have the pinouts for Phils accel board?? and or any sample spin programs?
    ·
  • PhilldapillPhilldapill Posts: 1,283
    edited 2009-03-25 03:51
    Arg! I'm sorry, Mike. I keep forgeting to send that stuff to you. I PROMISE I'll get that tomorrow. I'm not at my computer right now, but I'll get that sent to you via email or post it here.
  • Ole Man EarlOle Man Earl Posts: 262
    edited 2009-03-25 17:20
    Hello all from Las Vegas ! Wow what lights. Already I am ready to come home tho. All that noise gets boaring.By the time I get home my parts should be there. I am resisting the slots SOMEWHAT. When I do gamble I tthink...gee that would buy a 5 axis board or a new RX. Well, gonna run.., CUL
    Earl
  • mikedivmikediv Posts: 825
    edited 2009-03-25 19:55
    Thanks Phil I thought you were gone on spring break???
  • Old man EarlOld man Earl Posts: 46
    edited 2009-03-31 02:27
    I started a new thread called prop autopilot...
  • mikedivmikediv Posts: 825
    edited 2009-04-07 01:33
    Old man Earl·do you happen to have the pinout to phils accelerator board?
    ·
  • PhilldapillPhilldapill Posts: 1,283
    edited 2009-04-07 02:33
    Doh! Jeeeez, call me unreliable... Sorry, Mike. Here is the pinout if you are looking at the board with the pins on the top, and a top down view.
    Top Left Pin(Pin 1) Vdd
    Pin 2 - CS
    Pin 3 - SCL/SPC
    Pin 4 - SDA/SDI/SDO
    Pin 5 - SDO
    Pin 6 - RDY/INT
    Pin 7 - GND
    The only pins you need, are the Vdd, GND, SCL and SDA pins. Attached is a (very) rough bit of code that gets it to work. This was made by Tim Moore, modified by me for this chip.

    The file you will need to run is LISTESTA. Again, man, I am really sorry for being an unreliable sack of Smile with this. How many times did I tell you, "ah, sure let me send that RIGHT OVER." wow. I hope this gets it working.
  • mikedivmikediv Posts: 825
    edited 2009-04-07 22:04
    Thanks Phil I have the thing hooked up to my proto board and it just stares at me every day LOL
    ·
  • PhilldapillPhilldapill Posts: 1,283
    edited 2009-04-08 05:43
    Mike, is it working or no? I changed up the design so that it only has the needed pins out front - less complicated. Let me know if it works or not. I just wanted to show you how cool these things are! [noparse]:D[/noparse]
  • mikedivmikediv Posts: 825
    edited 2009-04-08 17:47
    Phil I tried the code you attached thank you by the way but I am issing a file called "TV_wText_db" Phil I was also wondering I can not get the video to work on any of my boards using some propstick stuff I wrote are the pinouts differant for the Video I/O on your boards? I tried it both ways connectors attached and no connectors.
    Thanks
    ·
  • PhilldapillPhilldapill Posts: 1,283
    edited 2009-04-08 21:37
    Mike, you'll need to download the object from the obex. I can't remember off the top of my head, but PhiPi wrote it.

    As for the pinout, the starting TV pin is pin 19 I believe. This way, it's from 19,20,21 and then Audio is on pin 22(I THINK). Again, that's off the top of my head and could be wrong. Try that and see if it works.
  • Ole Man EarlOle Man Earl Posts: 262
    edited 2009-04-08 22:35
    Most of the time people use tv base pin 12 12-13-14 also see my autopilot update pics... audio is on different pins
    BTW phil, I will order 2 of the 1dc650 boards to send to you
    Earl
  • mikedivmikediv Posts: 825
    edited 2009-04-08 22:59
    Got the pinout someone posted in this thread early ,, good work .. I will try and fine driver in object
  • PhilldapillPhilldapill Posts: 1,283
    edited 2009-04-08 23:40
    Arg! Mike, I don't know what I was thinking. It's NOT pin 19. It's pin 20 that is the base pin for TV on my PropBoard.
Sign In or Register to comment.