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.

opamp or another?

Status
Not open for further replies.

cagri35

New Member
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 ?
 
Voltage divider would give a 0 to 5 with a range of 0 to 24 I would do the 24 to 19 in code
 
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.

Hope this helps
 
I think with one opamp cant be solve this problem I will use first voltage divide and then will try with ac/dc
 
Last edited:
Status
Not open for further replies.

Latest threads

Back
Top