Electronics > Beginners
HOW TO SENSE 12 VOLT DC VOLTAGE USING MICROCONTROLLER?
Kjelt:
You mean like a proximity sensor?
These are in different versions which need different schematic:
1) NPN NO this is a so called open collector output which will put the output hard to ground when active and floating (or 100k pullup or something like this) when passive. This needs to be in the - cathode side of the led, pulling the opto-led to ground when active and the + anode of the led needs to be connected with 1k to 12V.
2) NPN NC this is the inverse of above and the only difference is that the software should inverse the logic.
Then you have
3) PNP NO: it gives 12V on the output when active, 0V when passive. This one you can use as drawn but you can forget about the pullup to 12V not needed.
4) PNP NC: it gives 0V when active and 12V when passive. Again same as 3) but the software should inverse the logic.
wabhavkumar:
Sir, instead of the optocoupler, can I use a transistor to sense high and low of the NO NC sensor.
wabhavkumar:
Sir,
Please verify the attached circuit can replace optocoupler circuit?
Kjelt:
NPN needs a pulldown on the base not a pullup AFAIK.
Raj:
let mistery part be microcontroller
Pin 3 can do analogue measurement of input also ground needs to be common for both microcontroller and input
Note: for given values of resistor,the reading microcontroller does will be 4/12th part of input
pin 1 can do digital measurement of input 2 and ground can be isolated
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version