MCP3008 and transducers

Hi all...

ok, full disclosure, not 100% Arduino based, but guessing most here will know electronics better than me.

Transducer is 5V DC input, output is 0-3.3V
MCP3008 is 2.5 - 5.8V
Want to power the MCP => VCC and vRef wit 3.3V
Power the Transducer via a separate 5V.
All grounds are to be connected,

I'm using Rpi platform, simply because I have allot of them and comfortable with Python.
At the moment I've figured out I can introduce more stability on the MCP by grounding the unused analog inputs.

I am however having measurements that fluctuates like a wave... See below...

https://www.aliexpress.com/item/1005006258321416.html?spm=a2g0o.order_list.order_list_main.11.3e211802VNe9KH

https://www.aliexpress.com/item/1005007554736988.html?spm=a2g0o.order_list.order_list_main.15.3e211802VNe9KH

See the first column, that was with the transducer powered by 3.3V

| 412 | 0 | 0 | 0 | 0 | 989 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 989 | 0 | 0 |
| 116 | 0 | 0 | 0 | 0 | 990 | 0 | 0 |
| 512 | 0 | 0 | 0 | 0 | 989 | 0 | 0 |
| 597 | 0 | 0 | 0 | 0 | 989 | 0 | 0 |
| 581 | 0 | 0 | 0 | 0 | 990 | 0 | 0 |
| 579 | 0 | 0 | 0 | 0 | 989 | 0 | 0 |
| 582 | 0 | 0 | 0 | 0 | 990 | 0 | 0 |
| 459 | 0 | 0 | 0 | 0 | 989 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 989 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 990 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 990 | 0 | 0 |
| 38 | 0 | 0 | 0 | 0 | 989 | 0 | 0 |
| 588 | 0 | 0 | 0 | 0 | 990 | 0 | 0 |
| 585 | 0 | 0 | 0 | 0 | 990 | 0 | 0 |
| 581 | 0 | 0 | 0 | 0 | 990 | 0 | 0 |
| 584 | 0 | 0 | 0 | 0 | 990 | 0 | 0 |
| 287 | 0 | 0 | 0 | 0 | 990 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 990 | 0 | 0 |
| 0 | 0 | 0 | 0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 | 571 | 0 | 0 |
| 591 | 0 | 0 | 0 | 0 | 572 | 0 | 0 |
| 608 | 0 | 0 | 0 | 0 | 571 | 0 | 0 |
| 596 | 0 | 0 | 0 | 0 | 571 | 0 | 0 |

Got the below when I powered it by 5V, channel 6 is a 10k pot powered by the 3.3V line.
Need to retry and install the sensor in test pipe, power by 5V again and see if this 1023 (lying on desk with 0 pressure) translates to a stable reading when I add water to test pipe...

| 1023 | 3 | 2 | 2 | 2 | 740 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 739 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 740 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 738 | 3 | 3 |
| 1023 | 2 | 2 | 2 | 2 | 731 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 740 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 743 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 740 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 743 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 745 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 741 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 743 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 733 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 743 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 744 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 745 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 745 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 745 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 745 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 745 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 745 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 745 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 745 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 747 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 746 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 747 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 746 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 745 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 745 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 745 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 746 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 746 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 745 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 700 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 522 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 430 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 426 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 427 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 347 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 94 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 50 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 93 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 290 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 514 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 608 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 617 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 617 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 617 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 620 | 3 | 3 |
| 1023 | 3 | 2 | 2 | 2 | 620 | 3 | 3 |

What is the frequency of the "wave" in the first column? (timestamps?)
Datasheet of the sensors?

The link to you sensor is 404 page not found.
Please post the data sheet.

The sensors are from AliExpress... they not good on data sheets...
the wave is 0.5 seconds between each reading.
but i have the same wavy if done via another program at 9second interval

lets try the links again.

This sensor is working as well as i can expect... and thats even on 3.3V DC input, even though my units are 5V input: This is channel 6 on the above.
Drop in sensor, channel 6

These units are just all over the place, this is the channel 0
Screw in sensor - 2, channel 0

I got the screw in sensors cabled using 4 core phone cable.... but was wondering if thats the problem so the last test was using crocodile clamps directly onto the sensors contact pins, onto proto board pins,

G

That's a not a good supplier then,,,, Why buy things not having documentation unless You already know them?
No device is jumping into position by itself.

ok... butI now have 4 sensors for my home automation, 3 x 0.5bar for 3m high water tanks and 1 x 10bar for reading water line pressure after the booster pump.

Still need to fix this for the sensors.

G

It seems likely that you have a grounding and/or interference problem with long leads.

Please post the code, using code tags, a complete wiring diagram with pins and connections clearly labeled (hand drawn is fine), and a photo of the setup.

Solve the fist problem before adding more stuff.

I have one sensor, of the one type thats stable... and then 2 of the 2nd type not.
same code.

Wiring diagrams.
See below. the image showing 3 sensors... imaging thats 1 of the drop in type and 2 of the screw type.


will upload code to git and post here in a second
G

Waterlevel

this shows all connected to 3.3V.

As asked above.... if/can i connect sensors to 5v and MCP3008 to 3.3V.

G

so…

Looks like i figured it out…

don’t trust markings on one part, take more and more apart…

As can be seen on this diagram, Notice the what looks like a Dot, a indicator mark… on the Left, between the Post top and Neg bottom,

as if when you take the top cover off, see mark little mark and then wire according to that, as there is no numbers… well that was exactly wrong way round…

if i take the top plastic off the bottom cylinder… bottom of that plastic was numbers… and this view… so user error, I swopped the cables around… re-installed and it read spot on, like to the cm of water…