Multiple Power Control via PWM - What's the limit?

JBrookes

Member
For a super-aquarium project, I want to dim power leds and pumps via a pwm output. I'd like to have 6 mosfet-controlled voltages 9-12 VDC.
Here is what I assume:
1. pwm only useful pin output for this, hpwm not useful. (?)
2. 20m2 seems to have the most pwm's - 4 of 'em.
3. bit-banging a possibility, with just a loop and pauses?

Any advice on how to proceed to use the p'axe as a power controller on 6-8 channels of control?
I can envision a loop in which the individual pins are turned on for a certain time period:
hipause = 5

high 1
pause hipause
low 1

...etc.


Any other ideas to do this? multiple picaxe chips running one program?
Thanks
JB
 

geoff07

Senior Member
I would be tempted to use one 08M2 per channel (they cost £1.80 each), and instruct each 08M2 using a bigger chip to decode user requirements and send a serial instruction to the channels. Then I would use a mosfet driver chip to interface the 08M2s to the fets. I might also use another dedicated 08M2 with an IR remote to control the lot. The hardware cost is probably above the minimum (no doubt others will be able to get everything into one chip) but the software will be simpler and thus quicker to write and require less maintenance. Mosfet drivers cost more but they can be dual channel and simplify the drive when a logic-level source (the picaxe) is driving a 12v-supplied mosfet.
 

inglewoodpete

Senior Member
The 28X2 has 4 independent PWM channels and can also be used as an i2c slave. You could use one 28X2 (or a 14M2/18M2/20M2) as an i2c master, with its own 4 (2, 2 or 4) PWM channels.
 

JBrookes

Member
master-slave solution

The 28X2 has 4 independent PWM channels and can also be used as an i2c slave. You could use one 28X2 (or a 14M2/18M2/20M2) as an i2c master, with its own 4 (2, 2 or 4) PWM channels.
Thank you for your thoughts. I'll have to find examples of i2c (?) control somewhere.
I have been speculating on bit-banging in algorithms - can high-low status be controlled
by a binary value in one operation?

j
 

hippy

Technical Support
Staff member
I have been speculating on bit-banging in algorithms - can high-low status be controlled by a binary value in one operation?
If I have understood the question the answer to that is yes. Set the pin as an output then set the level using a pinX.Y variable. To control pin C.0 ...

Code:
dirC.0 = 1 ; Set C.0 as output
pinC.0 = 0 ; Set C.0 low
pinC.0 = 1 ; Set C.0 high
Assigning a value to pinX.Y can be done using a constant (as above), from a variable or using a calculation to determine the level.

Multiple pins can be set at the same time by using 'pinsX=' assignments.
 

JBrookes

Member
Purported player piano picaxe practical?

If I have understood the question the answer to that is yes. Set the pin as an output then set the level using a pinX.Y variable. To control pin C.0 ...

Code:
dirC.0 = 1 ; Set C.0 as output
pinC.0 = 0 ; Set C.0 low
pinC.0 = 1 ; Set C.0 high
Assigning a value to pinX.Y can be done using a constant (as above), from a variable or using a calculation to determine the level.

Multiple pins can be set at the same time by using 'pinsX=' assignments.
=================
Dear Hippy, (and other respondents)
Yes, my motive is to control a bunch of RGB channels (or RGBA) by dimming. In a parallel thread, it was mentioned that a TI TLC59116 can give 16 channels of control with I2C
control. That sounds attractive, but then you have have TSSOP and a different bunch of technology to interface to. I want to be able to control a MOSFET (who doesn't ?) via the
TLC output, and there is a small amount of analog programing there - probably a pull-down resistor to sink enough current to make the TLC happy would work.

I like the PWM control, but TI seems to ignore putting a capacitor after it to smooth the ouput.

Hippy, if you wanted to control up to 32 led's, and given that you are most familiar with picaxe, how would you contemplate doing this?
 

JBrookes

Member
Stumled Upon Adafruit 16 ch. Device

For a super-aquarium project, I want to dim power leds and pumps via a pwm output. I'd like to have 6 mosfet-controlled voltages 9-12 VDC.
Here is what I assume:
1. pwm only useful pin output for this, hpwm not useful. (?)
2. 20m2 seems to have the most pwm's - 4 of 'em.
3. bit-banging a possibility, with just a loop and pauses?

Any advice on how to proceed to use the p'axe as a power controller on 6-8 channels of control?
I can envision a loop in which the individual pins are turned on for a certain time period:
hipause = 5

high 1
pause hipause
low 1

...etc.


Any other ideas to do this? multiple picaxe chips running one program?
Thanks
JB

===================
Found a board at AdaFruit.com which uses a NXP chip to deliver 16 ch. PWM - It uses I2C. I dunno how compatible to picaxe, but otta be. ?
jb
 

Goeytex

Senior Member
Attached is a circuit that I drew up that will drive 6 Power MOSFETs with PWM. To get 8, just add another driver chip and another PWM on each 14M2 .
There was no information given about PWM controls (sensors,,etc) so I used pots for PWM adjustment. Suggest you do not eliminate the drivers like many folks do and then wonder why the MOSFETs melt. I show IRFZ46NL MOSFETs which have a low RDSON . There are others that are just as good or better. The wrong MOSFETs will get hot and require large heat sinks. If you need advise about MOSFET selection, just ask. It is quite important and there are folks here with experience using Power Mosfets with a Picaxe that can help.

There are tons of excellent specialty drivers for Power LEDs. Most all of them are SMD. In today's world of electronics, SMD parts are a fact of life and cannot always be avoided if we want the best performance. It may be prudent to consider a specialty driver for the LED lighting and something like the circuit above for pumps/ motors . However, the attached circuit will happily drive Power LED's.

TI "ignores" output filters, because at PWM frequencies above about 120 hz there is no flicker perceivable by the human eye.

Good Luck
 

Attachments

JBrookes

Member
pump info

What kind of pumps are you going to control?
Just a little centrifugal pump with a 3m head (they say.) I am using it for artificial rainfall, artificial mist, and plant watering.
The water is kept below the aquarium tank, then periodically pumped up to a holding tank above the tank.
I am also using several small blowers to move air into tank, mist, etc.
 

JBrookes

Member
Thanks for reply. DDDD = my comments

Attached is a circuit that I drew up that will drive 6 Power MOSFETs with PWM. To get 8, just add another driver chip and another PWM on each 14M2 .
There was no information given about PWM controls (sensors,,etc) so I used pots for PWM adjustment. Suggest you do not eliminate the drivers like many folks do and then wonder why the MOSFETs melt.
DDDD Why do MOSFETS melt?

I show IRFZ46NL MOSFETs which have a low RDSON . There are others that are just as good or better. The wrong MOSFETs will get hot and require large heat sinks. If you need advise about MOSFET selection, just ask. It is quite important and there are folks here with experience using Power Mosfets with a Picaxe that can help.

There are tons of excellent specialty drivers for Power LEDs. Most all of them are SMD. In today's world of electronics, SMD parts are a fact of life and cannot always be avoided if we want the best performance. It may be prudent to consider a specialty driver for the LED lighting and something like the circuit above for pumps/ motors . However, the attached circuit will happily drive Power LED's.
DDDD Yes, and it stays picaxe, a devil I am familiar with.

TI "ignores" output filters, because at PWM frequencies above about 120 hz there is no flicker perceivable by the human eye.

Good Luck
DDDD Thanks.

Incidentally, what do you think of adafruit 16 pwm board? http://www.adafruit.com/products/1411

I am not sure the i2c capabilities on the picaxe will drive it...
 

Pongo

Senior Member
Just a little centrifugal pump with a 3m head (they say.) I am using it for artificial rainfall, artificial mist, and plant watering.
The water is kept below the aquarium tank, then periodically pumped up to a holding tank above the tank.
I am also using several small blowers to move air into tank, mist, etc.
That should be OK for PWM. When you wrote "super aquarium" I was thinking of the 2,000 gph pumps I used to use...
 

Goeytex

Senior Member
The PCA9685 looks like a good way to go. The device you linked to is in Arduino shield form factor. You may want to consider This One instead.

You will still need MOSFET Drivers and MOSFETS to drive substantial loads.
 

JBrookes

Member
But how about the TLC5947 board?

The PCA9685 looks like a good way to go. The device you linked to is in Arduino shield form factor. You may want to consider This One instead.

You will still need MOSFET Drivers and MOSFETS to drive substantial loads.
This one is actually recommended by adafruit for leds - it has 24 outputs.
http://www.adafruit.com/products/1429
The immediate question I have is whether the p**axe is capable of driving these
SPI or I2C boards?

The second question concerns the driver. If a "logic" MOSFET only needs 4 volts to turn fully on,
do we still need the driver IC?

Thanks in advance
JB
"just another conservative f***stick"
 

Goeytex

Senior Member
The immediate question I have is whether the p**axe is capable of driving these
SPI or I2C boards?
Why is this a question? Picaxe supports both I2C and SPI. Is there a reason that you suspect it does not ?

The second question concerns the driver. If a "logic" MOSFET only needs 4 volts to turn fully on, do we still need the driver IC?
That depends upon the FET, the switching speed and whether or not you want to use large heat sinks. There is more to driving FETs than voltage alone.
Make sure you are not confusing gate threshold voltage with the voltage that fully turns on the FET. They are different.

All "Logic Level FETs" are not the same. Some have lower gate thresholds than others. Gate capacitance varies widely as well as dloes RDSON. So don't fall in to the trap that any Logic Level FET will work without a driver. They won't. I as well as others have written thousands of words in likely hundreds of posts concerning driving FETs. We did not make this stuff up. It comes from education & experience.

Suggest you take the time to search the Forum and read up. You can possibly eliminate the driver , IF ( and a big one) you select the proper FET and keep the switching speed down. However with any FET the driver will, help protect the Picaxe, improve efficiency (reduce heat), increase reliability, allow faster switching speeds, and is cheap insurance. So ask yourself, is saving $5 - $10 on such a nice project worth eliminating the drivers ?
 

JBrookes

Member
"Super" Aquarium

That should be OK for PWM. When you wrote "super aquarium" I was thinking of the 2,000 gph pumps I used to use...
Super in concept - It is actually not an aquarium, but a "weather-ometer," capable of re-creating weather conditions 100 million years ago...
 

JBrookes

Member
My replies - DDDD

Why is this a question? Picaxe supports both I2C and SPI. Is there a reason that you suspect it does not ?

DDDD - My suspicion is based on ignorance of the protocols. Are there glitches like timing ot other incomatibility that would be-devil
the effort to write software to control via SPI/I2C ? I am saying this because serial protocols seem timing-sensitive, and I am wondering how
compatible the IC is with the Picaxe, an admittedly slow chip.


That depends upon the FET, the switching speed and whether or not you want to use large heat sinks. There is more to driving FETs than voltage alone.
Make sure you are not confusing gate threshold voltage with the voltage that fully turns on the FET. They are different.

All "Logic Level FETs" are not the same. Some have lower gate thresholds than others. Gate capacitance varies widely as well as dloes RDSON. So don't fall in to the trap that any Logic Level FET will work without a driver. They won't. I as well as others have written thousands of words in likely hundreds of posts concerning driving FETs. We did not make this stuff up. It comes from education & experience.

Suggest you take the time to search the Forum and read up. You can possibly eliminate the driver , IF ( and a big one) you select the proper FET and keep the switching speed down. However with any FET the driver will, help protect the Picaxe, improve efficiency (reduce heat), increase reliability, allow faster switching speeds, and is cheap insurance. So ask yourself, is saving $5 - $10 on such a nice project worth eliminating the drivers ?
OK thanks. jb
 

Goeytex

Senior Member
DDDD - My suspicion is based on ignorance of the protocols. Are there glitches like timing ot other incomatibility that would be-devil
the effort to write software to control via SPI/I2C ? I am saying this because serial protocols seem timing-sensitive, and I am wondering how
compatible the IC is with the Picaxe, an admittedly slow chip.
Hardware I2C (HI2C) and and hardware SPI (HSPI) are not affected by the Picaxe processing overhead as they rely upon the PICs internal hardware MSSP module. I2C and SPI are not nearly as timing sensitive as asynchronous serial (RS232) since the data is clock synchronized.
 

JBrookes

Member
tlc5947 pwm led driver + 20X2 SPI ?

Hardware I2C (HI2C) and and hardware SPI (HSPI) are not affected by the Picaxe processing overhead as they rely upon the PICs internal hardware MSSP module. I2C and SPI are not nearly as timing sensitive as asynchronous serial (RS232) since the data is clock synchronized.
You've certainly convinced me about the driver. Thanks.

In particular, here's a 24 ch TI TLC5947 IC on a PCB which looks pretty good:

http://www.adafruit.com/products/1429

Do you have reason to believe this would be fairly straightforward to control via the picaxe SPI capability? Thinking a 20X2...

TIA JB
 
Top