Introduction: LED Heart Photo Frame - Make a Perfect Valentine's or Birthday Present

About: Founder and Author of www.HowToMechatronics.com, an education website in the area of Mechanical, Electrical and Computer Engineering. Tutorials, Tips, Tricks, How It Works, Projects, Examples, Source Codes, Do…

Hello! In this instructable I will show you how you can make this awesome LED Heart Photo Frame. For all Electronics Enthusiasts! Make the perfect Valentine's, Birthday or Anniversary present for your loved ones!

You can watch the Demo Video of this project on the video below and read the step by step instructions how to build one in the text below. Also if you want you can watch a detailed DIY Video of this Project on my official website, www.HowToMechatronics.com.

Step 1: Demo Video

So what we have here is a simple photo frame with 32 LEDs in a shape of a heart on the back side of the photo. This is a really interesting DIY Projects and I recommend to all electronics enthusiasts to build one for their loved ones as a Valentine's or Birthday present.

Step 2: Components Requirements

Arduino Nano – via Banggood

Ultra Bright Red LEDs – via Banggood

Switch – via Banggood

Power Jack – via Banggood

DC 5V >1A Adapter – via Banggood

2 x TLC5940 LED Drivers

2 x 2K Resistors

1uF & 0.1uF Capacitors

Step 3: Get Ready the Photo Frame

First you need a simple photo frame with the following dimensions: 18 x 13 cm. Additionally you need a fiberboard cut to the size of the frame on which using a drill you will make 32 holes so that you can insert the LEDs in there.

The Anodes of all LEDs have to be soldered together and the Cathodes have to be connected to the TLC5940 PWM Driver. After soldering you should check whether all of the LEDs work properly.

Step 4: Wiring

Here's how the circuit schematics of this projects looks like. So using the Arduino Nano and the TLC5940 ICs you can control all 32 LEDs. You need few additional components, two capacitors for decoupling and two resistors for current limiting of the TLC5940. You can find more details how to connect and use this IC with the Arduino on my particular Arduino and TLC5940 Tutorial.

Step 5: Put All Together

Now according to the circuit schematics you need to connect everything together. First you should insert and solder all IC sockets and pin headers as well as the capacitors. Then you need to insert the Arduino and the LED Drivers and connect everything else using jump wires.

When you are done with this, you should again check whether the LEDs work properly before continuing. You can do that by uploading the Arduino code below.

Step 6: Arduino Code

For this Project I used the TLC5940 Library made by Alex Leone. You need to make some modifications when using the library with two TLC5940 ICs. You need to modify the tlc_config.h file and change the value of the variable NUM_TLCS to value of 2.

Here's the complete Arduino code:

<br><p>/*  LED Heart Photo Frame - Arduino Project<br> *  Program made by Dejan Nedelkovski,
 *  www.HowToMechatronics.com 
 *</p><p>* TLC5940 Library by Alex Leone, https://code.google.com/archive/p/tlc5940arduino/
 *  You need to modify tlc_config.h located in the TLC5940 library 
 *  and change the value of the variable NUM_TLCS to the numbers of TLC5940 ICs connected
 */</p><p>#include "Tlc5940.h" </p><p>int stage = 0;
int randomNumber;
int count = 0;
int brightness = 3500;
int brightUp = 50;
int dir=1;</p><p>void setup() {
  Tlc.init();
}</p><p>void loop() {
  
  switch(stage) {    
    //-----Stage 1
    case 0:
      randomNumber = (int)random(0,31);
      Tlc.set(randomNumber,4095);
      delay(1500);
      Tlc.update();
      if(count >= 8) { 
        stage = 1;
        count = 0;
      }
      else {
        ++count;
      }
    break;
    //-----Stage 2
    case 1:
      delay(75);
      for(int i=31;i>=0;i--) {
        Tlc.set(i,4095);
        delay(100);
        Tlc.update();
      }
      delay(500);
      Tlc.clear();
      Tlc.update();
      stage = 2;
      delay(500);
    break;
    //-----Stage 3
    case 2:
      for(int i=0;i<=31;i++) {
        Tlc.set(i,4095);
      }
      Tlc.update();
      delay(500);
      Tlc.clear();
      Tlc.update();
      delay(350);
      if(count > 6) { 
        stage = 3;
        count = 0;
      }
      else {
        ++count;
      }
    break;
    //-----Stage 4
    case 3:
      for (int i=0;i<=15;i++) {
        Tlc.set(i,4095);
        Tlc.set(31-i,4095);
        Tlc.update();
        delay(70);
      }
      delay(50);
      for (int i=15;i>=0;i--) {
        Tlc.set(i,0);
        Tlc.set(31-i,0);
        Tlc.update();
        delay(70);
      }
      for (int i=15;i>=0;i--) {
        Tlc.set(i,4095);
        Tlc.set(31-i,4095);
        Tlc.update();
        delay(70);
      }
      for (int i=0;i<=15;i++) {
        Tlc.set(i,0);
        Tlc.set(31-i,0);
        Tlc.update();
        delay(70);
      }
      delay(50);
      
      Tlc.clear();
      Tlc.update();
      delay(100);
      if(count > 1) {
        stage = 4;
        count = 0;
      }
      else {
        ++count;
      }
    break;
    //-----Stage 5
    case 4:
      for (int i=15;i>=count;i--) {
        Tlc.set(32-i,4095);
        Tlc.update();
        delay(5);
        Tlc.set(32-i-1,0);
        Tlc.update();
        delay(5);
        Tlc.set(i,4095);
        Tlc.update();
        delay(5);
        Tlc.set(i+1,0);
        Tlc.update();
        delay(50);
      }
      if(count > 15) {
        Tlc.set(16,4095);
        Tlc.update();
        delay(2000);
        stage = 5;
        count = 0;
      }
      else {
        ++count;
      }
    break;
    //-----Stage 6
    case 5:
      for (int i=0;i<=31;i++) {
        Tlc.set(i,brightness);
        Tlc.update();
      }
      Tlc.update();
      brightness = brightness + brightUp;
      if (brightness>=3500) {
        brightUp=-50;
        ++count;
      }
      if (brightness<=150) {
        brightUp=50;
      }
      if(count > 6) { 
        stage = 6;
        count = 0;
        brightness = 3500;
        Tlc.clear();
        Tlc.update();
      }
      delay(40);
    break;
    //-----Stage 7
    case 6:
      for (int i=0;i<=30;i+=2) {
        Tlc.set(i,4095);
        Tlc.set(i+1,0);        
      }
      Tlc.update();
      delay(500);
      for (int i=0;i<=30;i+=2) {
        Tlc.set(i,0);
        Tlc.set(i+1,4095);       
      }
      Tlc.update();
      delay(500); 
      if(count > 20) {
        stage = 7;
        count = 0;
      }
      else {
        ++count;
      }
    break;
    //-----Stage 8
    case 7:
      for(int i=31;i>=16;i--) {
        Tlc.clear();
        Tlc.update();
        delay(2);
        Tlc.set(i,4095);
        Tlc.set(i+1,2000);
        Tlc.set(i+2,1000);
        Tlc.set(i+3,500);
        Tlc.set(i+4,300);
        Tlc.set(i+5,200);
        Tlc.set(i+6,100);
        Tlc.set(i+7,50);
        Tlc.set(i+8,0);</p><p>        Tlc.set(i-16,4095);
        Tlc.set(i-15,2000);
        Tlc.set(i-14,1000);
        Tlc.set(i-13,500);
        Tlc.set(i-12,300);
        Tlc.set(i-11,200);
        Tlc.set(i-10,100);
        Tlc.set(i+-9,50);
        Tlc.set(i-8,0);
        
        Tlc.update();
        delay(50); 
      }
      if(count > 8) {
        for(int i=31;i>=0;i--) {
        Tlc.set(i,4095);
        Tlc.update();
        delay(50);
        }
        stage = 8;
        count = 0;
      }
      else {
        ++count;
      }
    break;
    //-----Stage 9
    case 8:
      for(int i=31;i>=0;i--) {
        Tlc.set(i+8,4095);
        Tlc.set(i+7,2000);
        Tlc.set(i+6,1000);
        Tlc.set(i+5,500);
        Tlc.set(i+4,300);
        Tlc.set(i+3,200);
        Tlc.set(i+2,100);
        Tlc.set(i+1,50);
        Tlc.set(i,0);
        Tlc.update();
        delay(50);
      }
      for(int i=31;i>=0;i--) {
        Tlc.set(i,4095);
        }
      Tlc.update();
      delay(10);
      if(count > 8) {
        delay(8000);
        Tlc.clear();
        Tlc.update();
        stage = 0;
        count = 0;
      }
      else {
        ++count;
      }
    break;
      
  }
}</p>

Step 7: Cover Box for the Electronics

After you have checked that everything works well using the above code now you need to finish the project by making a cover box for the electronics. I did that using some more pieces of fiberboard and glued them together for forming a box. At the back side of the box you need to make two holes, one for a power jack and another for a switch.

At the end all you have to do is print your photo, add it to the frame, secure it and your are done!

I hope you will liked this project. If it's so, for more cool projects and tutorial, you can always check my official website, www.HowToMechatronics.com and follow me on Facebook.

Valentine's Day Challenge 2016

Participated in the
Valentine's Day Challenge 2016