Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] pic output is just 2.5v

Status
Not open for further replies.
I doubt that will work for several reasons.

1. the PIC inputs are fixed at 2.5V by the pull-down resistors and collector load resistors, for example R8 and R19. Remove R8, R9, R10, R11 and R12.
2. the pull-down resistors on the buzzer and relay transistors do nothing whatsover except waste current, remove R6 and R4 (numbers not clear on diagram)
3. negative side of C3 should connect to GND
4. there is nothing to provide reset when powered up. Add a capacitor (~10uF) in series with a resistor (~100 Ohms) across the reset switch.

Conceptually, it looks like you intend conduction through the water to turn the transistors on. This will only work under certain circumstances. The water must be sufficiently conductive, most is due to dissolved electrolytes but pure water isn't. Also consider that to turn the transistors on, you need to supply current to their base pins. It appears at the moment that your only 'common' connection is ground and maybe a feed through R22. Even if the water is conductive, I suspect you will not find the transistors turn on reliably, especially if the water container is plastic or has conductivity to any other electrical items or ground.

It's your design but I would suggest a capacitor across the C-E of the sensing transistors to filter noise and mains interference, the water level will change very slowly compared to 50/60Hz mains so you can afford a slow reacting input. Also connect resistors from each sensing transistor base to +5V, the intention being to make them conduct when water is NOT present so you want fairly high values, I suggest 220K as a starting value. It will reverse the logic at the PIC input but you can fix that easily in software, it does mean the water can have a connection to ground instead of +5V though. As water touches the sensors it conducts the bias current to ground and turns the transistors off. It also limits the amount of current through the probes which will help to stop them corroding.

Brian.
 

Hi,

About your schematic:
Your schematic is hard to read:
* use GND symbols instead of long wires.
* the same is with VCC
* avoid this unnecessary crossings ( like left of R19)
* use 100nF X7R capacitors on each VCC connection of each IC with short connection to GND plane.
* Short circuit VCC - GND. U2, pin2, wire right side
* check lower connection of C3
* it seems, that UK is just for the relay. It usually has a wide operating range, so a resistor or a zener instead of U3 simplifies circuit.
* I don' think all the pull down resistors on PORTD are neccessary.
* avoid crossings and edges just by shifting pieces of wires a bit left/right/up/down

Klaus
 

Thanks a lot..you are of great help..but i would like to know that
1. are u suggesting me to remove the pull down resistors..?i had tried that and found that pic makes faulty triggerings...both in the output pins as well as in the input pins..
2. Am using 3 probes.one supply a 5v to water.the other two probes are my sensors.they gets the voltage when water touches them and gives it to the base of sensing transistors.so it makes no worry with a plastic tank i guess...
3. And if i design the sensor circuit as u told,that makes a problem when the tank is platic...right...?or can i solve that issue by supplying a ground to the water through a probe,which at present sends a 5v...?
 

I see too many problems from a systems design perspective.

Start with precise functional requirements for all functions to be controlled for inputs and outputs, what, how, when where, why without any mention of how to perform it. Unless there are demands to use certain interfaces. e.g. ac power, battery, phone lines etc.

Define every environmental interference you can imagine and what level it must ignore. e.g. temp, humidity, lightning storm, power line transient , ESD, etc etc. This is essential for immunity and interference. There are design standards for systems, follow them.

Aftet you define the physical, environmental and functional requirements then start analyzing the design requirements.

Reject any method of using DC to measure water height. This wont work for long.

THis is highly inaccurate and depends on ionic characteristics of water and surface oxides and contamination growth. Since water has a relative permittivity > 60 the best method is to measure dielectric attenuation simply supply a frequency and measuring attenuation due to water using Zc(f) / R attenuation ratio for the capacitance of the electrode. THen a simple diode detector Schmitt trigger can detect that with the right R value and input compare thresholds.

Consider design or measure the capacitance of your wire pair in air but wet and contaminated then immerse in water. Note the change and compute the impedance for any frequency that is convenient. e.g. 50 to 5kHz. Relative to a resistor the voltage swing is repeatable and invariant to ionic content and surface contamination and wet wires.

I digress but feedback given to you is good so far but, you will overlook something without stepping back and examining the entire project from a systems level and evaluating your design methods. This takes experience , which you learn from understanding how others have done it successfully and compare the design specs with the test specs and the results.

professionally yours,

Tony.
 
Last edited:

1. You should find it works better without the resistors. The reason is that if the transistors are not conducting, the PIC input pins each have 10K to VCC and 10K to ground so they will sit at 2.5V. I think this is what your original query was about. So logic high can never go above 2.5V which might work but with the lower resistors removed it will go to 5V instead which is safer. A pull-down resistor on an output pin serves no purpose except to waste output current!

2. In theory your idea works but in practice it probably wont. You are assuming that the 5V supply to the water will conduct to the bases of the transistors. That only works if there is no other connection to the water which can disturb the 5V. I do not know the particular circumstances you are working with but if the water is fed through metal pipes, or is in a metal tank, or if it comes from a source which has any conductive parts in it, there will be an additional current path which will upset the 5V. Remember that the water you are testing for conductivity from your 5V will be equally conductive to anything else around it!

What I suggested was that you reversed the way it works. If you make the transistors conduct when the sensor is dry and stop conducting when the water reaches them, you can use ground instead of 5V. It is far more likely that the water is in contact with the ground or grounded pipework than it is connected to another 5V supply!

You may still run into problems due to electrolytic action and corrosion at your sensors but using the grounding method will reduce it to some extent.

Brian.
 

Ok..then let me try by avoiding the pull down resistors.
I still have a doubt that if the tank is plastic and no means of grounding,is it enough to provide a probe to the water which is connected to any ground of the circuit...?
 

Hi,

for your circuit you need a big electrode at the tank with VCC.
Don´t use GND. It won´t work.

To avoid fast corrosion of the electrodes you might consider to enable the measurement only a short time.
Maybe 5 seconds every 5 minutes.
Then switch the big electrode voltage to "GND" most of the time.
Only during measurement switch it to VCC.
(Switch electrode to VCC/ wait for 5 seconds for the sensing voltage to stabilize / read in port (sensing electrode) status / switch big electrode to GND / wait for 5 minutes)

This may extend lifetime of your electrodes.

But I agree with the posts above: There are better, more reliable solutions.....

Klaus
 

for your circuit you need a big electrode at the tank with VCC.
Don´t use GND. It won´t work.

It will work equally with VCC in the present design or GND if the transistors are turned on through high value bias resistors. My point was that if the water is not isolated from other electrical connections, there is more chance of it having conduction to ground than to another 5V supply. I agree there will be electrolytic corrosion either way. The solution is to use gold probes (ouch - expensive!) or keep the measurement time to minimum or another way is to use AC. I have recently designed a system for water detection that use a PIC with AC applied across the probes to minimize corrosion but it worked on a completely different principle to Rishad's circuit.

Brian.
 

Am planning to use surgical grade steel as my probes..so i guess corrosion can be prevented to some extent..i dont need a corrosion free probe,just wish that corrosion is less..

- - - Updated - - -

If i use AC then i will cant use digital pins right...?so i plan to use dc at present,planning for modifications in future..
And what should i prefer...?using ground or Vcc...??am impressed with the idea of ground,but it has to work..
 

To control a 1HP motor,relay of what ratings should i select...?i mean do i need to consider the starting current also...?the running current would be around 6 or 8A i guess..starting current be around 7 to 10 times,right...?
 

Hi,

A 1 HP motor can be 3 phase AC, 1 phase AC, DC....
And there are several voltges...

How can we know?

Klaus
 

I mean a single phase motor..220V.

- - - Updated - - -

1 HP single phase AC,220V
 

If i use AC then i will cant use digital pins right.
Yes, you can still use digital pins, it just means you alternate the voltage polarity. For example, call them probe 'A' and probe 'B', make A high and see if it conducts current to B then make A an input and B high to see if it conducts current to A. If you alternate between them, the voltage from one probe relative to the other is reversed. It helps to reduce corrosion because the migrating element (typically iron) has little time to move to the other probe before being pulled back. You still have to take into account that there may be other conductive paths through the water. If you are using the 1HP pump to move the water you are checking, consider that if any of the water comes into contact with any conductive part of the pump, it makes a second path for current to flow through. For safety, the body of the pump should be earthed, thats why I suggested using a low voltage sense circuit instead of your 5V one.

Choose a relay rated to switch >1 HP motor load, the manufacturer will already have taken into account the start surge current. You could also consider a solid state relay, they are a little more expensive but more reliable and they tend to cause less interference than mechanical ones.

Brian.
 

I enquired about such a relay in an electronics shop.i asked them for a relay to switch a 1HP motor.but they are not aware.they asked me about ratings,like contact current..
 

So am in great confusion regarding the relay
 

Some relays are rated in terms of the motor load they can switch, some are rated by voltage and current. It isn't only a case of Volts and Amps, the contacts in the relaly are made from special materials to extend their life with certain kinds of load.

The exact current depends on the design of the motor and how much load it has on it when starting, without practical measurement that would be difficult to determine. As a rough guide, 1HP = 750W so at 220V the running current under load will be about 750/220 = 3.4 Amps. The starting current will be much higher for a short time when starting up so I would suggest a rating of >10A and preferably as much as 20A. For my own use here I have 2HP motors with 30A relays but they are bypassed by triac switches to avoid the start up surge.

Brian.
 

For my misfortune,tha trouble i had has started again..i mean now am getting only 2.5v as the output from RD5..
Betwixt..u had suggested me four reasons in ur first reply..can u suggest me the solutions for that too...???
 

I am assuming your schematic is the one in post #40.

RD5 appears to be the output from the PIC that is used to operate the relay. Are you saying it is 2.5V when the relay is turned on (RD5 = logic high) or it is 2.5V when the relay should be off? If it's when the relay is supposed to be off, please tell us what is connected to J2 pin 2.

Brian.
 

I checked the output using multimeter and it shows just 2.5v. But, it raises to 5v when i touch over the breadboard or any other components.
I didnt get what you meant by J2 Pin2!!

Here, i am attaching the circuit construction on the breadboard.

IMG-20151113-WA0004.jpg
 

That layout isn't very good. Firstly, use ceramic capacitors in parallel with electrolytics across both VSS/VDD pins. I suggest 100nF and 10uF are suitable values. I'm not sure what the ones you are using are but they don't appear to be good for decoupling purposes. Also, I can't see any crystal loading capacitors . I suggest you also add another wire at the right side of the board between the two VSS tracks and the two VDD tracks, you should aim to keep the impeadance as low as possible between them.

J2 pin 2 is connected to RD5 through R23, you are saying the voltage on RD5 is wrong. To some extent the voltage depends on what you have connected to J2.2. If the pin is configured correctly as an output and assuming you are not injecting something nasty at J2.2, the voltage should be either 0V or 5V. At the moment you appear to have an LED connected to it which does not match your schematic.

Brian.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top