Go Down

Topic: Control P30N06LE with PCA9685? (Read 276 times) previous topic - next topic

myleskeller

May 13, 2017, 04:00 pm Last Edit: May 13, 2017, 04:05 pm by myleskeller
Hello,

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?

EDIT:
the parts used are:
P30N06LE board | https://www.sparkfun.com/products/12959
PCA9685 board | https://www.adafruit.com/product/815
NodeMCU 12E board | https://www.amazon.com/ESP8266-NodeMcu-ESP-12E-Development-Board/dp/B017KK0AVQ

attached is a schematic of how it is currently configured.

Wawa

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..

myleskeller

thanks for the reply!

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.

Wawa

If it all worked on a 5volt Arduino, it should also work on a 3.3volt system.
Double-check the wiring, or post a picture.
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.

Wawa

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..





myleskeller

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.

Grumpy_Mike

Quote
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.
Yes they are on the PCA9685 board pulling up to the board's Vcc.

So if you want to use this board at 5V and yet drive it from a 3V3 system then you need either to:-
1) Add an I2C level shifter board.
or
2) Unsolder them and add external pull up resistors to 3V3

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
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Grumpy_Mike

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
Good idea, I haven't thought of that one.

MarkT

[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Grumpy_Mike

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.

myleskeller

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?

Grumpy_Mike

Quote
What resistors would i need for both scenarios?
From reply #8
Quote
Or maybe add external pull-downs to ground that have twice the value,
So that would be 20K then.

Quote
What resistors would i need for both scenarios?
What is the other one? Normal single pull ups to the Vcc of the device on a 3V3 system would normally be 2K7.

Go Up