PICAXE Altitude Datalogger

testerrrs

New Member
Hi all,

I'm looking at using a "Motorola altitude sensor - MPX4115" along with the readadc10 command on a PICAXE-18X IC to measure the highest altitude reached by the device.

Has anyone got any suggestions or help on how I should go about doing this?

How can I get the maximum possible resolution?

Is it worth going for a 12bit ADC, and if so, how would I interface this with the PICAXE?

Thanks all,

Jon
 

Jeremy Leach

Senior Member
Hi

I've used one of these for a barometer. You can't use the output directly into the picaxe because the voltage variation is only small on the output of the device. So there's two ways to go:

1: Use dual op amp package (suitable for single supply) to 'condition' the output voltage of the MPX4115 into a range that's useable for the picaxe. This is done by using the op-amps to apply first 'offset' and then 'gain'.

I've tried this, with multi-turn pots to get the gain and offset right - but it's not easy.

2. Use a voltage to frequency converter like the LM331 to convert the voltage from the MPX4115 into a square wave signal with a frequency proportional to the voltage, and use the picaxe Count command to calculate the frequency and therefore the voltage.

I've not tried 2, but would be my option of choice now. The LM331 is cheap. You'd need good quality components with the LM331 to get the best results. Ok, you might need a longish sample time with the Count command to get a decent resolution, but I think it would be an easier solution to get working well than the op-amp solution.

Just my personal opinion though.


Edited by - jeremy leach on 10/05/2007 21:54:56
 

Jeremy Leach

Senior Member
Actually, I can think of an issue with the Voltage to frequency approach. Unless you've got a picaxe with an external crystal setting a very accurate picaxe clock frequency, the count command won't have an accurate timebase. So even for a fixed incoming frequency it might give different results.

For a picaxe without a crystal, you could use a calibration method. You could have a Real Time Clock chip like the DS1307 that outputs a 1 Hz signal, and use the Pulsin command to measure the width of the 500ms pulse from this signal. But it could seem like a lot of overhead !


Edited by - jeremy leach on 11/05/2007 13:18:27
 
Top