I'm trying to build a small circuit to sense when a voltage ref (for IO output) is supplied otherwise set a default voltage reference.
A bit of context - This is common within the Arduino ecosystem where shields should accept a IOREF input that indicates the attached board IO voltage level. I'm basically trying to to hook this input to a bi-directional level shifter (to one side of the voltage inputs) and whenever there is no input I want a fixed voltage to be applied (internal 3.3v).
Here is my attempt to achieve that using two 2n3904 NPN transistors and one diode.
- The switches mimics the IOREF input (3.3v | 5V or none)
- The voltmeter is the input of the voltage side on the level shifter.
- The upper 3.3v is the default I want taken from an internal voltage regulator.
Q1 - While it seems it should work I'm worried about voltage drops caused by the IOREF transistor and the diode on the default voltage input - I will use use low Vf components and I can probably get a way with a small voltage drop but I wonder if I can avoid that???
Q2 - Should I place a pull down resistor on the base of the IOREF npn transistor?
Q3 - Should I place a resistor to ground on the emitter side of the "DEF" npn transistor?
Q4 - Do you see any problem with this circuit????