loading
Picture of Put 40 LEDs and Brain into Robot Head
RobotBrain86.JPG
RobotBrainDesign02.jpg
RobotBrainDesign.jpg
I was thinking about to build my first robot, the robot that would animate the LEDs, respond to the sensor(s) that I may be added later, or do something relate to LED that are installed on the mouth.

Image 2, is the 3D model of my robot head. An inspiration from Instructables' bot.

This is a challenge for me to built this project, a project that has a lot of things that I am about to do the first time.
This is the first time that I design a laser cut pieces, which I doubted if they are going to fit together?
This is the first time that I am using 40 LEDs in the same project.
This is the first time that I am using three TLC5940NT ICs at once.

The challenge is to put 40 LEDs, three TLC5940NT, good amount of wires to connect all LEDs to ICs into a 5x5.5x6cm. Acrylic box (Robot Head).

And here is how I did it.

 
Remove these adsRemove these ads by Signing Up

Step 1: Parts and Tools

Picture of Parts and Tools
RobotBrain02.JPG
RobotBrain11.JPG

PARTS

3 nos. 16-channels PWM chips, TLC5940NT
40 nos. 3mm
Arduino or Arduino compartible
hook up wires
Laser cut acrylic (or wood) robot head (attached eps file below)
Medium length jumper wires

Foam core art board

TOOLS

The tools that I used in this project are:
Solder iron and Solder station
Hookup Wire
Diagonal Cutter
Needle Nose Pliers
X-Acto Knife
Wire Stripper
Coarse Needle Files

Step 2: Assemble Robot Head

Remove the laser cut Acrylic robot head pieces out of the delivered package.

NOTE: I did not removed the protective skin from the Acrylic pieces, to protect them from scratch that might accidentally happened.

There are six panels for each side of the head,
Front piece has two small holes on top and one big rectangle opening.
Left and right have one medium size hole slightly on top of the piece.
Top piece and Back piece are solid.
Bottom piece bas big hole in the middle.

There are two rectangle pieces that has 40, 3mm diameter holes, on them. One are cut through, the other is only has the etch marks on it. These two pieces are for the LEDs installations.

I used the needle file to file down all the notches on every single pieces to make them fit together.


Step 3: Assemble the brains, TCL5940 ICs

The reason I used TCL5940 is because there are good available resources in instructables community. And those instructable proof to be successful, and that help me decided to use the ICs, such as
Build an Arduino powered talking robot head, which far more complicated than my robot head.

For the details information of TCL5940 Arduino library, diagram and explanation can be found at this link.  http://code.google.com/p/tlc5940arduino/

Test all the LEDs

Before assembling the LEDs I tested all the LEDs by placed the coin battery in between both leads of the LED, by facing the positive lead to the positive end of the coin battery one by one. So I do not use the broken LED.

Set up the test on the Breadboard.

Before I went ahead to connect all the LEDs to ICs. I set up an ICs on the breadboard, and connects 16 LEDs to the output pins on the IC according to the schematic from both of  the websites mentioned above.

Then I loaded the example (BasicUse.ino) from the TCL5940 Arduino Library that i downloaded and installed in Arduino IDE library.

How to put three 28-pin IC into 5x5.5x6mm Robot head?

This is the trickiest part. Looking at my hand drawn schematic below. If I laid all three ICs side by side on the PCB board. It would be impossible to put these ICs in such a small volume as 5x5.5x6cm.

But if we look carefully, one side of the IC are all output pins included pin 28, and 15 that are located on the top and bottom of the other side of the IC. Which allow us to connect and bend the wire to the same side of others out put pin. 
We can daisy chain all ICs together. And all the pins that needed to daisy chain to Arduino were located on the same position.
 
The problem that we need to worry about are the IREF pin that needed to connect to 2K resistors. And the SOUT of the first IC that needed to connect to SIN of the second IC, and SOUT of second IC that needed to connect to the SIN of the third IC. But not a big problem or unmanageable. I solved the problem by using small hookup wire to connect this pin together (as shown in photo #15).

To put all of the three ICs and a good amount of wiring I solved the problem by piggy back all the ICs together. This way I saved a lot of space. Then solder the pins for daisy chain together.
Other thing I needed to do is spreading the output pins for LEDs out vertically so the pins won't connected or short together.(as shown in the photo #11 and #12 )

Then I cut and bend the positive lead as shown in the photo #5 below. And I soldered the positive LEDs of eight LEDs together. And I did this five times, so I have five rows of eight LEDs to fit on the mouth piece of  the robot.

I connected two rows of LEDs to each ICs, except the third IC, I only connected the fifth row of LED to it. 
I did these before piggy backing all the ICs together.






Step 4: Put things inside the Robot Head

Picture of Put things inside the Robot Head
RobotBrain67.JPG
RobotBrain68.JPG
RobotBrain69.JPG
RobotBrain70.JPG
It's time to stuff them into the head!

First, I slowly squeezed the connected ICs and LEDs into the Head(box) slowly, even before solder the bottom IC ( #1) to the PCB to see if it fit. And to see where the ICs would be located on the back piece of robot head.
It was kind of tight because the wires got stiff after soldered to the ICs and LEDs.

After that I cut a piece of PCB to the size of back piece of robot head. 
And solder the bottom IC(#1) to the PCB. Then added the 2K resistors to th PCB and soldered them to pin accordingly.

Then soldered the seven jumper wires to  ICs
SIN pin on the bottom IC, this jumper wire went to Arduino pin D11
SCLK pins on every IC, this jumper wire went to Arduino pin D13
XLAT pins on every IC, the jumper wire went to Arduino pin D9
BLANK pins on every IC, the jumper wire went to Arduino pin D10
GSCLK pins on every IC, the jumper wire went to Arduino pin D3

I used the masking tape to labeled the jumper wires, so I know where the jumper wires would be connected to as the future reference.




Step 5: Decorating the Head

First image below is the 3D rendering image of my robot head design. As mentioned earlier, the head consisted of the 3D Print of ears and eyes. 
But it was not worthwhile to have 3D print done at this stage. The cost of making these ears and eyes were too expensive.

So I decided to create the dummy ears and eyes to make the project look as close as the complete project as possible.
By using foam core art board, I transferred the design of the eyes and eyebrow to the foam board and used the X-ACTO knife to cut out the eyes piece out.  Then glued it to the cutout round eye holes.

Also I did the same to the ears, by cut the two different size round shape from the foam board and then added the antenna to them, as shown in the photo.

Step 6: Activates the Brain

Picture of Activates the Brain
palmDuinoII_21.JPG
RobotBrain72.JPG
RobotBrain90.jpg
At this time I am still working on the code for the robot head to do what I want it to do. And it is not working as good as I want it to do. So I apologize for that.

Instead I used the example code available from the TLC5940 library, (CircularLightBuffer.ino).
I have to modified the code by added one of the constant value in the code, NUM_TLCS, by add this line

#define TLC_TOTAL 3

then replaced NUM_TLCS in the code with TLC_TOTAL.  This constant is the number of TCL5940 IC we are actually used. (NUM_TLCS was defined as 1) And it was located in one of the header file. I thought it was a lot more convenient to substitute the value in the example code than went to the original code and change the value there.


/*
    A circular light buffer.  If you manage to construct a circle of LEDs,
    definitely send in pictures.  What this sketch does is take an analog
    reading off of analog pin 0 and add it to the current value of the last LED.
    If the resultant sum is greater than 4095, it turns the LED off,
    otherwise sets LED 0 to the value of the sum.

    If you ground pin 12, it will set LED 0 to zero.

    Then it shifts all the LED values up one (so LED 0 becomes LED 1) and sets
    LED 0 to the value shifted off the last LED (so if one LED is on, it will
    go in a circle forever).

    See the BasicUse example for hardware setup.

    Alex Leone <acleone ~AT~ gmail.com>, 2009-02-04 */

#include "Tlc5940.h"
#include "tlc_shifts.h"
#define TLC_TOTAL      3

// which analog pin to use
#define ANALOG_PIN      0

// which pin to clear the LEDs with
#define CLEAR_PIN      12

// how many millis for one full revolution over all the LEDs
//#define SCOPE_PERIOD    (2000 * TLC_TOTAL)
#define SCOPE_PERIOD    (2000 * 3)
//#define LED_PERIOD      SCOPE_PERIOD / (TLC_TOTAL * 16)
#define LED_PERIOD      SCOPE_PERIOD / (3 * 16)
void setup()
{
  pinMode(CLEAR_PIN, INPUT);
  digitalWrite(CLEAR_PIN, HIGH); // enable pull-up
  Tlc.init();
}

void loop()
{
  // shiftUp returns the value shifted off the last pin
  uint16_t sum = tlc_shiftUp() + analogRead(ANALOG_PIN) * 4;
  if (digitalRead(CLEAR_PIN) == LOW || sum > 4095)
    sum = 0;
  Tlc.set(0, sum);
  Tlc.update();
  delay(LED_PERIOD);
}

Step 7: Project Summary

Picture of Project Summary

This is the first phrase ( robot head) of the whole project, robot body, etc.

This part of the project seem to produce a good out come. I needed to tweek the wiring of the LEDs to TLC5940 ICs. I could used the (16 wires) flat ribbon cable instead of the individual hookup wire. Since the flat ribbon cable seem to have more flexibility than the individual hook up wire, which were stiffer than the flat ribbon cable.

The laser cutter (if I won the Hurricane Laser Cutter Contest) would shorten the time building other parts for the whole project.
Because I do not have to wait for two weeks for the laser cut parts to be available from the fabricator.

I could replaced the ears and eyes of the robot with 2D laser cut Acrylic instead of using 3D print parts, which cost a lot more to make. The dummy ears and eyes that I put on seem to be working well.

If you have anyother comments please feel free to do so.

Thanks for reading.

Video

cool project! I've worked with those chips before too, it can be a pain to wire them all. Have you ever tried multiplexing a tlc5940? that way you can use one chip to control all your LEDs.
sath02 (author)  amandaghassaei2 years ago
Thanks.
This is my first time using the TLC5940!
Where I can find the info of how to multiplex the IC?
there's some really good code at the end of this pdf for how to set up the tlc5940 without using the tlc arduino library (I've tried using the library for multiplexing but it is too slow). it doesn't talk specifically about multiplexing, but there's some code here that uses it 4 tlc to multiplex 64 rgb leds:
sath02 (author)  amandaghassaei2 years ago
Thanks for the quick respond. I'll take a look.