Need help with LED navigation lights

Discussion in 'The Projects Forum' started by nickstones, Jan 18, 2010.

  1. nickstones

    Thread Starter Member

    Jan 3, 2009
    19
    0
    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.
     
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    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.
     
  3. Wendy

    Moderator

    Mar 24, 2008
    20,764
    2,534
  4. nickstones

    Thread Starter Member

    Jan 3, 2009
    19
    0
    @ 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: Jan 18, 2010
  5. Wendy

    Moderator

    Mar 24, 2008
    20,764
    2,534
    If you read carefully it says how to create any sequence you want, using diodes to make simple OR gates.
     
  6. nickstones

    Thread Starter Member

    Jan 3, 2009
    19
    0
    @Bill_Marsden: Got that the second time i read thru' :)
    Sorry for the trouble. Thanks a lot for the article.
     
  7. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    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.
     
  8. nickstones

    Thread Starter Member

    Jan 3, 2009
    19
    0
    Been looking around for PIC circuits for a while. didn't find any that i could trust :(
     
  9. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    And by trust you mean? Could you elaborate ;)
     
  10. nickstones

    Thread Starter Member

    Jan 3, 2009
    19
    0
    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 :)
     
  11. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,866
    988

    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.
     
  12. thyristor

    Active Member

    Dec 27, 2009
    94
    0
    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.
     
  13. nickstones

    Thread Starter Member

    Jan 3, 2009
    19
    0
    @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.
     
  14. nickstones

    Thread Starter Member

    Jan 3, 2009
    19
    0
    @ 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.
     
  15. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,866
    988

    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.
     
  16. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,866
    988

    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.




    Code ( (Unknown Language)):
    1.  
    2. #include <p18f46k20.h>
    3.  
    4.  
    5.  
    6. /* Progam:         WingLights
    7.    Author:        Spinnaker
    8.    Compiler:    MPLAB C18
    9.  
    10.    Description:    Blinks two LEDs in the pattern specified. LEDs will be axfixed to the wingtips of
    11.                 a model airplane.
    12.  
    13.  
    14. */
    15.  
    16.  
    17. /** C O N F I G U R A T I O N   B I T S for 18f46k20 ******************************/
    18.  
    19. #pragma config FOSC     = INTIO67             //Internal oscillator block, port function on RA6 and RA7
    20. #pragma config FCMEN     = OFF                //Fail-Safe Clock Monitor disabled
    21. #pragma config IESO     = OFF                //Oscillator Switchover mode disabled                  
    22. #pragma config PWRT     = OFF                //Power Timer disabled
    23. #pragma config BOREN     = SBORDIS            //Brown-out Reset enabled in hardware only    
    24. #pragma config BORV     = 30                   //Brown-out Voltage
    25. #pragma config WDTEN     = OFF                //WDT is controlled by SWDTEN bit of the WDTCON register
    26. #pragma config WDTPS     = 32768             //Watchdog Timer Postscale Select bits 1:32768                        
    27. #pragma config MCLRE     = OFF                //RE3 input pin enabled; MCLR disabled
    28. #pragma config LPT1OSC     = OFF                //Low-Power Timer1 Oscillator  disabled. Operates in standard power mode
    29. #pragma config PBADEN     = ON                //PORTB<4:0> pins are configured as analog input channels on Reset
    30. #pragma config CCP2MX     = PORTC                //CCP2 input/output is multiplexed with RC1
    31. #pragma config STVREN     = ON                //Stack full/underflow will cause Reset
    32. #pragma config LVP         = OFF                //Single-Supply ICSP disabled
    33. #pragma config XINST     = OFF               //Instruction set extension and Indexed Addressing mode disabled (Legacy mode)
    34. #pragma config CP0         = OFF                //Block 0 (000800-001FFFh) not code-protected
    35. #pragma config CP1         = OFF                //Block 1 (002000-003FFFh) not code-protected
    36. #pragma config CP2         = OFF                //Block 2 (004000-005FFFh) not code-protected
    37. #pragma config CP3         = OFF               //Block 3 (006000-007FFFh) not code-protected
    38. #pragma config CPB         = OFF                //Boot block (000000-0007FFh) not code-protected
    39. #pragma config CPD         = OFF                //Data EEPROM not code-protected                  
    40. #pragma config WRT0     = OFF                //Block 0 not write-protected
    41. #pragma config WRT1     = OFF                //Block 1 not write-protected
    42. #pragma config WRT2     = OFF                //Block 2 not write-protected
    43. #pragma config WRT3     = OFF                //Block 3 not write-protected
    44. #pragma config WRTB     = OFF                //Boot block not write-protected
    45. #pragma config WRTC     = OFF                //Configuration registers not write-protected
    46. #pragma config WRTD     = OFF                 //Data EEPROM not write-protected
    47. #pragma config EBTR0     = OFF                //Block 0 not protected from table reads executed in other blocks
    48. #pragma config EBTR1     = OFF                //Block 1 not protected from table reads executed in other blocks
    49. #pragma config EBTR2     = OFF                //Block 2 not protected from table reads executed in other blocks
    50. #pragma config EBTR3     = OFF                //Block 3 not protected from table reads executed in other blocks          
    51. #pragma config EBTRB     = OFF                  //Boot block not protected from table reads executed in other blocks
    52.  
    53.  
    54.  
    55.  
    56. #define FOSC 1000000
    57.  
    58. /* The Delay Function */
    59. #define delay_us(x) { unsigned char us; us = (x)/(12000000/FOSC)|1;\
    60.    while( --us != 0) continue; }
    61.  
    62. void delay_ms(unsigned int ms)
    63. {
    64.   unsigned char i;
    65.   do {
    66.     i = 4;
    67.     do {
    68.       delay_us(164);
    69.     }
    70.    while(--i);
    71.   }
    72.   while(--ms);
    73. }
    74.  
    75.  
    76.  
    77. #define RIGHT_WING_TRIS    TRISDbits.TRISD0
    78. #define LEFT_WING_TRIS    TRISDbits.TRISD1
    79.  
    80.  
    81. #define RIGHT_WING_PORT    LATDbits.LATD0
    82. #define LEFT_WING_PORT    LATDbits.LATD1
    83.  
    84.  
    85. #define ON_TIME 50
    86. #define OFF_TIME1 100
    87. #define OFF_TIME2 600
    88. #define OFF_TIME3 800
    89.  
    90. #define FLASH_COUNT1 2
    91.  
    92.  
    93. void main()
    94. {
    95.     unsigned char i;
    96.  
    97.     RIGHT_WING_TRIS = 0;
    98.     LEFT_WING_TRIS = 0;
    99.     RIGHT_WING_PORT = 0;
    100.     LEFT_WING_PORT = 0;
    101.  
    102.  
    103.     while(1)
    104.     {
    105.  
    106.         for (i=0; i< FLASH_COUNT1; i++)
    107.         {
    108.             RIGHT_WING_PORT = 1;
    109.             LEFT_WING_PORT = 1;
    110.             delay_ms(ON_TIME);
    111.             RIGHT_WING_PORT = 0;
    112.             LEFT_WING_PORT = 0;
    113.             delay_ms(OFF_TIME1);
    114.            
    115.         }
    116.  
    117.         delay_ms(OFF_TIME2);
    118.         RIGHT_WING_PORT = 1;
    119.         LEFT_WING_PORT = 1;
    120.         delay_ms(ON_TIME);
    121.         RIGHT_WING_PORT = 0;
    122.         LEFT_WING_PORT = 0;
    123.         delay_ms(OFF_TIME3);
    124.     }    
    125.  
    126.  
    127. }
    128.  
     
  17. nickstones

    Thread Starter Member

    Jan 3, 2009
    19
    0
    @ 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.
     
  18. Andrew Leigh

    Active Member

    Sep 8, 2008
    85
    0
    Last edited: Jan 20, 2010
  19. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    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
    Code ( (Unknown Language)):
    1.  
    2. /*
    3.  LED navigation lights simple example using MPLAB, and PICkit 2 Starter Kit. All software need included in the sPICkit 2 Starter Kit.  
    4. */
    5. #include <htc.h>
    6. #define _XTAL_FREQ  500000
    7. unsigned long slow_int=1000;
    8. unsigned long fast_int=50;
    9. __CONFIG(INTIO & WDTDIS & PWRTDIS & BORDIS & MCLRDIS & FCMEN  & IESODIS & UNPROTECT);
    10. void fast_blink(void)
    11. {
    12.  PORTC = 0xff;
    13.   __delay_ms(fast_int);
    14. PORTC = 0x0;
    15.   __delay_ms(fast_int);
    16. }
    17. void slow_blink(void)
    18. {
    19. PORTC = 0xff;
    20.  __delay_ms(fast_int);
    21.   PORTC = 0x0;
    22. __delay_ms(slow_int);
    23. }void main(void)
    24. {
    25.  TRISC = 0b00000000;// port directions: 1=input, 0=output
    26.   OSCCON=0b00110000;//set internal OSC to 500KHz
    27.    PORTC = 0x0;//Zero portC
    28. while (1){
    29.  fast_blink();
    30.   fast_blink();
    31. __delay_ms(slow_int-fast_int);
    32.  slow_blink();
    33. }
    34. }
    35.  
     
  20. nickstones

    Thread Starter Member

    Jan 3, 2009
    19
    0
    @ 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.
     
Loading...