8M water pump control - unstable

w7ky

New Member
I've got a pretty simple 8M pump control circuit that I want to energize a SSR to control a 220v deepwell pump. The code is below. The circuit is on a breadboard. The float switches are in one assembly I bought used on eBay. They seem to be magnetic switches and work correctly when read with a meter. When connected to the circuit, performance becomes unpredictable. I wraped the floatswitch wires around a choke which seemed to help, but did not make the circuit work dependably. The wiring is unshielded. The circuit performs best with the switch assembly removed and simulated with jumpers. Still, it does not work as I expected.

When I open the lower switch(pin2) it takes about 8sec before the pump comes on and the green led blinks. Pump is simulated with an led. If I close the lower switch within a second or two after the pump starts, the pump goes off and the green led is steady. Waiting a few seconds after pump-start to close the lower switch will keep the pump on until the upper switch(pin3) is closed.
It seems that code execution could not return to the Main block until pin3 goes high.

When the upper switch closes, the pump stops immediately and the green led is steady.

I can't understand why the long delay before pump-start when the lower switch opens and why the system becomes unstable when the float assembly is connected to the circuit. The normal resistors are installed on SI and the unused pin1 has a resistor to gnd.

I've tried turning off all the potential RF sources around my desk. It's the same place I do all electronic work and I've not had RF problems with 8M projects. Any insight would be appreciated.
--------------------
'water pump control
'pin3=high water float switch
'pin2=low water float switch

symbol Pump = 4
symbol GrnLt = 0
symbol LoSw = pin2
symbol HiSw = pin3
dirs = %000010001

Main:
Low Pump
High GrnLt
If LoSw = 0 Then PumpOn 'low float/sw (yellow)
GoTo Main

PumpOn:
Low GrnLt
High Pump
Pause 500
High GrnLt
Pause 300
If HiSw = 1 Then Main 'top float/sw (blue)
Pause 300
GoTo PumpOn
----------------------
Thanks
 

moxhamj

New Member
Can you post a quick schematic? Eg things like pull up resistor values and power supply filtering. It sounds like interference of some sort.
 

slurp

Senior Member
You say that you think this is a magnetic switch. Is there an overlapping threshold of operation when switching from ON to OFF or OFF to ON?

This may be somewhat similar to Microswitch operation, where your travel to the ON position overlaps on the start of travel to OFF. I'm not certain it's really you problem but it's certainly worth considering if your upper and lower water levels are close.

regards,
colin
 

Michael 2727

Senior Member
Many float switches are Mercury switches, yours
could be magnetic though.
Are you sure it is not leaking, got water inside it ?

Have you got extra bypass/filter capacitors
across the supply, close to the picaxe chip.
Try adding a 1µF Electro as well as the usual 100n Cap.
 

boriz

Senior Member
Be sure to use pullup (or down) resistors. Also tie unused inputs to ground (make sure they ARE inputs though). And try using the BUTTON command to detect the switch states. It has built in debouncing.
 

Technical

Technical Support
Staff member
Does sound like you may not have used pull-down resistors on the inputs so the inputs are randomly 'floating' when the switch is not active. Have a look at the switch input circuit diagrams in the manuals.
 

w7ky

New Member
Thanks for the assistance. The float switches were OK; I was still having problems w/o them and using short jumpers. Following Dr Acula's suggestion to submit a schematic, I discovered my pulldown resistors (10k) were in series with the switchs and not from the pin to gnd. Changing this fixed everything. The program is now executing correctly. I'll leave the choke on the float-switch wiring just to be safe. Thanks for the help. I wouldn't want to say how long I've fiddled with this w/o noticing my mistake. BW Doug
 
Top