Electronics > Beginners

How to detect -5 volts?

(1/2) > >>

rea5245:
Hi,

I have a connector that can plug into two slightly different devices. I want to automatically detect which device it's plugged into. With one of the devices, there is -5V (yes, that's minus 5 volts) coming in on a pin. With the other device, that pin is not connected to anything. I can't connect the pin directly to a microcontroller, because -5V would damage it. What can I do to get a 0 or 1 signal to the MCU based on whether the -5V is there or not?

Thank you,
   Bob

PartialDischarge:
4.7V zener to the pin, then a pull up 100k resistor to the mcu. If not connected to anything the mcu will see 5V, if -5V is present at the pin, the mcu will see 0

rea5245:
Will the MCU's built-in weak pull-up suffice, or do I need the 100K resistor?

schmitt trigger:
The weak internal pullup may work. Having said this, common resistors are ultra-cheap. And if you are using SMT devices, ultra-small too.

My personal opinion is that for this instance I would use an external pullup. But other posters may think otherwise.

PartialDischarge:
The internal may be enough, but anyway I would also add a series resistor with the zener to limit the current in the mcu, just in case your -5V turn out to be -7 or -10V someday

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod