2
\$\begingroup\$

I'm using a PWM shield (http://www.practicalmaker.com/products/arduino-shields/pwm-shield-assembled) which allows to extend the number of PWM pins for an Arduino.

In my project I'm using NPN TIP120 transistors to control more than 5 motors.

So when I try my circuit without the shield, everything works fine, I connect the Arduino pwm pins to control de transistor (external power source with 20 A)

Then If I try the PWM shield directly powering a simple led it works fine as well, the problem is the PWM as I understand is very led-oriented and has a negative and positive pin for each PWM terminal which Arduino doesn't have. And my problem is where I connect the negative pin of the PWM shield? I tried just connecting it to the ground pin in Arduino but the motors just run, not responding to the different speeds I'm trying to achieve.

Also, I'm using a midi library, which I hope doesn't interfere on this since as I said, the PWM shield works fine when using a led directly on negative-positive pins on the shield.

\$\endgroup\$
  • 3
    \$\begingroup\$ This is absolutely an appropriate engineering issue, as Dave's answer clearly demonstrates. \$\endgroup\$ – Chris Stratton Apr 22 '13 at 13:43
4
\$\begingroup\$

Your setup is quite different from the standard TLC5940 use, but can be done. The key points are that the TCL5940 is open-drain, and that the actual current and high voltage will be driven by the TIP120.

enter image description here

Logic will be reversed, from the TLC5940's standpoint. Motor will be On, when the TLC Out is OFF. When the OUTx is set to Off, the line will be brought up to 5V through the R Pullup, which also limits the current to 2.4mA (5V - TIP120's 1.4v drop = 3.6V through the resistor, 3.6 / 1500 = 2.4mA). Based on the TIP120's gain, this should (2.4mA * 1000) 2.4 Amps. You can adjust the resistor for the needed gain. When the OUTx is set to On, the line is shorted to ground, turning off the Tip120.

I.E. Setting the TLC5940 to 65% ON, will result in an actual 35% ON, at the motor. Setting it to 25% ON will result in 75% ON at the motor.

\$\endgroup\$
  • \$\begingroup\$ This is epic!!! I see so I can invert the PWM thru the code in arduino. Thanks soooo much for your time!! \$\endgroup\$ – Macumbaomuerte Apr 22 '13 at 20:33
8
\$\begingroup\$

The outputs of the TLC5940, the chip used on your shield, are current sinks, not totem-pole outputs, and therefore they cannot directly drive the base of an NPN transistor.

At the very least, you'll need to add a pullup resistor at the base of each transistor, but this may not be sufficient, and you'll need to add additional buffering as well.

\$\endgroup\$
  • \$\begingroup\$ Additionally, it appears that while the even numbered header pins are connected to the IC, the opposing odd numbers are connected to a net which can be jumper selected to either the internal VCC or external supply. \$\endgroup\$ – Chris Stratton Apr 22 '13 at 13:47
  • \$\begingroup\$ Thanks! I cannot find what is the maximum AMP for this shield but I guess a workaround would be to directly connect the power source to the shield but with 12V and 15A I'm scared of burning the shiled or arduino. \$\endgroup\$ – Macumbaomuerte Apr 22 '13 at 13:55
  • \$\begingroup\$ The data sheet Dave helpfully linked for you indicates that the chip itself might tolerate that voltage, but you'll have to check the board/schematic for the ratings of other components and the separation of load and logic supplies. It does not however appear that the chip would be able to sink the current required by anything but the tiniest motors, and even that is probably a bad idea. In other words, you will need external motor drivers. \$\endgroup\$ – Chris Stratton Apr 22 '13 at 14:20
  • \$\begingroup\$ +1 for decoding the question and addressing it well: Mark of a good engineer. \$\endgroup\$ – Anindo Ghosh Apr 22 '13 at 16:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.