EEVblog Electronics Community Forum
Electronics => Beginners => Topic started by: wabhavkumar on July 02, 2018, 11:33:15 am
-
I WANT TO USE 12V OPERATING NO NC SENSOR WITH MICROCONTROLLER. PLEASE SHARE METHODS OF DOING THIS
-
Your caps lock is stuck ;)
-
But to answer your question many possibilities, I use mainly:
1) voltage divider (two resistors) https://en.wikipedia.org/wiki/Voltage_divider
2) opto coupler
The first one I use with local (on pcb) voltages that are referenced to the same ground.
The second I use mainly with off pcb voltages from different devices.
-
I WANT TO USE 12V OPERATING NO NC SENSOR WITH MICROCONTROLLER
*** Parse error.
Hahaha the topic text was more clear but rereading this it really does not compute :-//
-
thank you for the valuable reply. Please suggest optocoupler circuit.
-
thank you for the valuable reply. Please suggest optocoupler circuit.
Have a read of these links. They will get you started.
http://www.onsemi.cn/PowerSolutions/document/AN-3001.pdf.pdf (http://www.onsemi.cn/PowerSolutions/document/AN-3001.pdf.pdf)
http://www.nutsvolts.com/magazine/article/optocoupler-circuits (http://www.nutsvolts.com/magazine/article/optocoupler-circuits)
-
Can we use 12v input at Pin no 1 of optocoupler?
-
is using 12volt input at pin no 1 of optocoupler pc817 correct? kindly check the circuit image
-
Check the led current for that opto, usually about 10-15mA. So for 10mA and a 1,3V Vfw of the led your 12V needs aprox a 1kOhm resistor not a 10k ;)
But what is the REED_SW ?
-
hello sir,
REED_SW is a type of NO NC sensor which is connected at pin no 1 and pin no 2 of the optocoupler.
-
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.
-
Sir, instead of the optocoupler, can I use a transistor to sense high and low of the NO NC sensor.
-
Sir,
Please verify the attached circuit can replace optocoupler circuit?
-
NPN needs a pulldown on the base not a pullup AFAIK.
-
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
-
At input 2, mentioned in the above circuit, can we use 12volt?
-
yes,
Ouch.I forgot to revaluate the r4, it should be 1k ohm for 12v
-
I convert any logical signal to 3.3v levels with a CD4050 or HEF4050 chip. For example, to read TTL 5v signals on a Kinetis microcontroller (there are no 5v tolerant ports available), or to check the status of switches that switch 12v voltages. This is for digital signals (high-low logical levels), not for analog signals.
HEF4050 include 6 buffers, so if you only need read one signal better work with a transistor or optocoupler, though HEF4050 is very cheap and do not need any additional component.
The voltage of the output signals in the HEF4050, will be the power supply voltage of the chip, between 3v and 15v, and the maximum voltage at the input is 15v.
If you want invert the input signal, then can use the HEF4049 or CD4049.
-
A resistor divider with at most a zener diode is best...all the rest is overkill and expensive to be honest
-
Please suggest Zener diode circuit to sense 12 V or 24V circuit instead of the optocoupler.
-
Here's one for 12v...Don't use it for 24 volt input (the zener will prevent anything from getting damaged but still don't...it's unideal)
-
Here's one for upto 24 volt reading,but you can't use it for 12 volts unless you use analogue to digital converter though it won't get damaged from 12 volts,it's the safest choice for you.
I think implementing anything that can be done in software is better than hardware implementation.
What microcontroller are you using?
-
Raj n Kumar, why Indians love to use eyes blinding text all the time ? Not only you two, but I have seen too many at various forums as well.
Is it a cultural thing ? As common netiquette, its like shouting out loud when talking, everytime. :-//
-
You could use a voltage divider to get the correct voltage out for the microcontroller.
You could also use a comparator to see if the voltage threshold exceeds 12V.
Probable the easier of the two is the voltage divider.
Not sure if you’re just exited but your caps lock is on ;)
-
Raj n Kumar, why Indians love to use eyes blinding text all the time ? Not only you two, but I have seen too many at various forums as well.
Is it a cultural thing ? As common netiquette, its like shouting out loud when talking, everytime. :-//
Perhaps their love of eye burning text is linked to their taste for mouth burning spicy food?
Anyway, I recently posted this schematic in another thread. It converts a voltage ranging from 10V to 15V to 0V to 5V, which can be read from an MCU ADC pin.
(https://www.eevblog.com/forum/projects/mesuring-a-12v-lead-acid-battery/?action=dlattach;attach=467456;image)
https://www.eevblog.com/forum/projects/mesuring-a-12v-lead-acid-battery/msg1644677/#msg1644677 (https://www.eevblog.com/forum/projects/mesuring-a-12v-lead-acid-battery/msg1644677/#msg1644677)
-
Yup,its a cultural thing.
People don't play attention to the important parts otherwise.
It's origin? our schooling system I guess.
The textbooks are huge but the parts students are supposed to learn are one or two lines per page,made to underline by our teachers. I still used to read the whole book
-
Raj n Kumar, why Indians love to use eyes blinding text all the time ? Not only you two, but I have seen too many at various forums as well.
Is it a cultural thing ? As common netiquette, its like shouting out loud when talking, everytime. :-//
Perhaps their love of eye burning text is linked to their taste for mouth burning spicy food?
Anyway, I recently posted this schematic in another thread. It converts a voltage ranging from 10V to 15V to 0V to 5V, which can be read from an MCU ADC pin.
(https://www.eevblog.com/forum/projects/mesuring-a-12v-lead-acid-battery/?action=dlattach;attach=467456;image)
https://www.eevblog.com/forum/projects/mesuring-a-12v-lead-acid-battery/msg1644677/#msg1644677 (https://www.eevblog.com/forum/projects/mesuring-a-12v-lead-acid-battery/msg1644677/#msg1644677)
Interesting...I would have taken a way expensive route with negative voltage or ground isolation from input,making input ground, -10+diode drop equalvant and a diode at input,
or simply use 16 bit mode adc ( there's an article on microchip's website on how to do that on 10 but atmegas without external adc)
-
Hey orignal post author,
If I am guessing correctly,I think you are trying to make a car voltmeter or a battery monitor of some sort,right?
-
Hello all,
can anyone suggest, below attached circuit diagram can work or not?
if not, please suugest pc817 optocoupler circuit for sensing 12 volt using microcontoller.
-
This will work
-
this circuit is not working at 50 meters circuit
-
thank you for the valuable reply. Please suggest optocoupler circuit.
What's wrong with a voltage divider? It seems by far the simplest solution. Without more information we're left guessing.
-
this circuit is not working at 50 meters circuit
What do you mean by 50 meters circuit? It makes no sense.
Is this connected to circuit, via a long piece of cable? If so, then you should have said before!
-
At 50 metres you should put a microcontroller on both ends and connect with rs422/485 or ethernet
-
What do you mean by 50 meters circuit? It makes no sense.
Is this connected to circuit, via a long piece of cable? If so, then you should have said before!
This community seems so eager to help that it often starts offering advice before someone has bothered to properly specify the problem. That doesn't foster proper behaviour.
-
I don´t see why that reed switch should not operate at the microcontrollers operating voltage. Or switch ground with a pull up?
-
I am really sorry for posting an incomplete question.
yes, if no/nc switch is connected with 50m length of wire, then this circuit is not working properly.
Can anyone suggest some better circuit?
-
go see Reply #20 on: 06-07-2018, 18:21:35
Use it.