Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

drischar

Member Since 17 Mar 2012
Offline Last Active Apr 05 2012 09:51 PM
-----

Posts I've Made

In Topic: AnalogInput Repeatability

31 March 2012 - 01:54 AM

If you have a low sampling frequency requirement, I solved this by taking about 30 samples over a second and calculating a median value to use. Any use?

Definitely, I've decided to poll the value a dozen times or so, toss out the max and min, and take the average. This is yielding great results, and it doesn't seem to take an inordinate amount of time to do it.

I just call AnalogInput.Read() in a for loop, do you find it's usefull to put a delay in as well to space out the readings?

In Topic: AnalogInput Repeatability

30 March 2012 - 08:34 AM



Only apparently.
Your multimeter gets you 3-4 readings per second, thus its filtering on the input is *very* effective. The Netduino is able to sample its analog input at 1k/sec.

Suppose having a ripple sine wave of the mains entering in the wires (50 or 60Hz). Let's say 100 mV of amplitude out of 120 or 230VAC (I don't know your mains voltage). The multimeter filters so much the input that a similar frequency is totally irrelevant. At contrary, the Netduino could shape the sine wave almost perfectly, yielding you the "real" noise on the input.

That was just an example to make you understanding how the things could be.
Cheers

That was what I meant by "but I don't have the ability to see changes of short duration."

In Topic: AnalogInput Repeatability

30 March 2012 - 07:17 AM

I agree with Magpie.
Major problems around the ADC are coming out from the noise over the supply and/or the Aref. Your wall adapter could be a good supply, but if it's a high-efficiency adapter (i.e. switch-mode) it generates *ton* of noise.
Exactly the same issue is when you plug the Ethernet cable to the Plus: the noise is getting much higher, and the ADC gets crazy as well.
Please, try to perform the *same* test as above, by using a normal 9V battery. Don't connect any thing else (i.e. the USB cable): just the 9V and, if you want, the multimeter.

Finally, bear in mind that the ADC embedded in the MCUs are not generally much reliable. They're fine for rough readings, let's say to discard one-two LSBs out of the 10 available.
In our high-end devices we *always* use an external ADC (which it costs as much as half at the whole MCU), and a dedicated, well designed Aref generator. That's not coming for free, though!

Hope it helps.
Cheers

I hooked Aref and the trimpot up to my benchtop power supply with a multimeter running as well. I'm not seeing so much as a millivolt change, and I do seem to be getting slightly more accurate results:
784 (0 change)
785 (1 change)
785 (0 change)
784 (-1 change)
786 (2 change)
785 (-1 change)
785 (0 change)
785 (0 change)
785 (0 change)
784 (-1 change)
784 (0 change)
784 (0 change)
784 (0 change)
785 (1 change)
786 (1 change)
785 (-1 change)
785 (0 change)
785 (0 change)
785 (0 change)
It's a major shame that the 3.3V is so bouncy. When I hook my meter up to the 3.3V supply on the board it looks stable (this is using the Neetduino's 3.3v regulator), but I don't have the ability to see changes of short duration.

In Topic: AnalogInput Repeatability

30 March 2012 - 07:03 AM

I suspect its is noise on your voltage reference.

I have got best results using a dedicated Voltage regulator into Aref.
Use Vin as your input and ARef on your output. You also need a load resistor so that the voltage regulator's minimum drive is satisfied. (around 1k?)
If you have a 7805 you could pad the output down to 3.3v using resistors before putting into AREF.

ps. You will need a line of code to use ARef as well.

Sorry gotto go. It's beer o'clock.

Interesting. I should have a 3.3v regulator around here somewhere but I'm not sure why it would be unsteady if the power supply wasn't having issues. Just on a whim I connected A0 to Aref to make sure I would get a steady value. Theoretically, even if the voltage were to waver, shouldn't I expect it would still result in 1023 every time? After all, if the voltage from the 3.3V pin were to drop to say 3.1, then I'd be comparing 3.1V to 3.1V which would still yield 1023.

This does seem to bear out. I still get some 4 step changes, but I imagine that's unrelated. I see way more 0s here thant before, but then again, that's probably because its impossible to return a value > 1023. I'll try using an external aref and see if it helps.
1023 (0 change)
1023 (0 change)
1023 (0 change)
1023 (0 change)
1022 (-1 change)
1023 (1 change)
1019 (-4 change)
1023 (4 change)
1023 (0 change)
1023 (0 change)
1023 (0 change)
1023 (0 change)
1021 (-2 change)
1023 (2 change)
1023 (0 change)
1023 (0 change)
1023 (0 change)

In Topic: Connecting 5v sensors to AnalogInput

28 March 2012 - 01:27 AM

The pressure sensor that I am using is a Freescale MPX4250GP. Freescale has other sensors, but none that quite meet my requiremnts for pressure range. The idea is that the sensor reads CO2 pressure on a keg of beer which can range from 0 to 30psi (this sensor supports 0 to 36psi). Normally, I would have just about any beer at around 10-15psi which puts the output of the sensor within the 3.3V range (should be... I need to check with a multimeter but my CO2 tank is empty), but in the end it would be best to support the full range, which will require an external ADC. I'll just let the ADC communicate with the Netduino at 5V.

I'm still looking at the MCP3002 (it's the only standalone ADC I can find at Sparkfun). I've never done SPI before, but I'm always up for something new.

Alright, I finally picked up the hardware to convert the tubing on my tank down to the 1/8" inside diameter tubing to connect to the pressure sensor. My tank wasn't quite empty (no liquid, but stil enough gas to run a test). I hooked up the sensor, and then eyeballed the values from the guage and I'm pretty accurate according to what the datasheet says I should be getting.

The bottom line is, I don't hit the 3.3V limit until I reach nearly 24psi. At a temperature of 37*F that allows me to put 3.75 volumes of CO2 into a beer and still be able to handle the value on the Netduino ADC. That covers just about any style of beer I will put in there. If I were to put homemade soda, I'd want to raise it to 4volumes, which puts me at 30psi but that would be such a rare occasion I probably dont need to design for it (I can remove the sensor when that happens).

So thanks for all the help. It looks like I'll just be connecting the sensor directly to the arduino, and never raising the guage above 24 while it is connected. To be honest, I'd be afraid of >24psi on that thing anyhow.

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.