SOLVED- Water level indicator

Hello all,

I' m currently working on a project based on

http://www.instructables.com/id/Water-Level-Indicator-with-Alarm/step2/The-Circuit/

I wanted to catch the water levels with an arduino .

The question is where and how connect this circuit to the digital ports of the arduino uno.

I'd like to keep the leds in order to have a one eye easy view on water tank level.

Can someone help me please.

Thank you in advance.

Bernard

Before we start explaining anything we need to know if you know ANYTHING about electronics. WHAT (if anything) DO you know about electronics (or arduinos for that matter) ?

The reason I ask is that the answer to your question is obvious to anyone who knows anything about electronics. When you post on the forum , you need to START by tellings us you background, otherwise we have no idea if you would understand anything we told you if we did. There is a language of electronics, and there are such concepts as "the basics" . For example , if you are talking about automobiles, I might ask if you know what "brakes" are , to which you might respond "of course !", but then when I ask you "what are rotors ?" you might draw a blank. Do you see my point. How am I going to explain to you how to check and replace your breaks if you don't even know what rotors are ?

Here's a hint: INPUT_PULLUP Ask me what this has to do with your post.

Something odd about that diagram, must be a new type of transistor. :confused:

Something odd about that diagram, must be a new type of transistor.

Are you referring to the fact that the transistors are backwards ?
BC547

WATER LEVEL DETECTOR.jpg

Hmmmm - obviously a new transistor type. At first I thought perhaps they had it right but had the image of the transistor inserted wrong, but no, it shows the collector to ground and the emitter high on an NPN. Maybe that is based on the new "politician logic" we keep hearing in the news? :confused:

Hmmmm - obviously a new transistor type. At first I thought perhaps they had it right but had the image of the transistor inserted wrong, but no, it shows the collector to ground and the emitter high on an NPN. Maybe that is based on the new "politician logic" we keep hearing in the news?

It's NPN. I think you know it's backwards. It's not going to work like that.

Here's the correct transistor for that circuit.

As you can see , there's no pullup on the base of the transistors. If there is no voltage on the base, they should be off. If the voltage is 0V, they should be on.

Also, if you look at the sensor circuit and then look at the tone generator, you don't see anything in the tone generator schematic that indicates how it interfaces to the circuit (aside from the 5V), but if you look at the circuit and then look at the tone generator schematic and think of the tone generator as a "Load" for the very TOP transistor, then it becomes obvious that the "GND" symbol of the tone generator goes to the emitter of the pnp and the collector of the pnp goes to ground so when the transistor turns on it sinks the tone generator current turning ON the tone generator by simply applying power to it (by sinking the current). Further inspection reveals no transistor "Q" numbers, a further indication of electronics inexperience (the most blaring one being the NPN transistors backwards with no base pullups , suggesting they should be PNPs.

Hello everybody.

What a huge amount of words for a simple (?) question.

Raschemmel, you’ re right, I’ ll introduce myself first.

I’ m living in Belgium, you know, a very small country above France…
My mother’s language is french, so be forgiving with the mistakes.
I’ m 62 years old and had some electronics courses 40 years ago.
I still work as sysadmin (monitoring, maintenance, backup of backend and streaming servers) for a telecom company providing TV services (live, PVR, nPVR, catchup) to customers.

So linux, solaris and nothing else like cradow$ ans mickeysoft.
I’ m building a domotic system with 1-wire captors, switches, arduino and attinny85 etc… driven by 2 raspberrypi some bash, php, mysql.

I’ m quite new in arduino usage and didn’t succeed in getting the led status of this water level indicator.
In fact, the indicator works. The leds are up when the captor point (via 33 ohm resistor) is behind the water level and off when the captor point is above.

But when I connect an arduino input to the cathod side of the led, the input is high, even if the led is OFF. I tried, like you suggested the usage of the pullup resistor, but without success.

That’ s why I decided to open this topic.

Many thanks for all.

Bernard

But when I connect an arduino input to the cathod side of the led, the input is high, even if the led is OFF. I tried, like you suggested the usage of the pullup resistor, but without success.

Ok Bernard, let's walk through the circuit and introduce you (again) to electronics.

First of all , the transistors are reversed in the schematic. If the circuit works , it means you connected them correctly despite the backwards schematic.

Second. you didn't specify WHICH arduino INPUTs you were referring to so will just guess you mean the GPIO digital and not analog.

Third, the cathode of the led is of no value for your objective. IF , as you say , the circuit WORKS, it is a simple matter to verify that by measuring the base voltage of a transistor and then the voltage on the pin that is NOT connected to GND. Post a closeup photo of a transistor and use PAINT to identify the pin numbers (as YOU understand them to be). I want to know WHICH transistor PIN number is connected to GND.

Fourth we need a voltage measurement on the transistor pin connected to the 470 ohm resistor , 1- With the LED OFF 2- With the LED ON

Measure the voltages on the transistors ( on the transistor pin connected to the 470 ohm resistor) that connected to the probes IN the water (state the condition of the associated led(on/off)

Measure the voltages on the transistors ( on the transistor pin connected to the 470 ohm resistor) that connected to the probes OUT of the water (state the condition of the associated led(on/off)

Confirm that the GND pin (pin-1) of the 555 chip is in fact connected to the pin of the TOP transistor (in the schematic) on the pin that is NOT connected to GND)

Confirm that the power pin of the 555 chip is connected to 5V.

Post the photo and the list of voltages.

What a huge amount of words for a simple (?) question.

If it's so simple why are posting for it ?

Do you want to play 20 questions ? (because that's what happens when not enough information is presented or exchanged. It happens on probably 50% of ALL forum posts for electronics. It is EXTREMELY rare for an OP to present ALL of the necessary information in the OP (Original Post) . I can't recall any such posts off the top of my head but I have seen them. We have seen a post about a single led run over 100 replies. (I don't remember the record for the most replies in a post but somebody mentioned it once) Many of the people on this forum are retired and have nothing better to do than answer posts. I'm not retired. Just long winded. (sorry but it is what it is...)

PS- we'll get to your question about the inputs after we get the details requested.

Raschemmel,

Indeed my intention is to use digital GPIO of the arduino, there are enough to measure 10 levels.

I really buy BC547B transistors and the pin number connected to ground is ???

Oupsss, confusing…

I found this image on internet to build my circuit and set it in my documentation.
Collector on the right.

BUT

Here (Fairchild) emitter is on the right (flat side facing you).

http://pdf.datasheetcatalog.com/datasheet/fairchild/BC547B.pdf

Here (Motorola) emitter is on the right (flat side facing you).

http://pdf.datasheetcatalog.com/datasheet/motorola/BC546B.pdf

Phillips, Siemens and others are placing emitter on the right too.

So I build it wrong way (that’s maybe why it works :wink:

I will buid it on a breadboard and take the measures you ask.

Bernard

BC547-500x416.jpg

Exactly. You connected the emitters to GND. which is the only way it could work. If you take a few minutes to google NPN circuits you'll see the emitter is typically tied to GND and the load is connected to collector. For your circuit the load is the resistor and led in series. The arduino INPUTS will be connected to the collector with pinMode configured with "INPUT_PULLUP". The pullup resistors will be in parallel with the load. When the transistor is off the aduino will "see" a HIGH". When it tirns on it will "see" a LOW. Very simple.

outsider: Something odd about that diagram, must be a new type of transistor. :confused:

The emitters and collectors are swapped in the diagram - a lot of instructibles are riddled with mistakes or bad circuits, and there appears to be no quality control mechanisms or ways to improve/correct them.

Yessssss,

it works…

you’ re right, I made a ‘good’ mistake. Putting the transistor wrong way, I made it work.

And now I’ m taking the level on collector and with the INPUT_PULLUP I properly have the status (inverted) of the digital port. Arduino is sending the values in my raspberrypi’s logs via the serial port.

0,0,1,1,1,1,1,1,1,1
0,0,1,1,1,1,1,1,1,1
0,0,1,1,1,1,1,1,1,1
0,0,1,1,1,1,1,1,1,1
0,0,1,1,1,1,1,1,1,1

This means that I have two captors under the water (2 LEDS ON) so my tank level is 20% (around 1300 litters).

Many thanks to all of you who spend some (lot) time to answer to my question and solved it.

Bernard

DC in water is very prone to cause corrosion very quickly, depending on the materials you used. I discussed a few alternatives in an older post here

And now I’ m taking the level on collector and with the INPUT_PULLUP I properly have the status (inverted) of the digital port. Arduino is sending the values in my raspberrypi’s logs via the serial port.

Did you measure any voltages ?

@OP, In order for the "[SOLVED]" to show up in the topic menu you have to edit the OP (Original Post) and insert it there. That's the topic label that's used for the Topic menu, not the last one you posted.

Hello,

no I didn't measure voltages because it worked, but I can if you want more informations :-)

About corrosion I had a bad experience with aluminium and I immediately moved to inox, still some improvements to be done about the junction between coper (treads) and inox. Epoxy is not 100% or maybe the way I use it must be perfected.

What is "inox"?

Sorry,

that's french :-)

Stainless steel.

https://en.wikipedia.org/wiki/Stainless_steel.

Bernard

That will corrode, too. Especially with a DC current through it.

Yes, it is important to understand the difference between "rusting" (oxidation) and what happens with electrolysis - you can make gold dissolve running a current through it in an acid solution (other stuff too). Electrolysis can be very bad in metal structures (which is why you find zinc or other protective measures) on boats etc. in marine applications.