Weird input situation in a PIC circuit

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 2K views
Zalajbeg
Messages
77
Reaction score
3
Hey everyone,

I have built a circuit which includes a PIC. The logic is that if a specific pin gets a logic 1, the output pins will be activated and LED lights will flash. I am controlling the input pin with a magnetic reed switch.

It was working great few days ago. However today the output pins are activated even if the reed switch is open. The weird thing is that when I want to check the voltage in the input pin (I am linking one prob to the pin and the other one to the ground) the output pins stop.

What can be the issue? I don't know why linking a theoretically infinitive resistance parallel to the circuit cause this stop. Could you please help me?

Additional information: I plugged out the switch but it still activates the output pins. I broke the link and it still activates when I touch pin.
 
Last edited:
Engineering news on Phys.org
You probably need a pull-up/down resistor on your switch input pin. 10-100K oughta do the trick.

If you already have that in place, then we need a lot more information about your circuit and software.
 
schip666! said:
You probably need a pull-up/down resistor on your switch input pin. 10-100K oughta do the trick.

If you already have that in place, then we need a lot more information about your circuit and software.

First of all I thank you very much for your reply. There had already been a resistor (4.7k) however I find out that the link was broken. When I fixed the link between the switch and the resistor it worked great. When I was a newbie to the topic someone mentioned about the floating situation and I experienced it with this broken link.