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 circuit I inherited: enter image description here

This is the part of the schematic that has the circuitry for the indicator LEDs: enter image description here 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 :)!

  • \$\begingroup\$ Welcome to EE.SE. Pin 11 is a digital output - although it is configurable for PWM - so how are you generating the analog voltages mentioned in your question? The Arduino UNO does not have analog outputs. See pinout. \$\endgroup\$ – Transistor Aug 28 '18 at 16:27
  • \$\begingroup\$ Ahh I have the extension board I am designing connected to pins a0,a1,a2,a3 as well as 8,9,10,11 I am working with the atmega 32u4 so its the same circuit in the photo but replicated for each pin. I am generating the analog voltages using a pwm pin on another arduino board as well as a bench top power supply \$\endgroup\$ – Chris Aug 28 '18 at 17:28
  • \$\begingroup\$ Also I expect my user input voltages to range from 0v-9v and will mostly be sourced from a 9v battery and circuitry connected to it. \$\endgroup\$ – Chris Aug 28 '18 at 17:30
  • \$\begingroup\$ (1) We haven't a hope of giving you a good answer without the schematic of what you are actually doing. (2) What photo? (3) How are you generating analog from PWM? (Again, schematic.) (4) What has 0 V to 9 V got to do with it? Your diagram shows a 5 V supply. \$\endgroup\$ – Transistor Aug 28 '18 at 17:38
  • 1
    \$\begingroup\$ Chris, you are not answering the questions in the comments. (1) The schematic you've posted has no mention of 9 V. (2) How are you generating analog voltages from a PWM output? (3) Why are you talking about "reading (inputting) voltages from 0 - 9 V"? 5 V is the maximum input voltage on any of those pins. \$\endgroup\$ – Transistor Aug 28 '18 at 19:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.