How to break low voltage circuit?

Hello.

I'm using an Arduino Uno board to open a close a solenoid valve (12V, 0,5A) with a BJT Transistor (NPN 80V 10A) (KSE44)
(Datasheet here:
KSE44H11 TRANSISTOR NPN 80V 10A TO-220 Fairchild Semiconductor datasheet pdf data sheet FREE from datasheetz.com )

It works great. I thought I could open and close a low voltage circuit with this transistor just like I turn the solenoid on and off.
By the low voltage circuit I mean below from 0V to 3,3 V. However, I came across the problem that my idea doesn't work.

I pass a 3,3 V from the Arduino's 3.3 output through a small volume of water (2 wire system), and I 'd like to break this circuit using a transistor. To its base I apply output of a digital pin (5V) as LOW or HIGH, the collector is a Cathode from the water, and emitter goes to an analog input where I measure how much voltage went through.

When the base has a LOW input, everything works great - that is - the analog input shows "0" (I have a pull down resistor). But, when the base has a HIGH input, the analog input always shows some voltage, even though I pull out the Cathode out of the water (which should result in no current between the collector and emitter).
However, even if there is no voltage between the collector and emitter, the analog inputs detect voltage.
It is a problem, since I need to know when the wire in the water and when it is not.

The above is a part of my bigger project where I need to control a water level in a small water container. Actually, I use a 3 wire system - 1st wire supplies current to water, the 2nd wire is for the low water level, and the 3rd wire is for the high water level.
I believed that I could turn off the 2nd wire (the case described above) to eliminate the hydrolysis while water goes to the high level (wire 3), which would in turn apply a HIGH value to the solenoid's and 2nd wire's transistors' bases. They would work until water goes below the low level (when 2nd wire out of water) thus sending LOW to the transistors' bases closing the valve and breaking the 2nd wire circuit.

I hope it is not confusing.
I have a background from computer science, but not so much from electronics.
From what I've read on the Internet, a transistor is also an amplifier.

How could I fix this issue?
If there is a better solution to the problem than using a transistor, I would be happy to know.

Sorry, your description doesn't make sense. Please post a hand drawn diagram showing all the connections, identifying the Arduino inputs and outputs, labeling the transistor C, B and E leads, the power supply connections, and any other parts and their respective connections.

Note: "voltage" does not "go through". Current flows in a circuit, as a result of a voltage difference.

Thank you for your quick reply.
I've attached a drawing I have previously made to discuss with my colleges but no one seems to know electronics so well.

Your description is not real clear, however, from what I am reading, a couple of things show up. First the npn transistor base looks like a diode from the base to the emitter - you should have a base resistor instead of directly applying 5v to it. The second thing, you indicate you are somehow applying the emitter to the analog input to try and measure current. What you are going to see like that is the current into the base flowing to the emitter and the analog input (which is relatively high impedance) will see typically the output of the high from the arduino minus the diode drop - probably around 4 volts. If you want to measure current, you need to have a low value series resistor you are passing the current through then measure the voltage across that resistor to calculate the current flowing in it. (well, there are other current sensors out there, but this is the most common for something like this). We really need to see a schematic though of how you are hooking this up. Also, remember that pure water is actually a pretty good insulator.

Hi,

Why do you want to turn your input signal OFF?
Also can you include transistor part numbers.

Thanks.. Tom... :slight_smile:

TomGeorge:
Hi,

Why do you want to turn your input signal OFF?
Also can you include transistor part numbers.

Thanks.. Tom... :slight_smile:

Actually he did include a link to the transistor - it is a KSE44H11 which is a NPN, TO-220 case 80v, 8A transistor (seems like just a bit of overkill here :o )

Here is a clickable version of the KSE44H11 TRANSISTOR NPN 80V 10A TO-220 Fairchild Semiconductor datasheet pdf data sheet FREE from datasheetz.com datasheet.

Here is a better link though to the datasheet: Intelligent Power and Sensing Technologies | onsemi

Just finished a hand drawing of the system's principle.
I used just simple logic to express what the set up is supposed to do, and not the correct programming language.
The problem is, that the analogRead(A1) is never below ~400 (even when there is no water between the wires), thus the digitalWrite(7,LOW) doesn't happen.
In fact, even if there is a current between the wires (Anode and Cathode), the value of analogRead(A1) increases just too little (to ~500) which makes it hard to calculate if there is water above the low level or not.

As for the choice of this transistor, yes, it's overkill. I wanted to be on a safer side since it's my first Arduino.

What I hoped to see is a near zero value of analogRead(A1) when it's wire is above the water level.

That circuit will never work like that.
Current flows from D7 (when HIGH), throught the BE diode of the transistor, to A1.
The A/D will always read ~800.

It seems you want to measure the level in a tank with wires of different length hanging in the water.

If so, then try this:
1k resistor from pin7 to the first wire.
1k resistor from pin7 to the second wire.
etc.

10k resistor from A0 to ground, and A0 connected to the first wire.
10k resistor from A1 to ground, and A1 connected to the second wire.
etc.

The code:
Write a HIGH to output pin7.
Measure the analogue inputs one after the other.
Write a LOW to pin7.

Repeat after some time has passed.
Leo..

What exactly are you trying to do? Is it a level sensor?

Your circuit makes little sense, the symbol and the labelling of the transistor contradict. Why have a transistor at all?

Thank you for your advice.
I didn't know how transistors really work.

Yes, it is a water level measurement system.
I am a university student, and need this for my hydrology research.
The accuracy of the system has to be high (in 0.1 ml of water).
I made it, and it works. However, the anode breaks down too fast, that is why i thought to use a transistor to break the circuit to stop the flow of current between the wires.
As of now, i use carbon rods from pencils as anode and cathods and swich the polarity via pins high and low values.
It works too, but the electolysis is still present.
The system sends signal to a computer where i log in Excel the time when the valve opened and closed.
Everything works smoothly, and the only issue is the corrosion.

Do you think there is no way to break a circuit between the Anode and Cathode (A1)?

Attached is my early designs without the carbon rods.
I can't check the level of water periodically, as i need to know in seconds where the level is.
Every drop counts :slight_smile:

I'm going to expand the system to 12 valves . Already got the multiplexer.
I thought to have a common current supply for all 12 water samples (anodes) from the 3.3V output (5.5V creates more corrosion). And turn off cathodes in each sample independantly.

You could measure with AC to minimise corrosion.

Use one long central electrode, and connect it to Arduino ground.
100k resistor between a digital pin and A0.
100k resistor between the same digital pin and A1.
More if needed.
Connect 100uF capacitors between the analogue pins and the "hot" electrodes (+cap to the analogue pin).
Hot electrodes in a circle around the central ground electrode, e.g. against the wall of the tube.

Code:
Write a HIGH to the digital pin.
Measure the analogue inputs, and store the A/D value in "highValue1", "highValue2" variables.
After some time has passed, write a LOW to the pin, and store in multiple "lowValue*" variables.
Subtract to find the difference. Less difference is more conductivity.
After some time has passed, repeat the process.
Make sure the HIGH time and LOW time of the digital pin is the same. Use millis().

This way you only have AC on the electrodes, because the capacitor blocks DC.
The full peak/peak of the square wave is seen by the digital input without water between the two electrodes.
And part of the square wave is shunted to ground with water between electrodes.
Leo..

Latlive:
...
The accuracy of the system has to be high (in 0.1 ml of water).
...

This application sounds feasible, but the level of ... precision you require might be difficult to achieve with the pencil lead sensor. The pipe looks like it's about an inch in diameter. This means that a tenth of a milliliter amounts to slightly less than 0.2 mm of water height. Are the numbers consistent enough when you test the conductivity from lead to lead?

Hi
You could apply 5V or 3.3V only when you need to make a measurement.
That way all your electrodes are at the same potential when idle.


100k resistors may help make your analog readings better, 0.1uF caps will help with noise.

Tom... :slight_smile:

Good time of the day, all.
Great ideas! Thank you so much.

The sensor for LOW water level actually should work only after 'the water reached TOP level and the valve is open' thus sensing for the LOW water level and, therefore, knowing when to close the valve. All the other times this LOW level sensor is not used. Due to the nature of my samples, water can come as low as 10 ml/hour or as high as 700 ml/hour.

@Tom,
what application do you use for drawing circuits?
I use the Circuits.io website, but with my old laptop I can't properly work there. The other one I use is a Quite Universal Circuit Simulator (QUCS) (really good one) but it doesn't have the Arduino board.

@ChrisTenone,
I take the measurements every 40 ms, that is why the results are accurate. I was able to get consistent measurements. On the picture is my first trial, and the tube is around 1", I believe. For the final product, I'll try to get a 0,5" tube so that the accuracy would be greater.
I wasn't sure how accurate the system could be, so I bought only 1 solenoid valve to test it. I'm confident now, so I purchased more valves, and extra things to expand the system.

Since I live in a small city, I have to order everything online. I can ask to borrow capacitors from my uni's computer lab.

@Wawa,
I'll try to test how this works.

Below is the complete system I envision. The question marks (?) mean that I don't know what to connect in this part of the circuit. In fact, I don't need to connect anything in there and it will work. I worried about the corrosion as the system has to work 24/7. One a week I could make a maintenance.

It's actually hard to move from 1 valve system to 12 valve system.
I'll use a multiplexer. MUX: http://www.canadarobotix.com/arduino-shields/mayhew-mux-shield-ii

On the image, the programming logic controls when to open and close the valves (via D1 - D12 outputs). It is simple.

If there would be any way to make the A1, A3, A5.. etc .. as a HIGH output when not measuring, then it would help, probably. It would mean there are 2 Anodes in water. I know the PMW pins could do this job, but it's unrealistic since I have a MUX.

The electrode part seems a mess.
I have re-written part of post#10, so read again.
That way you have no DC on the electrodes, and so less corrosion.
Try to draw that, so it can be checked.
Leo..

Hello,

@Wawa (Leo),
I reread the post #10. Trying to understand and draw your idea.
What do you mean by the "hot electrodes"?
Is the D1 wire a hot electrode?
What do I connect to the ground (the long central electrode) then?
Thank you,

Vitaly

Conductivity is measured between two electrodes.

One is the measuring electrode (I named it "hot").
The other one, the reference electrode, is connected to Arduino ground.

The ground electrode can be used/shared by several "hot" electrodes.
Leo..

Hi,
The CAD is called ExpressPCB, google it, it is free and has no high overheads and as you see provides a clean and uncluttered layout.

Tom.... :slight_smile:

Good evening,

@Wawa (Leo)

Sorry to ask again, as you mention in the post #10

100k resistor between a digital pin and A0.
100k resistor between the same digital pin and A1.
Connect 100uF capacitors between the analogue pins and the "hot" electrodes (+cap to the analogue pin).

as well as

One is the measuring electrode (I named it "hot").

Thus I'm puzzled: if the 'measuring electrodes' are A0 and A1 (I measure with analog inputs), how do I connect the capacitors between the analog pins and the hot electrodes as they essentially mean the same.

I've done my best to draw what could look distantly like your description.

No, like this.
Untested, so make a test setup first.
Post test code, so we can check.
Leo..