Scratch Built Altimeter: Parts

The Rocketry Forum

Help Support The Rocketry Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
Take a look at the spreadsheet I have attached :) I hope it helps, this was my workings for calculating altitude based on volts :)

I hope this helps
 
Thanks! This chart is AMAZING! :p

Does this work with the 8 bit ADC, though?

Also, with this, why do I need an ADC (I know the sensor is analog, but if it gives off a number (thats more exact, anyway), why won't it work?

Also, can I say if ADCout = 929.5?
Does it return a var in int or double form?

Thanks again!!!!!!!!!!:)
 
It will work with 8 bit ADC's, just change the box with 1023 in it to 255 (max output for 8bits)

The sensor gives a voltage between 0V and 5V which you need to convert to a number. The inputs on the stamp (unless its got analog inputs?) are digital, ie. Low or High which isn't much use lol

It returns an 8 bit integer so you cant get decimals :)
 
Hmmm....

Well... 12 bit is definitely better :)

Is there a 14 or 16 bit system?
 
Originally posted by basil4j
It will work with 8 bit ADC's, just change the box with 1023 in it to 255 (max output for 8bits)

The sensor gives a voltage between 0V and 5V which you need to convert to a number. The inputs on the stamp (unless its got analog inputs?) are digital, ie. Low or High which isn't much use lol

It returns an 8 bit integer so you cant get decimals :)

And why 1023 bits? Not 1024? And how did you get that number?

thanks
 
There are 16bit ADC's out there :)
Microchip make good ones,but there are alot out there. Im using 12 bit and it gives me decent accuracy (i figured it out but cant remember the exact numbers)
 
Originally posted by ghost
And why 1023 bits? Not 1024? And how did you get that number?

thanks

Well binary 0000000000 =0 rather than 1, so 1111111111 = 1023 rather than 1024. it still gives 1024 possible results though :)
 
Originally posted by basil4j
Well binary 0000000000 =0 rather than 1, so 1111111111 = 1023 rather than 1024. it still gives 1024 possible results though :)

Of course! :p start counting at zero... like you do with data structures.

Now, I found some 22 bit ones :p , but I don't know which one: what's the diff between SOIC and MSOP (and Google didn't return any good results :( )?
 
Thats the package sizes. Both of those 2 are SMT packages...I think youll have better luck soldering SOIC :D

I assume you mean 15Mhz max sample rate for the ADC? (Megahertz?) Im only sampling mine at 200Hz (i.e. every 5ms). most altimeters sample around this speed it seems.
 
:mad: :mad: :mad:
Digikey doesn't appear to sell any SOIC ones in 12 bit. Maybe that's because I'm only looking under one model :rolleyes: :)

What did you use
 
OK... 14 bit... 8SOIC:
IC SERIAL ADC 14-BIT 5V LP 8SOIC
by Texas Instruments.

Hopefully I'll order the parts 2nite :)
 
2000 instructions per second is VERY slow. For altimeters I'd want at least 100,000. Most cheap MCUs go up to 8 million.

And transistors aren't FETs. Transistors won't safely deliver the power you are looking for. Look at Alec's altimeter thread and read are talks on Mosfets.

As for ADC, anything above 12 bits is going to be overkill, since the standard error of the sensor (around +/-1.5%) is going to be much bigger than your resolution (at 12 bits it's +/- 2 lsb out of 4096, or +/- 0.05%). There are tons of them in 8 pin soic packages on digikey.
 
I still don't get why transistor's won't work.

It seems like this job is perfectly suited for them.
 
And is 200kSPS fast enough?
That is equal to 200,000 instructions per second, right?

Thanks again! :) :D
 
Originally posted by ghost
I still don't get why transistor's won't work.

It seems like this job is perfectly suited for them.
Because transistors tend to break when you put a lot of current through them. Of course there are certain types that can take it, but they will be much more expensive and specialized than a simple mosfet that does the same job better.

Originally posted by ghost
And is 200kSPS fast enough?
That is equal to 200,000 instructions per second, right?

Thanks again! :) :D
Where does that number come from?
 
Okay - I'll look into mosfets.

I got that number from here (the TI datasheet):
https://focus.ti.com/docs/prod/folders/print/tlc3545.html
It's the 3545

thanks!

Also, would you mind recommending a MOSFET that can take an output 9V and be activated with anywhere from 5 to 9? Also, it should start open, but when current is applied it should close - and stay closed.

double thanks!
 
okay, 200kSPS, as I thought, means 200,000 samples per second, not instructions. The ADC does not execute any instructions--it just spits out data when the stamp tells it to. This means that your sampling speed is going to be limited by the stamp at 2000 instructions per second. Reading a value from a serial interface takes many instructions. For a 12 bit value, maybe 100 instructions, or 50 milliseconds. So your absolute sampling frequency will be 20 samples per second. Not bad for your purpose, if you're just comparing the values to some set number. If you want to do some data filtering or storage, then this won't be fast enough.

For FETs, there's an enormous diversity. First of all, mosfets don't work exactly like transistors, but it's easy to think about them in the same way for this applications.

Mosfets are thee terminal devices: gate (similar to the base of a transistor), drain, and source (similar to the emitter and collector). The state of a mosfet is determined not by current through the base, but by charge on the gate, or rather by the relative voltage between the gate and source. N-channel mosfets are saturated (closed) by applying a positive voltage to the gate, while P-channels are closed by a negative gate-to-source voltage. Stick with N-channels for now. They're just easier to work with.

some mosfet characteristics you want for this application are:
low on-state-resistance (<0.1 ohm).
good maximum current and power dissipation ratings (>10 amps, > 2 watts).
low gate threshold voltage (<5 volts) so your STAMP can drive the gate.

example: https://www.fairchildsemi.com/ds/ND/NDP4060L.pdf
 
Cool. Thank you.

Why does it take so many instructions to get the number from the ADC? Can't I simply create a new variable that has the output of the ADC? And then compare that output with my predetermined number? And then fire or don't fire? Isn't that only about 10 or 15 instructions?

Or do you need a bunch of code to interface with the ADC? THat wouldn't make much sense, because it seems like there is nothing to interface with - shouldn't it simply convert the signal from analog to digital?

Thanks!
 
Originally posted by ghost

Or do you need a bunch of code to interface with the ADC?
Yes. The value of the ADC doesn't just magically pop into the STAMP. It has to send the value piece by piece. Serial interface works a bit like this:

1. address the adc (tell it to take a sample)
2. Tell the adc to output the first bit of the value to the mcu.
3. Read that bit on the mcu input.
4. Shift that bit into your value register.
(repeat steps 2-4 twelve times, once for each bit)
5. Do your comparison stuff....

So simply reading the value will take up a fair amount of code.

There are tons of tutorials on this kind of stuff online. I don't know exactly how it works for STAMPs, so you'll have to there for actual code examples.
 
Yes. The stamp has tutorial code:

Code:
Symbol CS = 0
Symbol AD = pin1
Symbol CLK = 2
Symbol S_out = 3
Symbol data = b0
Symbol i = b2
setup: let pins = 255                    ' Pins high (deselect ADC).
let dirs = %11111101                   ' S_out, CLK, CS outputs; AD
                                                     ' input.
loop: gosub conv                          ' Get the data.
serout S_out,N2400,(#b0,13,10) ' Send data followed by a return
                                                     ' and linefeed.
pause 2000                                  ' Wait 2 seconds
goto loop                                      ' Do it forever.
conv: low CLK                               ' Put clock line in starting state.
low CS                                          ' Select ADC.
pulsout CLK, 1                              ' 10 us clock pulse.
let data = 0                                  ' Clear data.
for i = 1 to 8                                 ' Eight data bits.
let data = data * 2                       ' Perform shift left.
pulsout CLK, 1                              ' 10 us clock pulse.
let data = data + AD                    ' Put bit in LSB of data.
next                                              ' Do it again.
high CS                                        ' Deselect ADC when done.
return

I'm not exactly sure what this does, but it's published by Parallax for the BS1, so it should work (at least I hope it'll work :p)
 
Hello :)

There is alot of really usefull links I found after a quick google, this one came up first https://www.geocities.com/SiliconValley/Orchard/6633/altimeter.html

Writing code and getting the thing to work is one of the most enjoyable parts of designing these things I find, but a good reference never hurts :)

What do you think of this one? The schematic is different to yours, but the code looks easy to interperet.
 
Originally posted by mtwieg
For a 12 bit value, maybe 100 instructions, or 50 milliseconds.

Don't mean to brag, but I have a routine which can do 10 sample average of 12bits in <0.5ms ;)

Ok back on topic Alec, brag time over :D
 
Originally posted by Art Upton


I'd use a break wire rather then worry about filtering and debounce on the g-switch.

How close were the altitudes for the winners in this years TARC?

2006 the winners were only feet apart, and the resolution/calibration your going to get on this compared to the offical altimeter seems to be a large task your going to face with lots of trial flights and testing.

If you make the break wire about 850 ft long that might accomplish your goal. The circuitry is simpler too.
 
Originally posted by jderimig
If you make the break wire about 850 ft long that might accomplish your goal. The circuitry is simpler too.

LOL :D

that's the best idea i've ever heard ;)

Better yet, just tether it, so when it hits 850 feet, it just stops! GENIUS ;) ;) :D
 
Originally posted by basil4j
Don't mean to brag, but I have a routine which can do 10 sample average of 12bits in <0.5ms ;)

Ok back on topic Alec, brag time over :D

Do you accomplish this because of your processor or because of your programming?
 
Back
Top