I am using a 74hc4051 mux/demux to switch GND's to diodes. The mux is controlled by three AVR ports. The diode drop is measured by the AVR ADC channel.
Here is my question:
I have connected the anode of the diode to the supply, resistor and the ADC input. When the output is selected (in this case Y1, there will be one more diode to Y2), I want GND to be applied to complete the diode circuit and measure the 0.7V with the ADC.I tried this and it is not working.I am getting zero volts at ADC input.
It is working the other way round, ie. when I connect the cathode to ground, I can use channel Y1 to apply the 5V + resistor path to the diode, to forward bias it and measure the 0.7V with the AVR.
So how do I connect this circuit? Since by default the output of the demux on a non selected channel is always zero, how do I switch ground to this diode to forward bias it and measure about 0.7V drop with ADC?
I also thought of raising my GND for the diode to about 0.7V so it will be higher than the default zero volts of the non selected demux channel, but that became too complicated. I would like to know if an easier fix exists.