I've got a NodeMCU 1.0 board configured to use the arduino IDE and am trying to use it to communicate with a PCA9685 16-channel PWM board to control some P30N06LE N-channel mosfets to drive some 12v LEDs.
i've used the P30N06LE with 5v arduinos previously with no issues, and had to consider that the nodemcu operates at 3.3v.
i'm afraid that i misunderstood how the PCA9685 breakout board works. i was under the impression that i could put a 5v signal to the "V+" pin and that would become the new source for the control signal voltage. as of right now i can't get any functionality out of the P30N06LE's because i think they're not getting the voltage they require to surpass the gate threshold unless i directly apply 5v to the "C" pin.
are my suspicions correct? if so, is there any way with the parts i've listed to PWM these LEDs?
Both I2C devices should run on the same supply voltage if you don't use an I2C bus level translator.
So VCC of the PCA should be connected to VCC of the NodeMcu processor (3.3volt pin).
Not sure if the mosets gates are ok with 3.3volt drive. It also depends on (unknown) LED current draw.
Leo..
i probably didn't make it very clear in my diagram, but they are indeed running on the same "vcc" voltage at 3.3V.
the "v+" pin on the PCA9685 is in addition to a "vcc" pin and seems like it can be used for the output voltage of the pwm'ed signal.
again, i could be wrong. this is what i'm trying to determine.
and the load of the entire LED string roughly pulls around 5A at 12V.
The PCA9685 output has three different modes it will operate in, see page 28 of the data sheet. One mode ( fig 15 ) is a current sink. The other modes push and pull. In these modes the output signal will be at what ever voltage the Vcc is being run at, so you were right about that. If you want to run this chip at 5V but connect it to a 3V3 system, then make sure the pull up resistors on the two I2C lines are pulled up to 3V3 only.
I suspect that the FET is not being turned on correctly, while it is a logic level FET that is a 5V logic level. There are not many FETs that will switch well on 3V3.
I think the PCA9685 defaults to push-pull, unless told otherwise.
Page2 of the datasheet:
Sixteen totem pole outputs (sink 25 mA and source 10 mA at 5 V) with software
programmable open-drain LED outputs selection (default at totem pole).
A fet with a Vgs(th) of 2volt max should do something.
Leo..
Grumpy_Mike:
The PCA9685 output has three different modes it will operate in, see page 28 of the data sheet. One mode ( fig 15 ) is a current sink. The other modes push and pull. In these modes the output signal will be at what ever voltage the Vcc is being run at, so you were right about that. If you want to run this chip at 5V but connect it to a 3V3 system, then make sure the pull up resistors on the two I2C lines are pulled up to 3V3 only.
I suspect that the FET is not being turned on correctly, while it is a logic level FET that is a 5V logic level. There are not many FETs that will switch well on 3V3.
i believe that it is indeed not turning on correctly with 3.3v, as is confirmed when i apply 3.3v to the gate of the transistor and it does nothing while 5v causes it to function normally.
i'm having trouble understanding how i would accomplish implimenting pullup resistors on the i2c lines. i have not added any as of yet, and don't have any more resistors on hand if this calls for additional parts. googling leads me to believe that they're already integrated into one or both of the boards on the i2c bus, so i don't know how i would go about modifying them.
apologies again if i'm misunderstanding.
Or maybe add external pull-downs to ground that have twice the value, so that the I2C signals are pulled
to 3.3V by the effective resistor divider them make with the pull-ups? Assuming 3.3V is enough to be
recognized as properly high by the PCA9685
MarkT:
Or maybe add external pull-downs to ground that have twice the value, so that the I2C signals are pulled
to 3.3V by the effective resistor divider them make with the pull-ups? Assuming 3.3V is enough to be
recognized as properly high by the PCA9685
Well I do remember the IEEE bus that did have both pull up and pull down resistors on a parallel bus back in the 80s , used on the Commodore Pet computer.
am i correct in assuming that these are the pull up resistors?
i can take either route, but adding the resistors to create a voltage divider sounds less likely to be messed up with poor soldering skills since i wouldn't be removing anything.
What resistors would i need for both scenarios?