Water tank level sensor schematic feedback

Hello everyone,

Let me start by saying that I'm not an engineer, so my schematic or understanding of electronics knowledge might be a bit... lacking.

That being said, I have an underground water tank, and I want to have some way of measuring the level of water inside it.

I previously tried with a time-of-flight sensor, but i had mainly two issues :

  • the distance between the sensor and the arduino (a few meters), which was too big for I2C.
    This might have been solved with some I2C extender, but...
  • the sensor was exposed to humidity, cobwebs, ... which was impacting its readings.
    I could have created a waterproof enclosure, but it seemed like more work.

After more research, I'm now considering using a submersible pressure sensor.
I could drop it in the bottom of the tank.
Most of them use a 4-20mA current loop, which could solve the distance issue (not sure yet what AWG I should use, or if I should use an electric sheath or something).

I tried to make a schematic with KiCad, and I'd like to have your feedback.
A few points :

  • I opted for an arduino nano 33 IoT, so I can send data through WiFi
  • It apparently supports up to 24v (I'll use a 12v wall wart) for power
  • It only supports 3.3v for I/O, so I'm using two voltage regulators :
    -- one to drop from 12v to 5v for an oled display
    -- from where I drop again from 5v to 3.3v for I/O (a button)
  • The wiring of the pressure sensor is inspired by the following comment : Measuring 4 ... 20 mA from using 12 VDC, 2 Wire or 3 Wire - #4 by Wawa
    I'm not entirely sure if the R5 10k resistor is correctly placed.

Thanks a lot !

David

EDIT: here's an updated version based on your feedbacks :

Can't you use the internal pull-up resistor for your display switch?

1 Like

I thought so initially, but then I saw in the datasheet :

Also, as opposed to Arduino Nano boards that support 5V
operation, the 5V pin does NOT supply voltage but is rather connected, through a jumper, to the USB power input.

So I guess not :confused:

I misunderstood, yes I guess I could use it, I'll take a look at how to achieve that, thanks for the suggestion !

R4 would give 1V at 20mA, . R5 with 10k is a bit big but should work.

1 Like

I initially used a nano v3, I'm not sure what the internal reference voltage is for the nano 33 IoT.
I suppose I cannot exceed that voltage at 20mA ?

From what I can see, the nano 33 IoT has a SAMD board, so I could set the analogReference to AR_INTERNAL1V0 (a built-in 1.0V reference) or AR_INTERNAL1V65 (a built-in 1.65V reference).

Maybe AR_INTERNAL1V65 to be sure ?
So my sensor would be between 0,2V (4mA) and 1,02V (20mA).

Doesn't make sense.
The button doesn't need 3.3volt if you wire it between pin and ground, and use internal pull up.
The oled should have a 3.3volt pin, so you can power it from the 3.3volt pin of the Nano.
Leo..

1 Like

If your sensor has a short circuit you have 12V at A0, 'cause you do not have a voltage divider from sensor-out to A0. Should be be ~ 1/3.6 at a total of 600 Ohm.

1 Like

Thank you Leo, I updated the schematic for that part.

Hello, I thought that was what the D1 diode was for ?

Nop, that diode is there for cosmetic reasons, but not for functionality. If that were a 3V zener diode than it had reason to be there - but it would most likely burn when the sensor wires short.

1 Like

The diode is there in case you accidentally connect a negative voltage to the sensor input.
This is sometimes seen on other circuit diagrams, but maybe not needed here.

If you set Aref to 1volt, then you can still safely have 3.3volt (VCC) on the MCU pin.

Which oled (link), because you still power it externally.
Leo..

1 Like

I think it was inspired by one of your suggestion in another topic :wink:
I'll remove it as it isn't indeed needed here, and put a voltage divider there.

For the oled, I had one lying around that I bought from ebay, but I can't find the datasheet anymore.
I think I'll just order another one that I can power from the 3.3v from the arduino.

That way I can get rid of the buck converter as well.
Maybe I can just move it between the sensor and A0 ? Or should I put something else in case the sensor shorts to avoid frying my arduino ?

Thanks !

I could for instance order this OLED : 1.3 inch OLED Display I2C SSH1106 Chip 128 x 64 Pixel I2C display module

which is accepting 3.3V to 5V.

My two cents:

Reverse polarity protection
Over voltage protection
724 Hz Low pass filter

1 Like

Thank you all for your help.

I'm still not completely understanding how to protect the MCU pin from a potential short causing an over voltage.

From what I understand so far, the current loop operates at 12v.
Data is then sent through the output with a current varying from 4 to 20mA, which is converted to voltage with a resistor (51ohm in my case).

In case there's a short somewhere, I could receive 12v instead of the 4-20mA, is that right ?
And I need to protect against that ?

Where do I put the voltage divider then ? At the sensor end, before the resistor ?
So instead of receiving between 4 and 20mA at 12V, I receive it at 3.3V for instance ?
Or do I need to go back studying electricity for a while ? :slight_smile:

I suspect an OPEN circuit might get you 12 volts rather than a short circuit!

1 Like

When the sensor is faulty or the wires to/from the sensor have contact then snsor-out is +12V. The schematic from jim-p solves all the problems. If you do not understand how it works: I=U/R ... insert values and observe.

1 Like

? Removing the diode is ok, but don't change the circuit.

Upload a picture. Maybe we can tell.

A zener doesn't have a sharp knee-point, so could introduce errors in the top end of the sensor range. Avoid if you can.
Leo..

1 Like