View Single Post
Old 12-31-2016, 05:43 PM   #2956 (permalink)
thingstodo
Master EcoModder
 
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488

Ford Prefect - '18 Ford F150 XLT XTR

Tess - '22 Tesla Y LR
Thanks: 749
Thanked 565 Times in 447 Posts
I would add a couple of resistors on the board, and one in series with the switch, to limit the max current into the micro.

Perhaps a 22K from Vcc (whether that is 5V or 3.3V) or your top trace on the board to the PIC pin or middle trace on the board. A 10K resistor from the PIC pin, or middle trace on your board, to Gnd, the bottom trace on your board. This one is shown as 'some resistor. That sets up a voltage divider for about 1/3 of Vcc on the input pin, which should read as 0 or OFF.

The switch would go in series with a 2K2 resistor - top trace to your switch .. green wire ... which is now wired in parallel with the 22K resistor. That sets up the PIC pin for about 85% of Vcc and should read as 1 or ON.

These resistor values are ones that I typically use. They limit current under 3 mA and are easy to buy. I didn't look up the specs on the PIC, but I don't expect any issues with low current into the PIC pin.
  Reply With Quote
The Following User Says Thank You to thingstodo For This Useful Post:
motorulf (12-31-2016)