Introduction: Arduino Telesketch With Led Matrix

Picture of Arduino Telesketch With Led Matrix

Here is just a simple guide to create a telesketch using an Arduino. This design uses an Arduino, two led matrix of 8x32, a Buzzer, two rotary encoders and some buttons. We hope you will learn how to use rotary encoders and led matrix. Also he hope you will have fun following the steps and building your own retro telesketch!!

Step 1: Selecting Components

Picture of Selecting Components

Materials required:

For the box:

  1. DM 2 mm
  2. Acrylic glass (white)
  3. Paint (the color you want)
  4. 3D printed cover for rotary encoder (document attached)

For the electronics:

  1. Led matrix 8 x 32 (2 units)
  2. Rotary encoder (2 units)
  3. Push button (3 units)
  4. Buzzer
  5. 220 ohm Resistors (2 units)
  6. Jumper wires (28 units)
  7. 9V battery

Step 2: Making the Box

Picture of Making the Box

To make the box you may have acces to a laser cuter.

We designed the box to have a retro look and atractive shape with no corners. The box is made of DM a kind of wood more cheap and perfect for the laser cutting.

To cut the box you have to download the attached document, it contains all the shapes ready for being cutted on laser.

To assamble the parts we recomend use hot-melt adhesive it's strong and fast.

  1. Firs you have to joint 2 ribs to make 1 more strong, at the end you will have 2 ribs each made of 2 ribs.
  2. Then assamble the wall to the ribs.
  3. Take the front lid and hook the screen frame from behind.
  4. Paint all the wood parts with the color you like more!! (we chose electric blue)
  5. Place the acrylic glass screen.
  6. Join the front lid and the wall with the ribs.
  7. Don't join the rear cover until the electronics are in place.

Step 3: Mounting Electronics

Picture of Mounting Electronics

The photo above shows the setup of the project.
The circuit should be setup as follows:

  • Connect a red wire from the 5V pin on the Arduino to the positive channel of the breadboard.
  • Connect a black wire from the GND pin on the arduino to the negative channel of the breadboard
  • Buzzer = pin 8
  • Led matrix
    • VCC
    • GND
    • DIn = pin 12
    • CS = pin 11
    • CLK = pin 10
  • Rotary encoder (1)
    • VCC
    • GND
    • DT = pin 3
    • CLK = pin 4
  • Rotary encoder (2)
    • VCC
    • GND
    • CS = pin 5
    • CLK = pin 6
  • Push button (reset) = pin 1
  • Push button (play) = pin 2

Step 4: The Code

Now that you have finished the setup, its time to code . You can copy te following code and modify it to upgrade the telesketch.

//We always have to include the librarys
#include "LedControl.h"
#include "pitches.h"


LedControl lc = LedControl(12, 11, 10, 8);
int val;
int encoder0PinA = 3;
int encoder0PinB = 4;
int encoder0Pos = 0;
int encoder0PinALast = LOW;
int n = LOW;


int valo;
int encoder1PinA = 5;
int encoder1PinB = 6;
int encoder1Pos = 0;
int encoder1PinALast = LOW;
int o = LOW;
int adress = 3;
int devices = lc.getDeviceCount();


int melody = NOTE_D5;
int melody1 = NOTE_C5;
int duration = 50;


boolean play = false;
boolean menu = false;

unsigned long delaytime = 500;

void setup() {
  pinMode(2, INPUT);
  pinMode(1, INPUT);
  pinMode(7, INPUT);
  pinMode (encoder0PinA, INPUT);
  pinMode (encoder0PinB, INPUT);
  pinMode (encoder1PinA, INPUT);
  pinMode (encoder1PinB, INPUT);
  Serial.begin (9600);

int devices = lc.getDeviceCount();
  for (int address = 0; address < devices; address++) {
    lc.shutdown(address, false);
    lc.setIntensity(address, 8);
    lc.clearDisplay(address);
  }
}

void loop() {
 if (digitalRead(2) == LOW) {
    play = !play;
  }
if (play) {
 Movement();
    pinta();
    if (digitalRead(1) == LOW) {
      omple();
      neteja();
    }
  }
}

void pinta() {
  if (adress >= 0)
  {
    if (encoder1Pos <= 7)
    {
      lc.setLed(adress, encoder0Pos, encoder1Pos, true);
    }
    else
    {
      adress--;
      encoder1Pos = 0;
    }
  }
  if (adress > 4)
  {
    if (encoder1Pos > 7)
    {
      adress--;
      encoder1Pos = 0;
    }
  }
  if (adress < 3)
  {
    if (encoder1Pos < 0)
    {
      adress++;
      encoder1Pos = 7;
    }
  }
  if (adress > 3 && adress < 7)
  {
    if (encoder1Pos < 0)
    {
      adress++;
      encoder1Pos = 7;
    }
  }
  if (encoder0Pos > 7)
  {
    adress += 4;
    encoder0Pos = 0;
  }
  if (encoder0Pos < 0)
  {
    adress -= 4;
    encoder0Pos = 7;
  }
}

void Movement(){
  n = digitalRead(encoder0PinA);
  if ((encoder0PinALast == LOW) && (n == HIGH)) {
    if (digitalRead(encoder0PinB) == LOW) {
      encoder0Pos--;
      tone(8, melody1, 50);
    } else {
      encoder0Pos++;
      tone(8, melody, 50);
    }
  }
  encoder0PinALast = n;
  o = digitalRead(encoder1PinA);
  if ((encoder1PinALast == LOW) && (o == HIGH)) {
    if (digitalRead(encoder1PinB) == LOW) {
      encoder1Pos--;
      tone(8, melody1, 50);
    } else {
      encoder1Pos++;
      tone(8, melody, 50);
    }
  }
  encoder1PinALast = o;
  int devices = lc.getDeviceCount();
}

void omple() {
  int devices = lc.getDeviceCount();
  for (int row = 0; row < 8; row++) {
    for (int address = 0; address < devices; address++) {
      lc.setLed(address, row, 7, true);
      lc.setLed(address, row, 6, true);
      lc.setLed(address, row, 5, true);
      lc.setLed(address, row, 4, true);
      lc.setLed(address, row, 3, true);
      lc.setLed(address, row, 2, true);
      lc.setLed(address, row, 1, true);
      lc.setLed(address, row, 0, true);
      delay(50);
    }
  }
}

void neteja() {
  int devices = lc.getDeviceCount();
  for (int row = 0; row < 8; row++) {
    for (int address = 0; address < devices; address++) {
      lc.setLed(address, row, 7, false);
      lc.setLed(address, row, 6, false);
      lc.setLed(address, row, 5, false);
      lc.setLed(address, row, 4, false);
      lc.setLed(address, row, 3, false);
      lc.setLed(address, row, 2, false);
      lc.setLed(address, row, 1, false);
      lc.setLed(address, row, 0, false);
    }
  }
  play = !play;
}

Step 5: Finishing Touch

Picture of Finishing Touch

At these point you can upgrade the design of the case by adding some vinyls and 3D printed parts for the rotary encoders.

The file for the 3D model is at the end of the document in style format.

Step 6: Play & Enjoy

Picture of Play & Enjoy

This is a really fun project, we had a lot of fun creating it. Now is time to play and revive memories of the childhood!!

We leave you a couple of drawings for you to try!!

Comments

TechKiwiGadgets (author)2017-12-26

nice work. Very cool idea

Thanks!!

MrMagmaman (author)2017-12-13

Very cool. I think i should make it when i get a arduino

Swansong (author)2017-12-11

That's a really fun way to modernize an Etch-A-Sketch! :)

OscarR157 (author)Swansong2017-12-11

Thank you, we think the same!

About This Instructable

795views

21favorites

License:

More by OscarR157:Arduino Telesketch With Led Matrix
Add instructable to: