So I just inherited a project. I am designing a board for a mega32u4 smd microcontroller that has indicator leds on 8 input and output pins (4 digital (3pwm) and 4 analog) that light up green when a pin is set high and yellow when a pin is set low.
I want the circuit to light up yellow when an input voltage from 0-1.4V is applied or outputted from a pin, not turn on (or rather both LEDs are not visible) when 1.5V-3V is applied or outputted at the pin and light up green when 3-5V is applied or outputted.
This is the part of the schematic that has the circuitry for the indicator LEDs: Where the pin numbers are the pins of the microcontroller. I am using the following surface mount components: schottky diode, zener diode, green led, yellow led
I chose the resistance values based on another circuit that used the same LEDs. We want around 1-4mA running through each LED as they seem to be bright enough when that amount of current is running through them.
So to my understanding: When 0V is inputted into one of the pins (ie the circuit) 5V is dropped 3.6V by the diodes and then the resistance should be changed to around 1.4V/4mA~350 ohms. And when 5V is inputted the potential difference at the input point is 0V because of the 5V so the circuit doesnt or shouldn't source any current from the arduino as the zener is supposed to block it and the potenial is 0. Which would give us a resistance value of 5V-2V (LED)-.5V (diode)/4mA ~625 ohms which I am gonna maybe call 2.5k because the green LED is much brighter then the yellow and on another cirucit I was handed with the same LED I calculated the current and it was around 1mA running through it.
The problem is when I use any of the resistance values (the ones in the circuit and the ones I computed) when nothing is applied to lets say pin 11 (ie its left floating) the green LED is turning on enough to be visible. I measure the current and around 4uA is going through the green LED (wow! are LEDs that efficient). Is this because the zener diode is leaking 10uA at 1V drop according to the data sheet. I am not measuring any current flowing through the yellow LED and resistor when nothing is applied at pin 11. But I am still seeing the green LED turn on. I bread boarded the circuit out with the smd componenets soldered to jumpers and am still getting the issue so I don' think it has to do with my circuit
I think my understanding is wrong. Please help I am new to circuits and I want to understand the math before I start ordering a bunch of wrong parts. Or perhaps I am going about this completely wrong. If anyone could give me some insight how they would get the problem solved I would be super grateful :)!