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.
hi everyone. wanna ask a something. now i have 24v and if the value 24v I want to sent microcontroller 1(+5v) or if the value is under 24v (for ex 21,19..) iwant to sent 0(0v) to mic. how can I do that ?
If I've understood your question correctly, you want to send a 1 to the micro if voltage is 24v, and 0 to the micro if it's less than that, yes?
Simplest way is with a comparator. You set the inverting input at a reference voltage, and send the voltage you want to test to the non-inverting input. The comparator will output a 1 if the voltage under test is higher than the reference, or a 0 if it's lower. If you use a comparator with an open collector output (I'm assuming you can get these, I don't know for sure), connect a pullup resistor between the comparator output and the micro's supply line to get the correct voltage (5v, in your case) for the logic 1. This is ONLY useful if the comparator output is open collector. If this isn't an option, just bung the output through a potential divider.
The comparator's supply voltage needs to be higher than the voltage you want to test.
24 volts is a little high to work with, so you should probably put the 24v through a potential divider to get a more "friendly" level.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.