I need to control 12 LEDs that are powered by 6V (4 AAA batteries). I'm using a PIC18F25K40 microcontroller that will be powered by 3V (2 of the AAA batteries). Because of the different power supplies, I can't charlieplex. There are enough IO pins available to individually address the LEDs.
Because I will rely on persistence of vision, the LEDs will be powered ONE at a time, so I'm expecting it to be fine to arrange them in parallel with a single current-limiting resistor.
To turn on an LED, the corresponding IO pin will be set to Output LOW in order to sink current. To turn off an LED, the IO pin will be set as an input (high impedance). Schematic shown below.
The issue is that the PIC documentation says that any applied voltage to the pins must not exceed Vdd + 0.3V. With the LEDs off, a voltage of about 3.8V will placed on the pins. (6V - 2.2V = 3.8V). 2.2V is the forward voltage of the LEDs, and Vdd is 3V.
In order to address this, I'm adding a series diode to the current limiting resistor, in order to drop the voltage placed on the IO pin to be below 3V. (Shown in schematic).
Will this circuit function as intended (over the range of battery life 1.0V-1.5V)?
Will a Zener diode be better for producing a definitive voltage drop?
Are there better ways to accomplish this? (The PIC needs to remain powered by 2 batteries. Other parts of the system require 6V, so can't route the remaining 2 batteries to be in parallel with the first pair.).
The use of 4 batteries to power the LEDs is to spread the power consumption, as well as to ensure that the LEDs can still be powered even when the individual batteries deplete to below 1.1V. Otherwise 2 x 1.1V will barely meet the 2.2V forward voltage. Please note that the 6V is required for other parts of the system; not just for the LEDs.
Haven't been able to find Zener diodes of 1V. Using standard diodes will provide a 0.7V drop, which doesn't leave much margin for preventing damage, especially if the initial battery voltage is a bit higher than 1.5V each.
PCB space is VERY tight. Strong preference to keep part count to a minimum. ie. no room for a handful of transistors or additional power regulators.
Thanks in advance for the guidance!