RedditPP Mascot

RedditPP

r/arduino • … • u/RaspberryPiBen

Best way to read and write 16V with a 3.3V microcontroller?

I'm upgrading a quiz buzzer system by making my own controller (among other things), and it needs to be able to still control the old buzzers, which run on 16V. The buzzers are equivalent to this schematic (a mix of incandescent and LED), so they use the button when power is applied one direction and the light when power is applied the other direction:

https://preview.redd.it/chfp1rdj13yc1.png?width=324&format=png&auto=webp&s=090ff164887fd79c4c926000159336acaf3dd5f1

I have a microcontroller that's controlling these, and I have a working prototype at 3.3V. However, I can't drive the actual buzzers at 3.3V, so I need to shift the voltage somehow. I can't use just a voltage divider, transistor, or other unidirectional level shifters because I need to both read and write from the same pin, so I need a bidirectional level shifter.

To do this, I am currently considering the circuit described [here by Digikey](https://www.digikey.com/en/blog/logic-level-shifting-basics) and used in products like [this](https://www.adafruit.com/product/757). However, I'm not very experienced with designing electronics, so I don't know if that will work correctly—everything I can find says it's mostly used for I^(2)C, which has different requirements. The Adafruit one won't work because it has a maximum voltage of 10V, but I'm not sure why that is—the datasheet only mentions 10V as one of the VGS values used for test conditions. I'm definitely missing something, but since I can't figure out what it is, I'm asking here.

Also, I'm not sure if this will affect anything, but it is run through a 5m cable before reaching the light and buzzer. I don't think it's possible to use a flyback diode because it would cause a short circuit, so is there anything I need to do to mitigate possible damage?

Can this type of circuit drive LEDs at 16V from a 3.3V microcontroller, and if so, what should I look for in a MOSFET that would fit the requirements? If not, what should I do instead?

Edit: It seems like I confused people. Here is what I am doing:

Two pins, 1 and 2.

In button mode, 1 is HIGH and 2 is LOW. If the button is pressed, 1 and 2 are shorted together, so 2 is suddenly pulled HIGH. The microcontroller detects this.

In light mode, 1 is LOW and 2 is HIGH. The current flows the other direction to light up the light, though this does mean that the button is no longer usable.

The light needs 16V. The button can use any voltage, but I figured it would be easiest to also use 16V.

— 0