Project tutorial
Arduino LIXIE Clock

Arduino LIXIE Clock © Apache-2.0

Hey guys! Here is a new tutorial to teach you how to make a digital clock based on the LIXIE display technology using an Arduino board.

  • 499 views
  • 0 comments
  • 7 respects

Components and supplies

Necessary tools and machines

Lasercutter
Laser cutter (generic)
98y0074 40
Rework Station Kit, SMD

Apps and online services

About this project

Hey guys! I Hope you already enjoyed my previous tutorial "Arduino MIDI Controller DIY" and you are ready for a new one, as usual I made this tutorial to guide you step by step while making this kind of super amazing low cost electronic projects which is the "Arduino LIXIE clock."

During the making of this project, we tried to make sure that this tutorial will be the best guide for you in order to help you if you want to make your own digital clock, so we hope that this write-up contains the needed documents.

This project is so handy to make specially after getting the customized PCB that we’ve ordered from JLCPCB to improve the appearance of our clock and also there is enough documents and codes in this guide to allow you create your Arduino clock easily. We've made this project in just 4 days only, just three days to get all the needed parts and finish the hardware making and the assemble, then we have prepared the code to suit our project and the android app development takes one day.

Before starting, let’s see first.

What You Will Learn:

  • Making the right hardware selection for your project depending on its functionalities.
  • Understand the LIXIE display technology.
  • Prepare the circuit diagram to connect all the choosen components.
  • Assemble all the project parts (mechanical and electronic assembly)..
  • start your own digital clock.

How the LIXIE Display Works

As always I make this short description where I collect some data from the internet about the project that we are about to create.

So starting with the basics, we need to define first the Lixie display method and how it works, the principle is as simple as this; once you cut a Plexiglas part and make some laser engraved logos or shapes you can light up these shapes by placing an LED near any side of the parts sides and in our case we will engrave the numbers from 0 to 9 in 10 parts and we will do the same thing four time for four digits, you can add also the two dots to distinguish the hours and the minutes after that we will make a design that could hold all these Plexiglas parts together and place two LEDs in the bottom side of each Plexiglas part so we have a total of 82 LEDs.

About the wiring of all these LEDs with the Arduino, we will solder the Anodes of same rows together to get 10 rows and the Cathodes of the same Columns together to get a matrix of 10 rows 4 columns about the dots it is easy to control them. After that it will be so easy to turn On Off the desired digit using the Arduino code, and if you want to get the basics of how to control LEDs of the same matrix you can refer to our tutorial where I explained how to control a Cube of LEDs using the matrix method.

CAD and Hardware Parts

Starting with the laser engraving and cutting parts, I made the above design using solidworks software and you can get the DXF files from the download link, this design is 100% recommended to help you making your device since it is the only holder of the plexiglass order, after preparing the design I have got my parts very well manufactured and ready for the action. and as you can see in the last photo we prepared the numbers engaraved four times for each digit.

Circuit Diagram

Moving to the electronics, I have created thiscircuit diagram that includes all the necessary parts required for this project.

I will use also a RTC module components to restore the time and date configuration once the device is turned off so you can use a RTC module or you can simply get the DS3231integrated circuit for RTC and in both case you will establish a I²C communicationwith the MCU for data transmission. I will use a buzzer for the alarms because we will add this feature in our clock so we can set some alrams and in order to interface with the clock I will use a Bluetooth module adjust the time and date using an android application.

PCB making

About JLCPCB

JLCPCB (Shenzhen JIALICHUANG Electronic Technology Development Co., Ltd.), is the largest PCB prototype enterprise in China and a high-tech manufacturer specializing in quick PCB prototype and small-batch PCB production. With over 10 years of experience in PCB manufacturing, JLCPCB has more than 200, 000 customers at home and abroad, with over 8, 000 online orders of PCB prototyping and small quantity PCB production per day. The annual production capacity is 200, 000 sq.m. for various of 1-layer, 2-layer or multi-layer PCBs. JLC is a professional PCB manufacturer featured of large scale, well equipment, strict management and superior quality.

Talking electronics

After making the circuit diagram I transformed it into a customized PCB design and all what I need now is to produce my PCB, for sure I moved to JLCPCBthe best PCB supplier in order to get the best PCB manufacturing service, after some simple clicks I have uploaded the appropriate GERBER files of my design and I set some parameters like the PCB thickness color and quantity, and this time we will try the golden spot option; then at least you need to pay just 2 Dollars to get the PCB after four days only, what I have noticed about JLCPCB this time is the "out of charge PCB color" it means you will pay only 2 USD for any PCB color you choose.

As you can see in the pictures above the PCB is very well manufactured and I’ve got the same PCB design that we’ve made for our main board and all the labels, logos and the beautiful golden spots are there to guide me during the soldering steps. You can also download the Gerber file for this circuit from the download link of the needed files.

Ingredients

Before start soldering the electronic parts let’s review the components list for our project so we will need:

★☆★ The necessary components ★☆★

The PCB that we have ordered from JLCPCB

ATmega328P which is the Uno MCU

MCP23017 IC

Two 22pF capacitors

330 Ohm resistors

The RTC module components

16 MHz quartz oscillator

A Bluetooth module

A buzzer

Some terminal connection

80 Blue LEDs

2 white LEDs

And the laser cute parts

Electronic Assembly

Now everything is ready so let’s start soldering our electronic components to the PCB and to do so we need a soldering iron and a solder core wire and a SMD rework station for SMD components (not needed if you use RTC module).

Safety first

Soldering Iron

Never touch the element of the soldering iron....400°C!

Hold wires to be heated with tweezers or clamps.

Always return the soldering iron to its stand when not in use.

Never put it down on the workbench.

Turn unit off and unplug when not in use.

About the RTC components you can solder them or you can buy an RTC module and use it through the appropriate connector on the board.

As you can see, using this PCB is so easy due to its very high quality making and without forgetting the labels that will guide you guys while soldering each component because you will find on the top silk layer a label of each component indicating its placement on the board and this way you will be 100% sure that you will not make any soldering mistakes.

I’ve soldered each component to its placement and you can use both sides of the PCB to solder your electronic components.

Plexiglass Assembly

Now we have the PCB ready and all the components soldered very well, we move to second part of the hardware assembly which is the LED connection.

As you can see in the photo above we created a hole for each LED in our design so just use some glue to place the LEDs and then solder all the Anodes of the same rows together and the cathodes of the same columns together, once you finish the task you will have 14 wires for the matrix so just screw them as it indicates the PCB.

We continue the assembly by placing the Plexiglas parts each one to its placement and we screw the connection points.

Software Part

All what we need now is the software, I have made this Arduino code for you guys and you can have it for free from the link down below, also I have created an android app to use it while setting up the time, date and the alarms of the clock. The code is very well commented so you can understand it and adjust it for your own needs, we need the Arduino Uno board to upload the code into our ATmega328 MCU then we take the MCU and we place it in its socket on the PCB.

We need an external 5v power adaptor to turn ON the device and here we are, the clock works very well and we can use this android app to adjust the time and to set some alarms.

This project is so easy to make and an amazing one specially with these shiny blue lights that could be your best DIY clock but still some other improvements to perform in order to make it much more butter, that’s why I will be waiting for your suggestions to improve this LIXIE clock.

Do not forget to thumb this project if you like it and to subscribe to my YouTube channel for more awesome videos and do not miss to watch our previous projects.

Code

LIXIE programArduino
/************************************************************************************************************************************************************************                                              
 * - Author               : BELKHIR Mohamed                        *                                               
 * - Profession           : (Electrical Ingineer) MEGA DAS owner   *                                                                                              
 * - Main purpose         : Industrial Application                 *                                                                                 
 * - Copyright (c) holder : All rights reserved                    *
 * - License              : BSD 2-Clause License                   * 
 * - Date                 : 08/15/2019                             *
 * ***********************************************************************************************************************************************************************/
 
 /*********************************** NOTE **************************************/
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:

// * Redistributions of source code must retain the above copyright notice, this
//  list of conditions and the following disclaimer.

// * Redistributions in binary form must reproduce the above copyright notice,
//  this list of conditions and the following disclaimer in the documentation
//  and/or other materials provided with the distribution.

// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED
/*                                MMMMMMMXlxMMWXOkOkkOOOKWMMMMMMMMMMMMMMWKOkkOkkkOXMN0OkOkkOk0NMMMMMMN0000OkkOKNMXOOOOOkOk0WMWKOOOOOkkOO0000000OOOOO0NMMMOc
                                  MMMMMMMXlxMMWK;      ,0WMMMMMMMMMMMMMMWk'      :XMNO,      :XMMMMMMN000c .,okKWMXc      .xWMNk'      cO0000000kc.  .kMMMOc
                                  MMMMMMMXldMMMN:      cWMMMMMMMMMMMMMMMMK,      dMMMWx.     'OMMMMMMMMMO :oNMMMMMMo      ;KMMM0'     .xMMMMMMMMMWd. .kMMMOc
                                  MMMMMMMXlxMMMN:      cNMMMMMMMMMMMMMMMMK,      dMMMMNl      :XMMMMMMMX dkWMMMMMMMo      ;KMMM0'     .dMMMMMMMMMMNc .kMMMOc
                                  MMMMMMMXlxMMMN:      cNMMMMMMMMMMMMMMMMK,      dMMMMMK,      oWMMMMMW kkWMMMMMMMMo      ,KMWM0'     .xMMMMMMMMMMMx..kMMMOc
                                  MMMMMMMXlxMMMN:      cNMMMMMMMMMMMMMMMMK,      dMMMMMMk.     .OMMMMM 0xXMMMMMMMMMo      ,KMMM0'     .xMMMMMMMMMMM0'.kMMMOc
                                  MMMMMMMXlxMMMN:      cNMMMMMMMMMMMMMMMMK,      dMMMMMMNl      ;XMMM XxOMMMMMMMMMMo      ,KMWM0'     .xMMMMMMMMMMMN:.kMMMOc
                                  MMMMMMMXlxMMMN:      cNMMMMMMMMMMMMMMMMK,      dMMMMMMMK;      oWM WkkNMMMMMMMMMMo      ,KMWM0'     .xMMMMMMMMMMMWd.xMMMOc
                                  MMMMMMMXlxMMMN:      cNMMMMMMMMMMMMMMMMK,      dMMMMMMMMk.     .k MKxKMMMMMMMMMMMo      ,KMWM0'     .xMMMMMMMMMMMMNOXMMMOc
                                  MMMMMMMXlxMMMN:      cNMMMMMMMMMMMMMMMMK,      dMMMMMMMMWl      ;0kOWMMMMMMMMMMMo      ,KMWM0'     .xMMMMMMMMMMMMMMMMMMOc
                                  MMMMMMMXlxMMMN:      cNMMMMMMMMMMMMMMMMK,      dMMMMMMMMMK;      ,xNMMMMMMMMMMMMo      ,KMWM0'     .xMMMMMMNXWMMMMMMMMMOc
                                  MMMMMMMXlxMMMN:      cNMMMMMMMMMMMMMMMMK,      dMMMMMMMMMMO.     .xMMMMMMMMMMMMMo      ,KMWM0'     .xMMMMMK::KMMMMMMMMMOc
                                  MMMMMMMXlxMMMN:      cNMMMMMMMMMMMMMMMMK,      dMMMMMMMMMMWo      ;XMMMMMMMMMMMMo      ,KMWM0'     .xMMMMXc ,KMMMMMMMMMOc
                                  MMMMMMMXlxMMMN:      cNMMMMMMMMMMMMMMMMK,      dMMMMMMMMMMMX;      oWMMMMMMMMMMMo      ,KMWM0'      ckkxo'  ,KMMMMMMMWMOc
                                  MMMMMMMXlxMMMN:      cNMMMMMMMMMMMMMMMMK,      dMMMMMMMMMMMM .     .kMMMMMMMMMMMo      ,KMWM0'      oKKKOo. ,KMMWWWWWWMOc
                                  MMMMMMMXlxMMMN:      cNMMMMMMMMMMMMMMMMK,      dMMMMMMMMMMM Wo      ;KMMMMMMMMMMo      ,KMWM0'     .xMWWWWx.,KMWWWWWWWMOc
                                  MMMMMMMXlxMMMN:      cNMMMMMMMMMMMMMMMMK,      dMMMMMMMMMM MMk.      oWMMMMMMMMMo      ,KMWM0'     .xMWWWWNkxXMWWWWWWWMOc
                                  MMMMMMMXlxMWMN:      :NMMMMMMMMMMMMMMMMK,      dMMMMMMMMM MMXxo.     .kMMMMMMMMMo      ,KMWM0'     .xMWWWWWWWWWWWWWWWWWOc
                                  MMMMMMMXlxMWMN:      :NMMMMMMMMMMMMMWWMK,      dMMMMMMMM MMWkkWo      ;KMMMMMMMMo      ,KMWM0'     .xMWWWWWWWWWWWWWWWWWOc
                                  MMMMMMMXlxMWMN:      :NMMMMMMMMMMMMXoxWK,      dMMMMMMM MMMOxXMX;      lNMMMMMMWo      ,KMWM0'     .xWWWWWWWWWWWWW0lOWWOc
                                  MMMMMMMXlxMWMN:      :NMWMMMMMMMMMMx.cWK,      dMMMMMM MMMXx0MMMO.     .kWMMMMMWo      ,KWWW0'     .dWWWWWWWWWWWWNc.kWWOc
                                  MMMMMMMXlxMWMN:      :NMWWWMWWWWMMWl cWK,      dMMMMM MMMWkkWMMMWo      ,KMMMMMWo      ,KWWW0'     .dWWWWWWWWWWWWK,.kWWO:
                                  MMMMMMMXlxMWMN:      :NMWWWWWWWWWMX; lWK,      dMMMM MMMM0xXMMMMMX:      lNMMMWWo      ,KWWW0'     .dWWWWWWWWWWWWO..kWWO:
                                  MMMMMMMXlxWWWN:      :NMWWWWWWWWWMO. lWK,      dMMM MWWMXxOMMMMMMMO.     .xWMMWWo      ,KWWW0'     .dWWWWWWWWWWWWo .kWWO:
                                  MMMMMMMXlxWWWN:      :NWWWWWWWWWWNc  lW0'      dMW MWWMWdlXWWMMMWWWd      ,KMWWWo      ,KWWW0'     .dWWWWWWWWWWW0, .kWWO:
                                  MMMMMMMXlxWWWN:      :NWWWWWWWWWXl.  cW0,      oW WWMWM0''OWWWWMWWMX:      cXWWWl      ,0WNWO'      dWWWWWWWWWNO;  .kWWO:
                                  MMMMMMMXlxWWW0l,,,,,,lOOOOOOOOOko;,,;xNOc,,,,,;lKWN0OOOd;;lkXWWWWWWNx;;;;,,:xXWKo;,,,,,:kNWNk:,,,,,;lkOOOOOOOOxc;,,c0WWO:*/

#if defined(ESP8266)
#include <pgmspace.h>
#else
#include <avr/pgmspace.h>
#endif
#include <Wire.h>                                    // must be incuded here so that Arduino library object file references work
#include <RtcDS3231.h>                               // Include the RTC library
#include <EEPROM.h>                                  // Include the EEPROM library needed for alarm handeling
#include "Adafruit_MCP23017.h"                       // Include the MCP library to interface the MCP iC

RtcDS3231 Rtc;                                       // Create the RTC instance
RtcDateTime dateTimeData;
Adafruit_MCP23017 MyMCP;                             // Create the MCP instance

char SerialData;                                     // Use this variable to read each caractere received through serial port
char SerialDataDecisison;
String dateData="";                                     // Store all serial caracters in this variable
String timeData="";                                     // Store all serial caracters in this variable
String alarmData="";                                     // Store all serial caracters in this variable
int monthNumber=13;
long int dotBlinkTime=millis();
int alarmHours=0;
int alarmMinutes=0;
int alarmSeconds=0;
int alarmActivate=0;
int alarmCounterControl=0;
int alarmCounter=0;
int displayDot=1;
long int buzzerTime=millis();
long int buzzerTimeControl=millis();
long int dispalDate=millis();

const int N0=1;                                   // The first line of plexiglass LEDs 0
const int N1=0;                                   // The second line of plexiglass LEDs 1
const int N2=15;                                  // The third line of plexiglass LEDs 2
const int N3=14;                                  // .
const int N4=13;                                  // .
const int N5=12;                                  // .
const int N6=11;                                  // .
const int N7=9;                                   // .
const int N8=10;                                  // .
const int N9=8;                                   // The last line of plexiglass LEDs 9
const int dig1=2;                                 // Control of the first digit
const int dig2=3;                                 // .
const int dig3=4;                                 // .
const int dig4=5;                                 // Control of the fourth digit
const int dot=6;                                  // Control of the two dots
const int buzzer=3;                               // Control of the buzzer

const int delaySeq=5000;

void setup() 
{
  Serial.begin(9600);
  Serial.setTimeout(100);
  Wire.setClock(3400000);
  pinMode(buzzer,OUTPUT);
  digitalWrite(buzzer,LOW);
  MyMCP.begin(1);
  //--------RTC SETUP ------------
  Rtc.Begin();
  for(int i=0;i<16;i++)
  {
    MyMCP.pinMode(i,OUTPUT);
    MyMCP.digitalWrite(i,LOW);
  }
  clearDisplay();

  if (!Rtc.IsDateTimeValid()) 
  {
        // Common Cuases:
        //    1) first time you ran and the device wasn't running yet
        //    2) the battery on the device is low or even missing

      Serial.println("RTC lost confidence in the DateTime!");

        // following line sets the RTC to the date & time this sketch was compiled
        // it will also reset the valid flag internally unless the Rtc device is
        // having an issue
  }
  if (!Rtc.GetIsRunning())
  {
      Serial.println("RTC was not actively running, starting now");
      Rtc.SetIsRunning(true);
  }
  Rtc.Enable32kHzPin(false);
  Rtc.SetSquareWavePin(DS3231SquareWavePin_ModeNone); 
  dateTimeData=Rtc.GetDateTime();
  if(EEPROM.read(0)==1)
  {
    alarmMinutes=EEPROM.read(1);
    alarmHours=EEPROM.read(2);
    alarmActivate=1;
  }
}

void loop() 
{
  while(Serial.available())                   // While serial data are available we store it 
  {
    delay(10);
    SerialDataDecisison=Serial.read();
    if(SerialDataDecisison=='d')
    {
      monthNumber=Serial.parseInt();
      switch (monthNumber)
      {
        case 1 : dateData+="Jan"; break;
        case 2 : dateData+="Feb"; break;
        case 3 : dateData+="Mar"; break;
        case 4 : dateData+="Apr"; break;
        case 5 : dateData+="May"; break;
        case 6 : dateData+="Jun"; break;
        case 7 : dateData+="Jul"; break;
        case 8 : dateData+="Aug"; break;
        case 9 : dateData+="Sep"; break;
        case 10 : dateData+="Oct"; break;
        case 11 : dateData+="Nov"; break;
        case 12 : dateData+="Dec"; break;
      }
      while(Serial.available())                   // While serial data are available we store it 
      {
        delay(10);
        SerialData=Serial.read();
        dateData+=SerialData;
      }
      const char* newDate=dateData.c_str();
      dateTimeData=Rtc.GetDateTime();
      String TimeFromRTC=(String(dateTimeData.Hour())+":"+String(dateTimeData.Minute())+":"+String(dateTimeData.Second()));
      const char* sameTime=TimeFromRTC.c_str();
      Serial.println(sameTime);
      RtcDateTime RtcConfig = RtcDateTime(newDate, sameTime);
      Rtc.SetDateTime(RtcConfig);
    }
    if(SerialDataDecisison=='t')
    {
      while(Serial.available())                   // While serial data are available we store it 
      {
        delay(10);
        SerialData=Serial.read();
        timeData+=SerialData;
      }
            
      const char* newTime=timeData.c_str();
      dateTimeData=Rtc.GetDateTime();
      String DateFromRTC=(String(dateTimeData.Month())+" "+String(dateTimeData.Day())+" "+String(dateTimeData.Year()));
      const char* sameDate=DateFromRTC.c_str();
      Serial.println(sameDate);
      RtcDateTime RtcConfig = RtcDateTime(sameDate, newTime);
      Rtc.SetDateTime(RtcConfig);
    }
    if(SerialDataDecisison=='a')
    {
      while(Serial.available())                   // While serial data are available we store it 
      {
        delay(10);
        SerialData=Serial.read();
        alarmData+=SerialData;
      }
      alarmHours=getValue(alarmData, ':', 0).toInt();
      alarmMinutes=getValue(alarmData, ':', 1).toInt();
      alarmSeconds=getValue(alarmData, ':', 2).toInt();
      EEPROM.write(0,1);
      EEPROM.write(1,alarmMinutes);
      EEPROM.write(2,alarmHours);
      alarmActivate=1;
      buzzerTime=millis();
    }
  }
  dateData="";
  timeData="";
  alarmData="";
  if(millis()-dotBlinkTime<1000&&displayDot==1)
  {
    MyMCP.digitalWrite(dot,HIGH);
  }
  if(millis()-dotBlinkTime>1000&&displayDot==1)
  {
    MyMCP.digitalWrite(dot,LOW);
    if(millis()-dotBlinkTime>2000&&displayDot==1)
    {
      dotBlinkTime=millis();
    }
  }
  RtcDateTime now = Rtc.GetDateTime();
  if(millis()-dispalDate<10000)
    {
      displayMode(now.Minute(),"right");
      displayMode(now.Hour(),"left");
      displayDot=1;
    }
    if(millis()-dispalDate>10000)
    {
      displayDot=0;
      MyMCP.digitalWrite(dot,LOW);
      displayMode(now.Day(),"right");
      displayMode(now.Month(),"left");
      if(millis()-dispalDate>15000)
      {
        dispalDate=millis();
        displayDot=1;
      }
    }
  if(alarmActivate==1&&now.Hour()==alarmHours&&now.Minute()==alarmMinutes)
  {
    if(alarmCounterControl<8)
    {
      alarmControl();
    }
    else
    {
      alarmCounterControl=0;
      alarmActivate=0;
      EEPROM.write(0,0);
    }
  }
}
void alarmControl()
{
  if(millis()-buzzerTime<65)
    {
      digitalWrite(buzzer,HIGH);
    }
    if(millis()-buzzerTime>65)
    {
      digitalWrite(buzzer,LOW);
      if(millis()-buzzerTime>130&&alarmCounter<4)
      {
        buzzerTime=millis();
        alarmCounter+=1;
      }
      if(millis()-buzzerTime>1000)
      {
        alarmCounter=0;
        alarmCounterControl+=1;
      }
    } 
 }
void clearDisplay()
{
  MyMCP.digitalWrite(dig1,HIGH);
  MyMCP.digitalWrite(dig2,HIGH);
  MyMCP.digitalWrite(dig3,HIGH);
  MyMCP.digitalWrite(dig4,HIGH);
  delay(0);
}
void displayMode(int value, String side)
{
  if(side=="right")
  {
    switch (value%10)
    {
      case 0 : 
      {
        MyMCP.digitalWrite(dig1,LOW);
        MyMCP.digitalWrite(dig2,HIGH);
        MyMCP.digitalWrite(dig3,HIGH);
        MyMCP.digitalWrite(dig4,HIGH);
        MyMCP.digitalWrite(N0,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N0,LOW);
      }break;
      case 1 : 
      {
        MyMCP.digitalWrite(dig1,LOW);
        MyMCP.digitalWrite(dig2,HIGH);
        MyMCP.digitalWrite(dig3,HIGH);
        MyMCP.digitalWrite(dig4,HIGH);
        MyMCP.digitalWrite(N1,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N1,LOW);
      }break;
      case 2 : 
      {
        MyMCP.digitalWrite(dig1,LOW);
        MyMCP.digitalWrite(dig2,HIGH);
        MyMCP.digitalWrite(dig3,HIGH);
        MyMCP.digitalWrite(dig4,HIGH);
        MyMCP.digitalWrite(N2,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N2,LOW);
      }break;
      case 3 : 
      {
        MyMCP.digitalWrite(dig1,LOW);
        MyMCP.digitalWrite(dig2,HIGH);
        MyMCP.digitalWrite(dig3,HIGH);
        MyMCP.digitalWrite(dig4,HIGH);
        MyMCP.digitalWrite(N3,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N3,LOW);
      }break;
      case 4 : 
      {
        MyMCP.digitalWrite(dig1,LOW);
        MyMCP.digitalWrite(dig2,HIGH);
        MyMCP.digitalWrite(dig3,HIGH);
        MyMCP.digitalWrite(dig4,HIGH);
        MyMCP.digitalWrite(N4,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N4,LOW);
      }break;
      case 5 : 
      {
        MyMCP.digitalWrite(dig1,LOW);
        MyMCP.digitalWrite(dig2,HIGH);
        MyMCP.digitalWrite(dig3,HIGH);
        MyMCP.digitalWrite(dig4,HIGH);
        MyMCP.digitalWrite(N5,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N5,LOW);
      }break;
      case 6 : 
      {
        MyMCP.digitalWrite(dig1,LOW);
        MyMCP.digitalWrite(dig2,HIGH);
        MyMCP.digitalWrite(dig3,HIGH);
        MyMCP.digitalWrite(dig4,HIGH);
        MyMCP.digitalWrite(N6,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N6,LOW);
      }break;
      case 7 : 
      {
        MyMCP.digitalWrite(dig1,LOW);
        MyMCP.digitalWrite(dig2,HIGH);
        MyMCP.digitalWrite(dig3,HIGH);
        MyMCP.digitalWrite(dig4,HIGH);
        MyMCP.digitalWrite(N7,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N7,LOW);
      }break;
      case 8 : 
      {
        MyMCP.digitalWrite(dig1,LOW);
        MyMCP.digitalWrite(dig2,HIGH);
        MyMCP.digitalWrite(dig3,HIGH);
        MyMCP.digitalWrite(dig4,HIGH);
        MyMCP.digitalWrite(N8,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N8,LOW);
      }break;
      case 9 : 
      {
        MyMCP.digitalWrite(dig1,LOW);
        MyMCP.digitalWrite(dig2,HIGH);
        MyMCP.digitalWrite(dig3,HIGH);
        MyMCP.digitalWrite(dig4,HIGH);
        MyMCP.digitalWrite(N9,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N9,LOW);
      }break;
    }
    switch (value/10)
    {
      case 0 : 
      {
        MyMCP.digitalWrite(dig1,HIGH);
        MyMCP.digitalWrite(dig2,LOW);
        MyMCP.digitalWrite(dig3,HIGH);
        MyMCP.digitalWrite(dig4,HIGH);
        MyMCP.digitalWrite(N0,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N0,LOW);
      }break;
      case 1 : 
      {
        MyMCP.digitalWrite(dig1,HIGH);
        MyMCP.digitalWrite(dig2,LOW);
        MyMCP.digitalWrite(dig3,HIGH);
        MyMCP.digitalWrite(dig4,HIGH);
        MyMCP.digitalWrite(N1,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N1,LOW);
      }break;
      case 2 : 
      {
        MyMCP.digitalWrite(dig1,HIGH);
        MyMCP.digitalWrite(dig2,LOW);
        MyMCP.digitalWrite(dig3,HIGH);
        MyMCP.digitalWrite(dig4,HIGH);
        MyMCP.digitalWrite(N2,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N2,LOW);
      }break;
      case 3 : 
      {
        MyMCP.digitalWrite(dig1,HIGH);
        MyMCP.digitalWrite(dig2,LOW);
        MyMCP.digitalWrite(dig3,HIGH);
        MyMCP.digitalWrite(dig4,HIGH);
        MyMCP.digitalWrite(N3,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N3,LOW);
      }break;
      case 4 : 
      {
        MyMCP.digitalWrite(dig1,HIGH);
        MyMCP.digitalWrite(dig2,LOW);
        MyMCP.digitalWrite(dig3,HIGH);
        MyMCP.digitalWrite(dig4,HIGH);
        MyMCP.digitalWrite(N4,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N4,LOW);
      }break;
      case 5 : 
      {
        MyMCP.digitalWrite(dig1,HIGH);
        MyMCP.digitalWrite(dig2,LOW);
        MyMCP.digitalWrite(dig3,HIGH);
        MyMCP.digitalWrite(dig4,HIGH);
        MyMCP.digitalWrite(N5,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N5,LOW);
      }break;
      case 6 : 
      {
        MyMCP.digitalWrite(dig1,HIGH);
        MyMCP.digitalWrite(dig2,LOW);
        MyMCP.digitalWrite(dig3,HIGH);
        MyMCP.digitalWrite(dig4,HIGH);
        MyMCP.digitalWrite(N6,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N6,LOW);
      }break;
      case 7 : 
      {
        MyMCP.digitalWrite(dig1,HIGH);
        MyMCP.digitalWrite(dig2,LOW);
        MyMCP.digitalWrite(dig3,HIGH);
        MyMCP.digitalWrite(dig4,HIGH);
        MyMCP.digitalWrite(N7,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N7,LOW);
      }break;
      case 8 : 
      {
        MyMCP.digitalWrite(dig1,HIGH);
        MyMCP.digitalWrite(dig2,LOW);
        MyMCP.digitalWrite(dig3,HIGH);
        MyMCP.digitalWrite(dig4,HIGH);
        MyMCP.digitalWrite(N8,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N8,LOW);
      }break;
      case 9 : 
      {
        MyMCP.digitalWrite(dig1,HIGH);
        MyMCP.digitalWrite(dig2,LOW);
        MyMCP.digitalWrite(dig3,HIGH);
        MyMCP.digitalWrite(dig4,HIGH);
        MyMCP.digitalWrite(N9,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N9,LOW);
      }break;
    }
  }
  if(side=="left")
  {
    switch (value%10)
    {
      case 0 : 
      {
        MyMCP.digitalWrite(dig1,HIGH);
        MyMCP.digitalWrite(dig2,HIGH);
        MyMCP.digitalWrite(dig3,LOW);
        MyMCP.digitalWrite(dig4,HIGH);
        MyMCP.digitalWrite(N0,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N0,LOW);
      }break;
      case 1 : 
      {
        MyMCP.digitalWrite(dig1,HIGH);
        MyMCP.digitalWrite(dig2,HIGH);
        MyMCP.digitalWrite(dig3,LOW);
        MyMCP.digitalWrite(dig4,HIGH);
        MyMCP.digitalWrite(N1,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N1,LOW);
      }break;
      case 2 : 
      {
        MyMCP.digitalWrite(dig1,HIGH);
        MyMCP.digitalWrite(dig2,HIGH);
        MyMCP.digitalWrite(dig3,LOW);
        MyMCP.digitalWrite(dig4,HIGH);
        MyMCP.digitalWrite(N2,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N2,LOW);
      }break;
      case 3 : 
      {
        MyMCP.digitalWrite(dig1,HIGH);
        MyMCP.digitalWrite(dig2,HIGH);
        MyMCP.digitalWrite(dig3,LOW);
        MyMCP.digitalWrite(dig4,HIGH);
        MyMCP.digitalWrite(N3,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N3,LOW);
      }break;
      case 4 : 
      {
        MyMCP.digitalWrite(dig1,HIGH);
        MyMCP.digitalWrite(dig2,HIGH);
        MyMCP.digitalWrite(dig3,LOW);
        MyMCP.digitalWrite(dig4,HIGH);
        MyMCP.digitalWrite(N4,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N4,LOW);
      }break;
      case 5 : 
      {
        MyMCP.digitalWrite(dig1,HIGH);
        MyMCP.digitalWrite(dig2,HIGH);
        MyMCP.digitalWrite(dig3,LOW);
        MyMCP.digitalWrite(dig4,HIGH);
        MyMCP.digitalWrite(N5,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N5,LOW);
      }break;
      case 6 : 
      {
        MyMCP.digitalWrite(dig1,HIGH);
        MyMCP.digitalWrite(dig2,HIGH);
        MyMCP.digitalWrite(dig3,LOW);
        MyMCP.digitalWrite(dig4,HIGH);
        MyMCP.digitalWrite(N6,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N6,LOW);
      }break;
      case 7 : 
      {
        MyMCP.digitalWrite(dig1,HIGH);
        MyMCP.digitalWrite(dig2,HIGH);
        MyMCP.digitalWrite(dig3,LOW);
        MyMCP.digitalWrite(dig4,HIGH);
        MyMCP.digitalWrite(N7,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N7,LOW);
      }break;
      case 8 : 
      {
        MyMCP.digitalWrite(dig1,HIGH);
        MyMCP.digitalWrite(dig2,HIGH);
        MyMCP.digitalWrite(dig3,LOW);
        MyMCP.digitalWrite(dig4,HIGH);
        MyMCP.digitalWrite(N8,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N8,LOW);
      }break;
      case 9 : 
      {
        MyMCP.digitalWrite(dig1,HIGH);
        MyMCP.digitalWrite(dig2,HIGH);
        MyMCP.digitalWrite(dig3,LOW);
        MyMCP.digitalWrite(dig4,HIGH);
        MyMCP.digitalWrite(N9,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N9,LOW);
      }break;
    }
    switch (value/10)
    {
      case 0 : 
      {
        MyMCP.digitalWrite(dig1,HIGH);
        MyMCP.digitalWrite(dig2,HIGH);
        MyMCP.digitalWrite(dig3,HIGH);
        MyMCP.digitalWrite(dig4,LOW);
        MyMCP.digitalWrite(N0,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N0,LOW);
      }break;
      case 1 : 
      {
        MyMCP.digitalWrite(dig1,HIGH);
        MyMCP.digitalWrite(dig2,HIGH);
        MyMCP.digitalWrite(dig3,HIGH);
        MyMCP.digitalWrite(dig4,LOW);
        MyMCP.digitalWrite(N1,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N1,LOW);
      }break;
      case 2 : 
      {
        MyMCP.digitalWrite(dig1,HIGH);
        MyMCP.digitalWrite(dig2,HIGH);
        MyMCP.digitalWrite(dig3,HIGH);
        MyMCP.digitalWrite(dig4,LOW);
        MyMCP.digitalWrite(N2,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N2,LOW);
      }break;
      case 3 : 
      {
        MyMCP.digitalWrite(dig1,HIGH);
        MyMCP.digitalWrite(dig2,HIGH);
        MyMCP.digitalWrite(dig3,HIGH);
        MyMCP.digitalWrite(dig4,LOW);
        MyMCP.digitalWrite(N3,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N3,LOW);
      }break;
      case 4 : 
      {
        MyMCP.digitalWrite(dig1,HIGH);
        MyMCP.digitalWrite(dig2,HIGH);
        MyMCP.digitalWrite(dig3,HIGH);
        MyMCP.digitalWrite(dig4,LOW);
        MyMCP.digitalWrite(N4,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N4,LOW);
      }break;
      case 5 : 
      {
        MyMCP.digitalWrite(dig1,HIGH);
        MyMCP.digitalWrite(dig2,HIGH);
        MyMCP.digitalWrite(dig3,HIGH);
        MyMCP.digitalWrite(dig4,LOW);
        MyMCP.digitalWrite(N5,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N5,LOW);
      }break;
      case 6 : 
      {
        MyMCP.digitalWrite(dig1,HIGH);
        MyMCP.digitalWrite(dig2,HIGH);
        MyMCP.digitalWrite(dig3,HIGH);
        MyMCP.digitalWrite(dig4,LOW);
        MyMCP.digitalWrite(N6,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N6,LOW);
      }break;
      case 7 : 
      {
        MyMCP.digitalWrite(dig1,HIGH);
        MyMCP.digitalWrite(dig2,HIGH);
        MyMCP.digitalWrite(dig3,HIGH);
        MyMCP.digitalWrite(dig4,LOW);
        MyMCP.digitalWrite(N7,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N7,LOW);
      }break;
      case 8 : 
      {
        MyMCP.digitalWrite(dig1,HIGH);
        MyMCP.digitalWrite(dig2,HIGH);
        MyMCP.digitalWrite(dig3,HIGH);
        MyMCP.digitalWrite(dig4,LOW);
        MyMCP.digitalWrite(N8,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(N8,LOW);
      }break;
      case 9 : 
      {
        MyMCP.digitalWrite(dig1,HIGH);
        MyMCP.digitalWrite(dig2,HIGH);
        MyMCP.digitalWrite(dig3,HIGH);
        MyMCP.digitalWrite(dig4,LOW);
        MyMCP.digitalWrite(N9,HIGH);
        delayMicroseconds(delaySeq);
        MyMCP.digitalWrite(dig4,LOW);
        MyMCP.digitalWrite(N9,LOW);
      }break;
    }
  }
}
String getValue(String data, char separator, int index)
{
    int found = 0;
    int strIndex[] = { 0, -1 };
    int maxIndex = data.length() - 1;

    for (int i = 0; i <= maxIndex && found <= index; i++) 
    {
        if (data.charAt(i) == separator || i == maxIndex) 
        {
            found++;
            strIndex[0] = strIndex[1] + 1;
            strIndex[1] = (i == maxIndex) ? i+1 : i;
        }
    }
    return found > index ? data.substring(strIndex[0], strIndex[1]) : "";
}

Custom parts and enclosures

LIXIE CAD parts
uploads2ftmp2f878d87fa-c7c3-4127-aee2-d51c39abd92c2fdxffileslixie_MWcNxgGWuN.rar

Schematics

LIXIE circuit diagram

Comments

Similar projects you might like

Tri-Mode Digital Clock with ATtiny85 and RTC

Project tutorial by LAGSILVA

  • 7,189 views
  • 2 comments
  • 23 respects

Talking Clock 2 - New Version (Bilingual: EN-PT)

Project tutorial by LAGSILVA

  • 10,466 views
  • 28 comments
  • 42 respects

Complete Digital Clock Including Alarm and Motion Sensor

Project tutorial by LAGSILVA

  • 18,019 views
  • 20 comments
  • 66 respects

MultiFunctional Clock

Project in progress by 3 developers

  • 16,661 views
  • 2 comments
  • 28 respects

Arduino Without External Clock Crystal on ATmega328

Project tutorial by Techmirtz

  • 16,485 views
  • 2 comments
  • 17 respects

Digital Clock with Mirrored Display Driven by Accelerometers

Project tutorial by LAGSILVA

  • 15,765 views
  • 1 comment
  • 40 respects
Add projectSign up / Login