Need help with LED navigation lights

Thread Starter

nickstones

Joined Jan 3, 2009
19
Hi,
can someone please help me with a working design for aircraft collision avoidance/ Navigation lights? I am aiming for a flash flash pause plash pause or flash flash pause flash flash pattern. can this be done with a 4017? i'd be very grateful if someone can give me a circuit based on the 4017 as well as one using any PIC
i plan to run this off a 12 - 15 V battery and use upto 10 LEDs.
 

beenthere

Joined Apr 20, 2004
15,819
What is the ultimate application? Any equipment actually installed on an aircraft will have to meet FAA standards. It's an area where you can't save a buck by rolling your own.
 

Thread Starter

nickstones

Joined Jan 3, 2009
19
@ beenthere: I intend to use this on model aircrafts

@Bill_Marsden: I would rate myself as an advanced beginner. I have assembled circuits in the past and have made my own (rather crude) circuit boards. Thank you for pointing me in the right direction, been hunting around for almost 3 days now!

What i really need is, the circuit should closely imitate the flash pattern of aircraft nav lights
 
Last edited:

t06afre

Joined May 11, 2009
5,934
Have you looked into microcontrollers. A small 8 pin microcontroller can do a lot of cool things. Very few external components will be needed in the final design.
 

Thread Starter

nickstones

Joined Jan 3, 2009
19
Trust whether the circuit will actually work. Found a few circuits (google) Hex files were missing! I never have worked with PICs and am kinda dumb with programming! :)
I'd love to try a PIC based circuit all the same :)
 

spinnaker

Joined Oct 29, 2009
7,830
Trust whether the circuit will actually work. Found a few circuits (google) Hex files were missing! I never have worked with PICs and am kinda dumb with programming! :)
I'd love to try a PIC based circuit all the same :)

The chip will do what it is told the working part is all up to you. :)


Check programming them in BASIC. It is actually pretty easy. C is not too bad either. And it is a lot of fun.

If I get some time this week I can write a sample program to do this. It would be fairly easy.

You just want one LED to flash? How long do you want the flashes? Are they all equal length? How long for the pauses? All equal length?

The only problem I see is cost. You will need to pick up a programmer for around $40 or so. A cheap investment if you are going to use it.
 

thyristor

Joined Dec 27, 2009
94
PICs make this kind of circuit an absolute doddle - really trivial PIC-wise. However, one does need to learn to program them first and that's not so trivial.

So, if you decide to learn PIC-speak and discover a whole new fascinating world of circuits that will do virtually anything you want with minimal component count, use a PIC.

If not, use 555's etc and loads of external components to try to reach your goal.

The answer is just a decision away.
 

Thread Starter

nickstones

Joined Jan 3, 2009
19
@spinnaker: I am comfortable with C programming, studied it a long time ago when dinosaurs used to roam free! I am aiming for 2 quick flashes of 30 to 50 ms each followed by a one sec pause and one flash of 30 to 50 ms and a one sec pause and repeat. Cost is not a major concern, as PICs, or for that matter any component is cheaper in this part of the world. To give you an insight, a PIC 12F675 costs about 65 cents (US)! and that is the highest price I got! There are places where the chip is available at 40 cents a pop! programmers are also cheap, this part of the world!

@ Thyristor: I love the PIC solution as that'd allow me to mess around with something i have absolutely no idea of! I love doing that! if not for that quality, a high school dropout like me would never have gotten atleast this far in the world of electronics! hey! i got into aeromodelling in a country where kits are almost non-existent! The kits that are available are for prop driven crap like the piper or the cessna!


@ everyone who's responded: I thank all of you from the bottom of my heart for all your support and encouragement.
 

Thread Starter

nickstones

Joined Jan 3, 2009
19
@ Spinnaker: I intend to use a pair of LEDs on each wingtip, a pair on the underside of the fuselage - midships and a pair on the Tail.
Part count (as in gross weight) is a critical factor and i guess PIC would be the best solution. Thank you for what you said - that you'll write the program for me. I'd really appreciate help in this matter but i don't want to take up too much of your time. thank you once again.
 

spinnaker

Joined Oct 29, 2009
7,830
@ Spinnaker: I intend to use a pair of LEDs on each wingtip, a pair on the underside of the fuselage - midships and a pair on the Tail.
Part count (as in gross weight) is a critical factor and i guess PIC would be the best solution. Thank you for what you said - that you'll write the program for me. I'd really appreciate help in this matter but i don't want to take up too much of your time. thank you once again.

I'll try to get you some sample code this week. I might have a fire to put out with some software that I sell. After that I should be able to work up a sample pretty quick.
 

spinnaker

Joined Oct 29, 2009
7,830
@ Spinnaker: I intend to use a pair of LEDs on each wingtip, a pair on the underside of the fuselage - midships and a pair on the Tail.
Part count (as in gross weight) is a critical factor and i guess PIC would be the best solution. Thank you for what you said - that you'll write the program for me. I'd really appreciate help in this matter but i don't want to take up too much of your time. thank you once again.

Either you numbers are not exactly right or my delay routine is not working exactly right but the numbers you posted did not look right when I coded it up so I modified them a bit. So I played with the delays and got something that looks like what I have seen on planes.

I used two ports but you can actually just use one and put your LEDs in parallel (remember your current limit resistor). That is if all the LEDs will flash at the same rate. So you could probably get by with a pretty low count pic.




Rich (BB code):
#include <p18f46k20.h>



/* Progam:         WingLights
   Author:        Spinnaker
   Compiler:    MPLAB C18

   Description:    Blinks two LEDs in the pattern specified. LEDs will be axfixed to the wingtips of
                a model airplane.


*/


/** C O N F I G U R A T I O N   B I T S for 18f46k20 ******************************/

#pragma config FOSC     = INTIO67             //Internal oscillator block, port function on RA6 and RA7 
#pragma config FCMEN     = OFF                //Fail-Safe Clock Monitor disabled 
#pragma config IESO     = OFF                //Oscillator Switchover mode disabled                   
#pragma config PWRT     = OFF                //Power Timer disabled
#pragma config BOREN     = SBORDIS            //Brown-out Reset enabled in hardware only     
#pragma config BORV     = 30                   //Brown-out Voltage
#pragma config WDTEN     = OFF                //WDT is controlled by SWDTEN bit of the WDTCON register 
#pragma config WDTPS     = 32768             //Watchdog Timer Postscale Select bits 1:32768                        
#pragma config MCLRE     = OFF                //RE3 input pin enabled; MCLR disabled 
#pragma config LPT1OSC     = OFF                //Low-Power Timer1 Oscillator  disabled. Operates in standard power mode
#pragma config PBADEN     = ON                //PORTB<4:0> pins are configured as analog input channels on Reset 
#pragma config CCP2MX     = PORTC                //CCP2 input/output is multiplexed with RC1 
#pragma config STVREN     = ON                //Stack full/underflow will cause Reset
#pragma config LVP         = OFF                //Single-Supply ICSP disabled 
#pragma config XINST     = OFF               //Instruction set extension and Indexed Addressing mode disabled (Legacy mode) 
#pragma config CP0         = OFF                //Block 0 (000800-001FFFh) not code-protected 
#pragma config CP1         = OFF                //Block 1 (002000-003FFFh) not code-protected 
#pragma config CP2         = OFF                //Block 2 (004000-005FFFh) not code-protected 
#pragma config CP3         = OFF               //Block 3 (006000-007FFFh) not code-protected 
#pragma config CPB         = OFF                //Boot block (000000-0007FFh) not code-protected 
#pragma config CPD         = OFF                //Data EEPROM not code-protected                   
#pragma config WRT0     = OFF                //Block 0 not write-protected 
#pragma config WRT1     = OFF                //Block 1 not write-protected 
#pragma config WRT2     = OFF                //Block 2 not write-protected 
#pragma config WRT3     = OFF                //Block 3 not write-protected 
#pragma config WRTB     = OFF                //Boot block not write-protected 
#pragma config WRTC     = OFF                //Configuration registers not write-protected 
#pragma config WRTD     = OFF                 //Data EEPROM not write-protected 
#pragma config EBTR0     = OFF                //Block 0 not protected from table reads executed in other blocks 
#pragma config EBTR1     = OFF                //Block 1 not protected from table reads executed in other blocks 
#pragma config EBTR2     = OFF                //Block 2 not protected from table reads executed in other blocks 
#pragma config EBTR3     = OFF                //Block 3 not protected from table reads executed in other blocks           
#pragma config EBTRB     = OFF                  //Boot block not protected from table reads executed in other blocks 




#define FOSC 1000000

/* The Delay Function */
#define delay_us(x) { unsigned char us; us = (x)/(12000000/FOSC)|1;\
   while( --us != 0) continue; }

void delay_ms(unsigned int ms)
{
  unsigned char i;
  do {
    i = 4;
    do {
      delay_us(164);
    }
   while(--i);
  }
  while(--ms);
}



#define RIGHT_WING_TRIS    TRISDbits.TRISD0
#define LEFT_WING_TRIS    TRISDbits.TRISD1


#define RIGHT_WING_PORT    LATDbits.LATD0
#define LEFT_WING_PORT    LATDbits.LATD1


#define ON_TIME 50
#define OFF_TIME1 100
#define OFF_TIME2 600
#define OFF_TIME3 800

#define FLASH_COUNT1 2


void main()
{
    unsigned char i;

    RIGHT_WING_TRIS = 0;
    LEFT_WING_TRIS = 0;
    RIGHT_WING_PORT = 0;
    LEFT_WING_PORT = 0;


    while(1)
    {

        for (i=0; i< FLASH_COUNT1; i++)
        {
            RIGHT_WING_PORT = 1;
            LEFT_WING_PORT = 1;
            delay_ms(ON_TIME);
            RIGHT_WING_PORT = 0;
            LEFT_WING_PORT = 0;
            delay_ms(OFF_TIME1);
            
        }

        delay_ms(OFF_TIME2);
        RIGHT_WING_PORT = 1;
        LEFT_WING_PORT = 1;
        delay_ms(ON_TIME);
        RIGHT_WING_PORT = 0;
        LEFT_WING_PORT = 0;
        delay_ms(OFF_TIME3);
    }    


}
 

Thread Starter

nickstones

Joined Jan 3, 2009
19
@ Spinnaker: Thank you. Thanks a ton. I was off on the delay times. i'm buying a few PICs today will post a video once i have a working circuit.
 

t06afre

Joined May 11, 2009
5,934
Since I am relearning C, have not coded C in 12 years;). I took your application as a C lesson. Using my PICkit 2 Starter Kit http://www.microchipdirect.com/productsearch.aspx?Keywords=DV164120. The PICkit 2 Starter Kit is all you need to get started actually, all software is included. With the starter kit you may also program PIC 8 pin uCs. Just remember to check if the device is compatible with PICkit 2 unit
Here is my simple code
Rich (BB code):
/*
 LED navigation lights simple example using MPLAB, and PICkit 2 Starter Kit. All software need included in the sPICkit 2 Starter Kit.   
*/
#include <htc.h>
#define _XTAL_FREQ  500000
unsigned long slow_int=1000;
unsigned long fast_int=50;
__CONFIG(INTIO & WDTDIS & PWRTDIS & BORDIS & MCLRDIS & FCMEN  & IESODIS & UNPROTECT);
void fast_blink(void)
{
 PORTC = 0xff;
  __delay_ms(fast_int);
PORTC = 0x0;
  __delay_ms(fast_int);
}
void slow_blink(void)
{
PORTC = 0xff;
 __delay_ms(fast_int);
  PORTC = 0x0;
__delay_ms(slow_int);
}void main(void)
{
 TRISC = 0b00000000;// port directions: 1=input, 0=output
  OSCCON=0b00110000;//set internal OSC to 500KHz
   PORTC = 0x0;//Zero portC
while (1){
 fast_blink();
  fast_blink();
__delay_ms(slow_int-fast_int);
 slow_blink();
}
}
 

Thread Starter

nickstones

Joined Jan 3, 2009
19
@ Andrew Leigh: Thank you Andrew. the circuit is useful but it's o/p is a single flash - with either circuit. what i'm looking for is a double strobe followed by a one sec pause.

@ t06afre: Thank you for your help. i am going to try this out too :)
will have to find out if the starter kit's available in this part of the universe :)
i hope it is. the programmers available here are all designed to use the serial port and i was told that the accompanying software won't recognise a USB - serial converter.
 
Top