Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Cleaner way to swicth sensors

Status
Not open for further replies.

Dmed

New Member
working on a project that uses 4 proximity magnetic sensors. 2 max positions and 2 home positions(horizontal and vertical). these sensors are connected to a PIC.
problem is I only have 2 inputs left on the pic. I was using a relay to switching them, but sometimes getting some false readings. I think is because of the relay's contacts bouncing.

other better way to switch?

Thanks in advance.
 
what is output value on sensors?

you could extend those pins using a shift register(parallel to serial)......
 
If the contact bounce is truly the cause of false reading. Then just switch the relay, add a delay (maybe 1ms), then read the sensor.
 
Does the PIC have an ADC? If so, wire the switches to some binary-weighted resistors to create sixteen different analog voltages which you can read through one PIN...
 
If the outputs of the proximity switches are logic level, then drop in some logic and build a 2-of-4 multiplexer controlled by the same pins the relay and proximity switch use currently. I know they make a small one, like 1 of 3 or something. I'll look.
 
Found them. 74153 is a dual 4 input 1 output multiplexer and the 74157 is a quad 2 input 1 output multiplexer. From the description I would suggest the '157.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top