Related Posts Plugin for WordPress, Blogger...


July 25, 2013

LED Navigation Light with ATtiny45/85

Since a friend introduce me to arduino, i has been my dream to build myself a navigation lights customize to my liking.
He who played with arduino longer than me have come out with an on board navigation lights complete with strobe lights, beacon and even capabilities to switch your lights on and off using your remote control.
I think i am far from that, but i have build myself a simple navigation lights with strobe and beacon and i'm using ATtiny45 for its small size.

Using Arduino UNO R3 for prototyping and ATtiny45 for final product. I use my own ATtiny programming shield to programmed the chip using Arduino UNO.

Base sketch:

  • Fading Sketch
  • Blink Sketch

My NavLite Sketch V0.5

 NavLite V0.5
 Simple Navigation Light
 by kaysee 2013

 Single strobe
 Double strobe
 Fade in Fade out

int ledPin0 = 10; // fade in and out
int ledPin1 = 11; // double strobe
int ledPin2 = 3;  // single strobe
int ledPin3 = 9;  // blinking
int ledState = LOW; // blinking led state

void setup()  {
  pinMode(ledPin3,OUTPUT); // blinking led pin set as output
} //end setup()

void loop()  {  

  // blink led
  digitalWrite(ledPin3, !digitalRead(ledPin3)); 

  // fade in
  for(int fadeValue = 0 ; fadeValue = 255; fadeValue +=5) {
    analogWrite(ledPin0, fadeValue);

  // single strobe
  for(int fadeValue = 255 ; fadeValue = 0; fadeValue -=50) {
    analogWrite(ledPin2, fadeValue);
  analogWrite(ledPin2, 0); // reset led2 

  // double strobe
  int i=0;
  while(i < 2) {

   for(int fadeValue = 255 ; fadeValue = 0; fadeValue -=50) {
      analogWrite(ledPin1, fadeValue);
    analogWrite(ledPin1,0); // reset led1

  // blink led
  digitalWrite(ledPin3, !digitalRead(ledPin3)); 

  // fade out
  for(int fadeValue = 255 ; fadeValue = 0; fadeValue -=5) {
    analogWrite(ledPin0, fadeValue);
  analogWrite(ledPin0,0); // reset led0

}//end loop()
Infos on programming the ATtiny with Arduino UNO as an ISP :

DIY 5v regulator (

DIY circuit using protoboard

While experimenting for my next navigation lights project which include the capability to switch any of the lights on and off, i found out i can get a way just by using a digitalWrite to make the beacon effect.