View Full Version : Accelerometer help
Timbo337
Apr 22, 2004, 07:00 PM
Hi, I am making an accelerometer for a computer science project in a highschool class. The teacher is letting me do it because I am going to input the g-force data into a laptop, and then sort all the data and use everything that we have learned since the beginning of the year. The one part of this project that is stumping me is actually making the accelerometers and hooking the up to the laptop through a serial port. I found one that is in production, but is a little pricey at $45.
http://www.sparkfun.com/shop/index.php?shop=1&cart=56692&cat=71&
I was looking at the Fully Contained Serial Accelerometer and the Serial ADXL PCB on that page. What I am wondering is would it be very hard to make an interface for this sensor to plug right into my serial port? I have never done any projects with pics, but I think I am ready to learn some. BUT, I only have 5 weeks until this project is to be completed, so I can not waste much time on this hardware part of the project (I'm not even getting graded on the hardware part!).
On a sidenote, does anyone know of any programs that can complie a project of java files? I am using Metrowerks CodeWarrior at school and am not sure if I can make a .exe with it.
Thanks all
Talon Driver
Apr 22, 2004, 10:23 PM
Timbo337,
And to think that I was doing rocket science when I made that germanium diode AM receiver in middle school. Wow we sure have come a long ways.
What grade in high school is this for?
I went to that internet site from your link. I saw the small circuit board. I am trying to find a single axis accelerometer. All I need it to record is MAX G force encountered during a flight in a small RC plane.
Did you come accross such an accelerometer in your research?
At this time I don't think I can answer your question.
Cheers,
Chuck
mike50
Apr 22, 2004, 10:56 PM
Chuck,
Well you could certainly use the ADXL202 to measure just one axis...just ignore the second axis. I would think that the ADXL210 would be better though, you could easily exceed 2 G's with most RC planes. The ADXL210 is exactly the same as the ADXL202 (and would fit on the same board), it just reads +/- 10 G's rather than the +/- 2 G's of the ADXL202.
Mike
Timbo337
Apr 22, 2004, 11:10 PM
Chuck,
I have just the site for you! It was actually the first site that I came across when looking for accelerometer projects, and it really inspired me.
http://mysite.verizon.net/res8dbeh/rocket.htm
This guy uses a tx/rx system to send his signals, which is not needed for my project. He used a linear resistor for his accelerometer, which he explains. I emailed him earlier and asked him where I could find this sensor, and he said that they are all over the place and could find one easily. I haven't searched for one once I found out that there were accelerometer-specific sensors out there.
Here is the proposal I typed up for the teacher:
I am going to make a 2-axis accelerometer interface for a laptop PC for use in a car. It will measure the g-forces caused by the changes in direction of the car, as well as acceleration and deceleration in a straight line. The sensor unit will connect to the laptop via a serial port. The computer will then use the incoming data to make graphs, perhaps in a graphical user interface, and also sort the data in arrays. Other important data, such as the peak forces and mean forces, can be obtained from this project. The main focus of this project will be the sorting of the data, and parsing the useful data from those arrays. Also, a GUI is likely to be used for easy access to the data graphs and arrays. Also, the measurements will be converted to units of meter per second squared in order to find the exact acceleration rate. If time permits, a small LCD display will be used to relay the g-force readings in real-time to the driver of the car. This display can be positioned in a position much easier for the driver to read, instead of having to look at the laptop’s screen. The final product will be able to measure g-forces in all directions relevant to driving and display the data in raw form and after becoming sorted.
P.S. This is for an AP Computer Science course. I am in 11th grade. My teacher probably won't grade me on the interface of the sensor, but it is the most troubling part of this project for me!
zagisrule!
Apr 23, 2004, 12:22 AM
Something like this? :) :D
2 axis accelerometer for my car, 2 X 20 VFD display, radar detector, and battery voltmeter all in one...all made possible by PIC 16F819.
This was easy, it is the computer interface that is hard...I have no clue :confused:
I'm in 11th grade too! That is neat :)
Comatose
Apr 23, 2004, 01:00 AM
if you can get a microcontroller going, then it's really easy. use the printf or putc command to move the data over to your computer, then read it in the language of your choice.
If you're feeling wealthy, then the easiest way to do this is to use basic stamps and parallax accessories.
The main development kit
http://www.parallax.com/detail.asp?product_id=28102
accelerometer
http://www.parallax.com/detail.asp?product_id=28017
The advantage of going with parallax stuff, like i said, is that its dead simple, and very much designed for the beginner. Don't take that as a slam, you are a beginner. I played with one, and it took about two months for me to outgrow it. The only danger is some people never outgrow it, which makes what should be a pretty cheap hobby really, really expensive.
zagisrule!
Apr 23, 2004, 09:00 AM
Timbo337;
I have tons of Basic Stamp 1's here, and I think one Basic Stamp 2. The software to make and burn programs is a free download, but you will have to make your own cable to download programs to the unit. I'll give you a free one of your choice should you choose to use a Stamp...that will lower costs for you a bit, I don't want/need them now that I use PIC's.
All you would need to buy now is the accelerometer board and make that downlink cable so you can put programs on the Stamp. They both have their own little development boards that will be sent too.
PM me if you are interested in this offer.
-Matt
Talon Driver
Apr 23, 2004, 06:21 PM
Chuck,
I have just the site for you! It was actually the first site that I came across when looking for accelerometer projects, and it really inspired me.
http://mysite.verizon.net/res8dbeh/rocket.htm
This guy uses a tx/rx system to send his signals, which is not needed for my project. He used a linear resistor for his accelerometer, which he explains. I emailed him earlier and asked him where I could find this sensor, and he said that they are all over the place and could find one easily. I haven't searched for one once I found out that there were accelerometer-specific sensors out there.
Yeah, I actually have already seen this. I want something that simply measures maximum G encountered. I want micro and low tech. I definately do not want to buy the telemetry system when all I care for is maximum G encountered.
Also, I am pulling about 25 Gs so this will be a challenge.
Cheers,
Chuck
Talon Driver
Apr 23, 2004, 06:24 PM
Chuck,
Well you could certainly use the ADXL202 to measure just one axis...just ignore the second axis. I would think that the ADXL210 would be better though, you could easily exceed 2 G's with most RC planes. The ADXL210 is exactly the same as the ADXL202 (and would fit on the same board), it just reads +/- 10 G's rather than the +/- 2 G's of the ADXL202.
Mike
Mike I only need to measure maximum G encountered during the sortie rather than telemetry data.
I also need something that can measure around 25 Gs. Heck my T-38 that I fly can take 7.2 Gs.
I also do not require any electronic device.
Objective:
- 25 G min
- Extremely light (few grams)
- No batteries are preferred
- Extremely small
Cheers,
Chuck
zagisrule!
Apr 23, 2004, 09:19 PM
Talon Driver;
Your project is extremely simple...because you don't need to log much. + or - 50G's can be measured with the Analog Devices ADXL-250 (2-axis), but the output is analog and you must measure voltage fluctuations (I use 10-bit ADC) and store the maximum values. Do you have any PIC stuff?
-Matt
Talon Driver
Apr 23, 2004, 11:14 PM
Hey Projeti's Rule (Sorry I had to Say That),
Could you please tell me where I can get this hardware? Any please do not use abbreviations. My EE background is transitors, caps, resistors, inductors, operational amplifiers, AND, NAND, OR and NOR gates.
This needs to be small, light and preferably no additional battery that I will not read the maximum G until after flight. I will put this in my Projeti pull bone crushing Gs, land and then get the results.
Cheers,
Chuck
Proud Brushless Projeti Owner
zagisrule!
Apr 23, 2004, 11:28 PM
Hi,
The accelerometer's themselves are available from www.analog.com I think that the ADXL-250's are like $30 though in small quantity...but I think I have an extra here that I could part with for less. The PIC Microcontroller is available from www.microchip.com , but they are useless unless you can get a programmer for them which is some $$$.
Here is my idea: We use a PIC and the accelerometer (as well as a dual op-amp) to record maximum g's in each of 2 axises to EEPROM on the PIC. After the flight, and LCD could be plugged in and display the maximums and in what axis they are in. Sound good? Op-amps are used to buffer the high-impedance output of the accelerometer to a low-impedance output that the PIC ADC can easily read.
This whole thing could be made maybe 1" X .75" X .5" pretty easily. Do you think people would be interested in buying a device like this? How much would you think people would pay for a unit such as the above?
It would be a little cheaper to do one with only one axis of detection and recording, or do you want 2?
-Matt
*I wish I had a Projeti :D *
Comatose
Apr 23, 2004, 11:34 PM
PIC isn't an abbreviation, its a class of microcontroller that's popular around here.
I have possibly a simpler solution, if all you want is max force, and want super low tech. Get a little roller ball pen refill, or something similar, small that will not dry out. Attach that to a pair of springs, one above and one below it in sort of a yoke. Place a piece of card stock pressing lightly onto the pen. The plane of the cardstock should be perpendicular with the pen.
When the pen experiences acceleration it will deflect. Calibrate this by rolling the setup upside down. then right side up. The length of the line you draw is 2g. (pen pulled down, pen pulled up)
save that calibration card then stick in a new piece of card stock. Pull your bone crushing Gs, then take the card out. Instant graph of max and min Gs.
Of course, a pic12f675, an analog devices accelerometer and an LED would probably take less fiddling with, but the purely mechanical solution is more fun.
Comatose
Apr 23, 2004, 11:50 PM
zagisrule, serial is much smaller than an LCD, in terms of cost and in terms of the number of pins needed. I think that talon driver would be happier with a single LED for the results. the code would go something like this.
while(1)
{
if(counter <Gs)
output_high(PIN_A1) //turn the LED on
for(i = 0; i < 50; i++)
{
if(get_analog(0) > maxanalog)
{
maxanalog = get_analog(0);
Gs = (maxanalog-offset)/scaling
}
delay_ms(10);
}
output_low(PIN_A1)
for(i = 0; i < 50; i++)
{
if(get_analog(0) > maxanalog)
{
maxanalog = get_analog(0);
Gs = (maxanalog-offset)/scaling
}
delay_ms(10);
}
counter++;
if(counter > 30)
counter = 0;
}
This reads the analog value every ten milliseconds, converts it to Gs, then flashes the max Gs pulled (one flash for every g, it repeats every 30 seconds)
If it were mine, I'd have one LED for positive Gs and one for negative, but the code is essentially the same, with something that reads for minimum inside the for loops.
The less stuff one has to take to the field the better in my opinion, so solutions that need plug-in LCDs or laptops are less likely to be used.
just me $.03 (pseudocode costs an extra penny)
Timbo337
Apr 24, 2004, 03:42 PM
I found the StampDAQ software on the parallax site, its used to upload data from the stamp into excel. This data I could easily read with my programming skills :) This software upload at realtime, correct?
I just found this other page concerning the use of StampDAQ, answered some of my own questions!
http://www.parallax.com/html_pages/resources/catapps/cat_real.asp
I think going with the stamp will be the easiest way for me to complete the harware section of the project. Hopefully I can learn a lot about microcontrollers with this project, and move up to pics later this year!
zagisrule!
Apr 24, 2004, 06:57 PM
LED is a good idea, I was thinking that more resolution might be helpful though...with LCD you can easily and accuratly read 10ths with the 10-bit ADC.
Let me know what you want Timbo, I have 1 BS-1, several BS-1 OEM kits assembled, 2 BS-1 OEM Kits unassembled, and 1 BS-2 OEM Kit unassembled. You can have what you need because you are a student, and I know what it is like to be in a tight financial situation trying to do this stuff.....I wish you the best of luck with your project.
-Matt
Talon Driver
Apr 25, 2004, 12:03 AM
First, I hope Timbo 337 got his answers.
Second, guys I really apreciate your ideas. Here is the deal.
G - meter requirements:
- Single axis both pos and neg G (I don't care about side loading etc just perpendicular to the wing)
- Sub Micro Servo sized as in 0.5in x 0.9in x 0.9in
- Read Out: No interpreting length of mark etc so flashing LED is perfect
(except better to have one for 10 Gs and second for ones of G or a single LED that is coded with its flashing, definately not having to count each flash for each G, I would lose count counting 23 Gs)
- Zero telemetry: I'll be happy to see it when it is on the ground, beside I would have to buy more equipment, yeah you could have that option with a servo plug
- Accuracy +/- 0.33 Gs
- Max weight 10 grams w/ batteries
- Max G capable 30 Gs negotiable
- Some form of BIT (Built in Test) could be as simple as pressing micro button and it flashes current G or flashes something upon plugging in battery
- Some semblance of surface mount technology so it easily velcros into an existing bird.
- $12 ARF (w/o batteries OK)
- $20 RTF (RTF Preferred) (w/o batteries OK)
You see I can then put this little feller into my plane, G its brains out then loan to other dudes at the field to see whosw bird pulls the most Gs. I emphasize plug and play design and zero guess work.
The aforementioned is a design specification not a confirmed sales deal. However, I am sure you hombres got the talent to make something happen :cool:
Looking forward to your technical solutions.
Cheers,
Chuck
zagisrule!
Apr 25, 2004, 12:31 AM
Chuck,
I have some ADXL-150 units here that are +/- 50G single-axis units to do just the thing you (probably others too) would want. A few questions though...
How can you ask for .33G accuracy if an LED will read out to one G? If 10 flashes = 10G's and so on?
How about tapping into receiver for power? No batteries then...
-Matt
Talon Driver
Apr 25, 2004, 10:35 AM
How big is the ADXL-150?
I figured that if I requested a tolerance of +/- 0.5 G and it diplayed 1 G minimum increment and the circuit rounded down/up etc it could actually be 1 G off.
I really want this device to be autonomous. Making it so that it has to tap into existing battery power is a pain. I have to make a power take off wires. Also I can't walk over to another bird and slap it into it to see how many Gs it pulls unless it is also modified with the electrical wiring...impractical.
Is the watch battery thing present size issues? Is the BR-549, I mean the ADXL-150 require more than say around 3 volts?
I really emphasize transportability. All I would have to do is put a piece of velcro down for it to adhere to.
Oh yeah, LED flashing 10 times for 10 Gs is not good because as I said it gets annoying to count past 12 and easy to lose count. That is why if possible to have a single very low current LED flash the 10s then pause then flash the 1s or two very small diodes flashing the 10s and the 1s.
So is the ADXL-150 small enough to meet the submicro servo size?
If you are will to make one of these I have a feeling you would be able to sell several.
It would be one of those G-wiz toys a guy has in his tool box and he wants to see how violent that manuever was or an estimate for airframe stress.
Cheers,
Chuck
zagisrule!
Apr 25, 2004, 11:32 AM
No, we'll just add a receiver plug and the unit can plug into a spare channel on the rx.
The ADXL-150 (or practicaly any other +/- 50G unit) requires a regulated 5V supply. The BEC from an ESC happens to provide this, we might as well take advantage of it. We would have to add a regulator if there was an onboard battery that could fluctuate. Also, there is a pretty sizable current drain for watch batteries, with the LED's and all.
It would be very small, yes.
You think you will exceed10 G's? Wow.....I feel bad for that Projeti! ;)
-Matt
Talon Driver
Apr 25, 2004, 11:56 AM
Sounds smart for the 5V from the receiver. Perfect!
What will the overall current drain be in miliamps?
10 Gs...I could be wrong.
My brushless Projeti does at least 70 mph. Confirmed by Motocalc which usually shows slower than actually for brushless setups. And this is a conservative estimate since in a slight dive and compared to other Projetis with Mega brushless setups.
My Projetie easily turns with a 20 feet radius if not less (I have larger control surfaces and extra deflection). This has been confirmed by a few other calibrated eyeballs at the field.
70 mph = 102.67 feet per second
v2/r = a
(102.67)squared / 20 = 527 ft/sec2
527 / 32.2 = Gs = 16.36 Gs
I fly T-38s. I routinely pull 5 Gs. I know I am sitting in the cockpit rather than on the ground. However, I routinely pull 5 Gs manuevering in relation to another T-38 about 1,000 feet away. So I have a somewhat calibrated eyeball.
I am very confident my Projeti pulls more than 10 Gs.
Oh yeah put on the G-meter a 6 inch servo lead minimum, or a socket for a standard JR type connector.
Cheers,
Chuck
whyter
Jun 12, 2004, 03:36 PM
This thing is about the size of a car alarm remote, +- 25/30 G's, 5 memory locations, adjustable duration (sustained G's in seconds to be recorded).
http://www.g-labs.com
Rob.
Talon Driver
Jun 12, 2004, 10:53 PM
Thanks!
Cheers,
Chuck
zagisrule!
Jun 13, 2004, 10:16 PM
Cool, that is perfect because I have not been working on it at all.... :)
-Matt
Timbo337
Jun 15, 2004, 12:05 AM
Wow, I forgot about this post, lol. Zagi, do you want the basic stamp back? BTW, I got an A on the project! Thanks again!
zagisrule!
Jun 15, 2004, 12:26 AM
No, go ahead and keep it. I have no use for them...once you go PIC you won't look back!
-Matt
vBulletin® Copyright ©2000-2009, Jelsoft Enterprises Ltd.