I am using a PCA9685 PWM driver, which operates at either 3.3v or 5v logic level. But I want to drive a couple of blue LEDs (3.4v drop) directly from the PWM output pins. So I am going to connect its Vcc to 5v. Now, I have a Seeeduino XIAO microcontroller, which operates at 3.3v and is not supposed to be 5v tolerant. I wonder if there's a quick and dirty way to make them work together.
I know I can use a divider made of two resistors for one-way communications like UART. However, The PCA9685 and the MCU communicates through I2C. And I suppose data flows both ways on SDA although clock signals are generated by the MCU.
I also have some 5v Pro Micros that I can use but I readlly liked the small footprint of XIAO and thought I'd give it a try, if it's not too complicated.
Any suggestions? Thanks.
I havent tried this but it should work...
connect the LED and resistor to the 5v line and the other side to your output. now when you want it to turn on drive the output low.
Rick
You must use a bidirectional logic level shifter for I2C communications between 5V and 3.3V devices. For example
The best solution is to match operating voltage levels of all components.
Thanks for the suggestion. When the output is high (3.3v), the voltage on the LED is 1.7v, which I suppose will not light up the LED. Should I be concerned about the constant voltage on the LED though?
Thanks! I guess adding the level shifter beats the purpose of keeping a small foot print . If the suggestion from the other reply doesn't work out, I'll just use a 5v Pro Micro then.
No. It has no effect unless the diode is in the conduction region of the I/V curve. That turns on the LED, but you are controlling it. However for that reason, your LED can not have a forward voltage of less than 5-3.3V = 1.7V. Such as some red LEDs.
Thanks! I did some prototyping and it worked perfectly.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.