Category Archives: Tlc5940

Controlling Many Servo(s) Using IC TLC5940

by : Antonius (@sw0rdm4n)
http://www,ringlayer.net

Tlc5940 is a 16 channel led driver.  Since this IC has pwm control ability we can use this IC for controlling up to 16 servo(s).

Below is tlc5940 datasheet:
http://www.ti.com/lit/ds/symlink/tlc5940.pdf

TLC5940 pins:

tlc5940pinouts

out0 – out15 pin will be used for pwm controller on each servo. In this tutorial, we will control 5 motor servos using tlc5940 and arduino uno.

Requirements:

  • 1 arduino uno
  • 1 tlc5940
  • 1 half + breadboard
  • 5 resistor 2,2 k
  • male to male jumper wires
  • arduino uno
  • 5 tower pro micro servos

Schematic:

tlc5940_schematic

Actually It’s better to use external power source to power multiple servo.

20141216_061627

 

Here’s the code for arduino:

#include "Tlc5940.h"
#include "tlc_servos.h"
void setup()
{
  tlc_initServos();  
}
void loop()
{
  int i;
  
  for (i = 1;i <= 5; i++) {
    tlc_setServo(i, 0);
    Tlc.update();
    delay(300);
    tlc_setServo(i, 180);
    Tlc.update(); 
    delay(300);
  }
  
}

On success, we can control our 5 servo(s), just like in this video:

Advertisements