Skip to main content

This may be the latest post

Getting Started With ATTINY88 DEV BOARD

  Hay Everyone, I this blog I'm going to show how you can use ATTINY88 Arduino nano compatible development board with Arduino ide on Ubuntu operating system. YT VIDEO LINK : https://youtu.be/te3z6Wy6Adk First of all you have to add the Arduino core for attiny88 to your board's List. To do that copy the below link and paste it to your Arduino IDE location: File/Preference/Additional boards. Link : https://raw.githubusercontent.com/MHEtLive/arduino-boards-index/master/package_mhetlive_index.json After pasting click on OK to close the window and then Ok to close the Preference window, you will see a little notification will appear on the bottom right corner on your IDE which is detecting location you added. Go to your boards manager (Click on Tools/Boards/Boards Manager) and start typing in the search line like "MH-ET LIVE BOARDS" As shown in the image, install it and then open simplke LED blink code by clicking on the Files/Examples/Basic/Blink. Then go to Tools/Boa...

Programmable LED Clock With Arduino

Programmable LED Clock With Arduino


Hello everyone,

This blogpost includes all the process of how I build a DIY Arduino based 3D LIGHT Clock.As we arduino is a very popular and powerful Microcontroller Which is very useful in school,college projects.And this Colour full ArduClock can impress anyone cause it has 3D effects also...you can change LED colour combinations as you need.

Materials : To make the Arduclock I used scratch parts such as 12xLEDs,resistors(if required..NOTE Im using a single cell 3.7 volt lipo of 100 mah so i dont need to attach any rsistor) ,Plastic piece(15 cm long 2 cm width) ,some wires ,Lipo battery 1S 3.7 volt,1x dc motor,1x N-S small magnet,1x hall effect/magnetic sensor and the most important thing is the microcontroller..im using arduino 1x UNO SMD version.Circuit Diagram and Code is attached in Step-10.


Tools that I used - Soldering iron,soldering wire,,Soldering flux,wire stripper and cutter,screwdriver,small drill and glue.So...take all the parts in your side and lets begin....

Step 1 - Making the Body

1st thake a hard plastic strip(depending upon your parts size--Im taking 15 cm) and draw some line depending upon your LED terminal size(in my case 5mm) And drill some holes so thst the led +,- terminals can go to the other side through the holes. I drilled 24 holes cause I have 12 LEDs.

Insert all LEDs forming any colorcombintion you want in my case G,R,R,R,R,R,R,Y,Y,Y,Y,B (G - Green,R-Red,Y-Yellow,B-Blue). Connect all Negative Lines of LEDs togather so we will get a common negative line.



Step 2: Connection With Arduino

I just attache the arduino uno board to the plastic strip with two screws.Then Connected the G LED + pin to 5v .Other LED R,R,R,R,R,R,Y,Y,Y,Y,B positive pins to the arduino digital pins 12,11,10,9,8,7,6,5,4,3,2.


Step 3: Connecting Hall Effect/magnetic Sensor

I used a 4pin hall effect sensor collected from old CPU cooling fan circuit.

1st pin is connected to 5V,Middle two pins are two output pins we need one which is connected to the Arduino analog pin 0,Attach a 10K ohm resistor to the hall effect sensor pisitive and output pin. 4th pin of the sensor is connected to the Gnd pin to the Arduino.

Step 4: Attaching Battery

Battery is attached with the arduino using tape. Battey + connected to arduino 5V with a Switch and Battery - to Gnd.

Circuit Diagram



Step 5: Motor Joint for Rotation

Im using a 12volt 555 motor to rotate the entier thing. On the back side of the Plastic strip i attached a motor shaft joint below the arduino board middle position.Make sure to attach the motor shaft in right position...Weight in both side of the plastic strip should same or it will vibrate.In my case I also has some vibrations so to remove that i used a extra load on the other side as shown in 2nd image of step 6.


Step 8: Important Instructions

If motor rotates in wrong direction that will effect your clock light effect and LED blinking speed.


Step 9: Final Step

Now turn on the Arduino and connect the motro with power suply And check it.


ARDUINO CODE

// ELECOBOT

// 05/05/2024 ARDUCLOCK MARK-1

unsigned int i,n,k,d,y;

unsigned long previousTime = 0;

byte hours = 12;    // Begin/Start Time

byte seconds = 00;

int val;

void setup()

{DDRD = 0xFE;

  DDRB = 0xFF;

  DDRC = 0xFE;

  PORTC = 0x01;  

  PORTD = 0x03;

  PORTB = 0x00;

  if(hours == 12)

  hours = 0;

}

void loop()

{ while(bit_is_clear(PINC, 0))

  if (millis() >= (previousTime))

  {  previousTime = previousTime + 1000;

     seconds = seconds +1;

     if (seconds == 60)

     {seconds = 0;

        minutes = minutes +1;

    }

     if (minutes == 60)

     {minutes = 0;

        hours = hours +1;

     }

     if (hours == 12)

     { hours = 0;

     } }  

  k=30;

  n=0;

  while(n < 60)

  {PORTC |= (1<<5);

  if ((k==0) || (k==5) || (k==10) || (k==15) || (k==20) || (k==25) || (k==30) || (k==35) || (k==40) || (k==45) || (k==50) || (k==55))

  { PORTC |= (1<<4);

  PORTC |= (1<<3);  

  }

  if ((k==0) || (k==15) || (k==30) || (k==45))

  {PORTC |= (1<<2);

  PORTC |= (1<<1);    

  }

  if((k == hours*5) || (( k == 0 ) && (hours == 0)))

  {PORTD |= (1<<2);

  PORTD |= (1<<3);

  PORTD |= (1<<4);

  PORTD |= (1<<5);

  PORTD |= (1<<6);

  PORTD |= (1<<7);

  PORTB |= (1<<0);

  }

  if(k == minutes)

  {PORTD |= (1<<2);

  PORTD |= (1<<3);

  PORTD |= (1<<4);

  PORTD |= (1<<5);

  PORTD |= (1<<6);

  PORTD |= (1<<7);

  PORTB |= (1<<0);

  PORTB |= (1<<1);

  PORTB |= (1<<2);    

  }

  if(k == seconds)

{ PORTD |= (1<<2);

  PORTD |= (1<<3);

  PORTD |= (1<<4);

  PORTD |= (1<<5);

  PORTD |= (1<<6);

  PORTD |= (1<<7);

  PORTB |= (1<<0);

  PORTB |= (1<<1);

  PORTB |= (1<<2);

  PORTB |= (1<<3);

  PORTB |= (1<<4);

}

  delayMicroseconds(140);

  PORTD = 0x03;

  PORTB = 0x00;

  PORTC = 0x01;

  PORTD |= (1<<2);

  delayMicroseconds(30);

  PORTD &= ~(1<<2);    

  delayMicroseconds(600);

  n++;

  k++;

  if(k == 60)

  k=0;

  }

  while(bit_is_set(PINC, 0))

}

Comments