How is that possible. LED needs to be connected with only one polarity.If it's driving LEDs, there's no need to invert it. Just connect the LEDs to the opposite supply.
How is that possible. LED needs to be connected with only one polarity.If it's driving LEDs, there's no need to invert it. Just connect the LEDs to the opposite supply.
Connecting the LED anode to V+ will turn it out when the cathode (control signal) goes low.How is that possible. LED needs to be connected with only one polarity.
still does not explain why this has to be inverted phase but i guess you would want to change the duty cycle at some point and perhaps you want that to have a blend of different wavelengths controlled by PWM.I am doing experiments on photobiomodulation using pulsed Infrared LEDs. So one LED with one wavelength when it gives pulsing output, another wavelength LED can be used simultaneously with inverted power supply.

I use this arrangement to show bit status (HI/LO) on some digital logic demonstrator circuits in which students build gates using various discrete components, first manual switches, then relays, then MOSFETs. It has another advantage in that it shows floating signals because both LEDs turn on, albeit much more dimly, which is fine for my purposes.still does not explain why this has to be inverted phase but i guess you would want to change the duty cycle at some point and perhaps you want that to have a blend of different wavelengths controlled by PWM.
since chosen LEDs draw very little current, both can be driven by same GPIO. when GPIO is high, one LED is lit, when it is low, the other LED is lit. this way all you need is one extra resistor.
View attachment 371428
LEDs have different voltages, one LED needs 5 Volts, another 0.8 Volt and 6 V depending upon their making for various wavelengths. So I have separate voltage sources with resistors to provide appropriate voltages and I need to pulse them.still does not explain why this has to be inverted phase but i guess you would want to change the duty cycle at some point and perhaps you want that to have a blend of different wavelengths controlled by PWM.
since chosen LEDs draw very little current, and GPIOs can both sink and source current, both LEDs can be driven by same GPIO. when GPIO is low , one LED is lit (D1), when it is high, the other LED is lit (D2). this way all you need is one extra resistor.
View attachment 371429
Separate voltage sources? All you need is separate resistors. It is far more important to regulate the current to the LEDs. The voltage will sort itself out if you have the appropriate current.LEDs have different voltages, one LED needs 5 Volts, another 0.8 Volt and 6 V depending upon their making for various wavelengths. So I have separate voltage sources with resistors to provide appropriate voltages and I need to pulse them.
No I wouldnt be changing duty cycles.
I use a SMPS power supply for Desktop Computer. It has 3.3 V, 5 V and 12 V output. Based on LED's Forward Voltage and Forward current I calculate appropriate resistance and use it in series with LED.Separate voltage sources? All you need is separate resistors. It is far more important to regulate the current to the LEDs. The voltage will sort itself out if you have the appropriate current.
Use the 12 V supply. A 10 kΩ series resistor will supply approx. 1 mA to the LED.I use a SMPS power supply for Desktop Computer. It has 3.3 V, 5 V and 12 V output. Based on LED's Forward Voltage and Forward current I calculate appropriate resistance and use it in series with LED.
That is a possible solution, I m not sure how to modify the python program to send out an inverted PWM simultaneously in parellel in another pin.Or use a second output pin?
1 mA is not the current of the LED. It is the current drawn by a switching circuit that switches the supply voltage to the LED s. For each LED of different Vf, I use separate switching circuit.Use the 12 V supply. A 10 kΩ series resistor will supply approx. 1 mA to the LED.
What kind of LED's are you using? Ones I'm familiar with come in the following forward voltages: RED, typically around 2Vf. (mine is Super Bright 5mm Red at 1.95Vf). YELLOW: 2.01Vf. GREEN 2.92Vf. BLUE (3mm) 2.82Vf. WHITE 2.97Vf.LEDs have different voltages, one LED needs 5 Volts, another 0.8 Volt and 6 V depending upon their making for various wavelengths.

I used that as an example. Use 500 Ω if you want 20 mA LED current.1 mA is not the current of the LED. It is the current drawn by a switching circuit that switches the supply voltage to the LED s. For each LED of different Vf, I use separate switching circuit.
I’d argue, that’s the problem you need to solve, it’s a coding problem, forget the additional hardware. I guess it depends on the complexity of the code in your application and how important the delay between one output changing and the other output changing, but if you sniff the output with a second pin and invert in code to drive another output pin, unless it’s needed to run blisteringly fast that should do it.That is a possible solution, I m not sure how to modify the python program to send out an inverted PWM simultaneously in parellel in another pin.