Linear pressure transducer -> MQTT - Page 1
Forum section: electronics / beginners

author: paulca
author_rank: Super Contributor
timestamp: June 06, 2024, 12:31:21 pm
content: I want to make a 'smart' device PSI gauge. Yes, I want to add more to my data habit in the form of bar keg pressure and fermentation pressure.https://www.ebay.co.uk/itm/166056288795?var=465562529945I picked a random pressure transducer for 100PSI. Annoyingly I could not find these easily in BSP or BSPT. So I also had to buy fittings to convert it to 5/16"/8mm push fit.I believe it's a linear signal voltage where 0.5V = 0PSI and 4.5V = 100PSI.The pressure ranges I am interested in are:0-30PSI Fermentation0-40PSI Carbonation0-15PSI ServingMax system pressure 45PSI.Accuracy, +/- 0.5PSIResolution, 3 sigfig / tenth PSI.A 4V range for 100PSI = 25PSI per volt. Which is 40mV per PSI.A quick look at the ESP32 as target platform makes me sad on the ADC. It's not even accurate to 40mV. It will also require stepping down with a divider as I think the max ADC in is 2.9V or something dumb?So. I will need to employ an off chip I2C ADC. I will still probably need to divide the 0.5-4.5V signal down a notch with 1% resistors. So it's more like 0.3-3.0VAssuming a basic 10bit ADC I should be able to get a theoretical/ideal 1024 steps. 100PSI / 1024 ~= 0.1PSI. Sounds like a fine "resolution" target for the required accuracy?So the ESP32 just needs to either poll the ADC and send on via MQTT or if I use a "nice" ADC with triggers I can shut the ESP32 down and boot it off the ADC trigger if the value changes by more than 0.25PSI.As the transducer has a fly lead on it the packaging of "this" device is unimportant. A couple of aliexpress modules hot glued together down behind hte fridge is fine. I have many options for connectors for the transducers.Power will come from a USB adapter.The sampling resolution does not need to be any higher than a couple of times a minute at most, but if pressure is stable a report every half an hour will do. So basically even if I am in "live poll" or "continous sample" mode, I will only be interested in samples ever 30 seconds. No high rate sampling.This should allow me to make good use of a multi-channel ADC and support umpteen transducers. I can even allow a recalibration time between switching channels. Leisurely.Do you see any pitfalls or things I have missed?

author: CaptDon
author_rank: Super Contributor
timestamp: June 06, 2024, 12:52:19 pm
content: Since many ADC devices allow you to offset the zero point and also adjust the full scale voltage you could adjust with trimmer pots / resistors to take advantage of using the full 1024 steps across only your range of interest. If the highest P.S.I. you intend to measure is 45 then why not use a 50 P.S.I. sensor? Anyway, as stated before, you can adjust your ADC span to only cover the exact range of interest 0-50 P.S.I. taking advantage of probably 1000 of the 1024 steps and allowing for a bit of over range on the high end. At the end of the day you are going to have to calibrate the rig for accuracy. Most pressure sensors have a pretty wide spec for zero and full scale and will always require a final system wide calibration end to end.

author: paulca
author_rank: Super Contributor
timestamp: June 06, 2024, 02:27:04 pm
content: Thanks. I was thinking I could offset and scale the ADC window to maximise the resolution.I picked a 100PSI gauge as the options where 30PSI or 100PSI. I realise now there are a dozen different sellers and a little more searching would probably find me a 50PSI gauge.On calibration. I 100% intend to keep the analogue gauges on the lines. So recalibration at any time should just be a matter of "Enter the real value now" If I find I have non-linearity in the range, thats a different problem.

author: Benta
author_rank: Super Contributor
timestamp: June 06, 2024, 03:34:12 pm
content: One important thing to look for in pressure sensors is "media compatibility", meaning what gasses or fluids it will withstand.

author: paulca
author_rank: Super Contributor
timestamp: June 14, 2024, 12:02:56 pm
content: Quote from: Benta on June 06, 2024, 03:34:12 pmIt says it's supports everything and anything of course it does. LOLI believe the target market is auto for reading fuel pressure or turbo line pressure. I figured if it can stand that environment it should be fine with CO2. Time will tell though.Anyway... it arrived. Needs PTFE tape to seal which took me a whole set of depressurized kegs and foam in the regulator to discover. Better that way than dumping a bottle of CO2 into the room. (My gas supply is left OFF unless there is a specific reason for it to be on. The 550PSI gas trapped bottle side of the regulator under normal circumstances will hold pressure absolutely fine). Ironically if the sensor was in place and functioning it would have warned me of the leak long before it got that bad.I have an ADS1115 ADC which looks like it fits the bill. I have an ESP32 devboard. The ADS1115 I believe supports both 3V and 5V power and logic. The ESP32 however doesn't. It's 3V unless you want to "yolo" it and ymmv.As I have a 100PSI guage and the maximum pressure I "should" hit it with is 45PSI. Then I shouldn't technically need to worry. I can just power the ADS1115 from the ESP32 3.3V rail and even narrow the range (not read the datasheet yet) to the range of interest.Would it be prudent to place a white LED+R to ground on the signal line, such that in the event the sensor does send more than 3V it just conducts to ground?

author: ArdWar
author_rank: Frequent Contributor
timestamp: June 14, 2024, 01:28:00 pm
content: Quote from: paulca on June 14, 2024, 12:02:56 pmThat won't save your ADC. You need a series resistor and either a steering diode to 3V3 or a 3v3 Zener/TVS to GND, or both.