Jump to content

Navigation LED Lights with Beacon & Strobe Effect (Arduino)


Allan Bowker
 Share

Recommended Posts

Touche John!, No pictures of my set up but I have the signal lead from Channel 5 of the Spektrum AR6100e going to D2 which switched between normal and landing modes when I operated the gear switch on the Tx.

I have made my set up 'stand alone' as my Arduino board is now powered from the ESC output to the AR6100e by connecting the ground and positive connections from Channel 5 to the ground and + 5V inputs of the Arduino board, which is probably the set up I will use in the aircraft. The LED's (that are working) are connected through 150R current limiting resistors as follows:

Green navigation light to TX1 on Arduino Nano

Red Navigation light to RX0 " "

White strobe 1 to D7 " "

White strobe 2 to D8 " "

Landing light to D4 " "

My rotating beacon LED is currently disconnected from D3 as it does not work and looking through other Arduino sketches of similar LED drivers the 'boolean' statement has me truly bamboozled.

Next project on my list is to make a servo move!

Barry

Link to comment
Share on other sites

Using that sketch has fixed it Allan, The only issue now is the landing light on D4 is not fully extinguishing but I have now gained a nice quick flashing strobe on D9 and a simulated revolving beacon on D3. If I get the time and enthusiasm I will compare the old and new codes and post the difference on here.

In between time I have used my second Nano as a sound generator to reproduce the five note tune from "close encounters of the third kind" as it seems most appropriate at the moment!!

Many thanks to Allan and John for their patience and help as we jointly enter this new world of discovery (or black magic) and I'm off now to make myself a very well deserved cup of tea, as STMBO is watching Midwife.

Barry

Link to comment
Share on other sites

You mention you could have connected the strobes together to a single pin; I can't read the code file, so do they flash at exactly the same interval when using separate pins? I've programmed my PICAXE circuits to flash at a very slightly different interval to each other, so that they look random, like I observe on several full-size aircraft.

Link to comment
Share on other sites

Allan (Bennett) - Have a look at the code segments I added to my earlier post (these are from the code that Allan (Bowker) linked to somewhere back on page 1 - I haven't looked at the code he posted a link to this evening)

You will see that the time interval for one strobe is set to 2000ms, and for the other 2100ms. So they will flash at a slightly different rate.

Link to comment
Share on other sites

Posted by Allan Bowker on 21/02/2016 19:05:26:

Here is the source thread of the code guys.

Let me know how you progress.

Looking through that thread there are several versions of the code. It starts with the version you posted earlier. Then on page 3 jnickelbein posted a revised version with different coding for the signal input and different ouput pins as follows;

* The pins are assigned as follows:
* --- Outputs ---
* DO1 - Starboard Nav Light
* DO2 - Port Nav Light
* DO3 - Landing Light
* PWM4 - Revolving Beacon Light
* DO6 - Tail Nav Light
* DO7 - Strobe 1 Light
* DO8 - Strobe 2 Light
* --- Inputs ---
* DI5 - Receiver Signal Input
*/

A few posts later he posted another version (NavLightController328.ino) with different pin assignments again;

* The pins are assigned as follows (ATMega328):
* --- Outputs ---
* PWM3 - Revolving Beacon Light
* DO4 - Landing Light
* DO5 - Port Nav Light
* DO6 - Starboard Nav Light
* DO7 - Tail Nav Light
* DO8 - Strobe 1 Light
* DO9 - Strobe 2 Light
* --- Inputs ---
* DI2 - Receiver Signal Input
*/

With a bit of luck some time next week I'll have a real Arduino Nano to play with! smile d

Link to comment
Share on other sites

Posted by Barryorbik on 21/02/2016 18:15:27:

...and looking through other Arduino sketches of similar LED drivers the 'boolean' statement has me truly bamboozled.

Boolean is basically just true/false logic. If you post an example of something that's bamboozled you I can try and explain it. (Coding is my "day job" - though I'm not normally writing code to switch lights on and off!)

Link to comment
Share on other sites

Posted by John Privett on 21/02/2016 21:06:54:

Allan (Bennett) - Have a look at the code segments I added to my earlier post (these are from the code that Allan (Bowker) linked to somewhere back on page 1 - I haven't looked at the code he posted a link to this evening)

You will see that the time interval for one strobe is set to 2000ms, and for the other 2100ms. So they will flash at a slightly different rate.

Thanks John, I was trying to read the original link to the code file, which my computer couldn't, so I overlooked your snippets.

Link to comment
Share on other sites

Posted by Allan Bennett on 22/02/2016 08:36:25:

Thanks John, I was trying to read the original link to the code file, which my computer couldn't, so I overlooked your snippets.

You should be able to read the original code quite easily. The file that Allan linked to is just an ordinary zip archive file. Open that and it contains a single file - NavLightController.pde - which you can read using any text editor (eg. Notepad.)

Link to comment
Share on other sites

Hmmm ... I still get a message that "Windows cannot open this file ..." using up-to-date Windows 7. So I then let Windows search the internet for the right program to open it, and it still says it can't. Must be because it needs unzipping, and I haven't got an unzipper on my PC. Never mind, I've seen the snip you posted, which answered my question.

Link to comment
Share on other sites

Hi Allan Bennett, Not sure how advanced you are with these things but I'm still a novice but the easiest way I found was to register and download the Arduino software direct from their site (you will need this package anyway to upload programs to the Arduino Nano), then download the navigation light program and save it as a zipped file on the desktop before right clicking on it to "extract all files". When you open up the Arduino program you then click on "file" "open" and select the unzipped navigation light program from the desktop. You can then look at the program in detail and it you need to copy any to print off etc just press the left mouse button and highlight the text you want and then control C to copy it, then paste it into paint or word etc as you wish with control V.

Sorry if this is too basic but it works and saves a lot of frustration.

Barry

Link to comment
Share on other sites

Mr Bowker, you are a very bad man!

For years I have managed to resist getting into these programable controlers on the premis that they are both too expensive and too complicated.

Then you come here with a post proving neither of my arguments hold water.

Nano purchased, Software installed; LED's flashing, Servos moving, reading digital and analog inputs and writing the same.

I am only just scratching the surface of coding and starting on a steep learning curve.

Thank you (I think) for the late nights laugh

Link to comment
Share on other sites

Posted by Barryorbik on 23/02/2016 09:46:30:

you need to copy any to print off etc just press the left mouse button and highlight the text you want and then control C to copy it, then paste it into paint or word etc as you wish with control V.

You can also print the code from within the Arduino IDE.

I have found that useful to go through and try and fathom out the code on paper away from the PC.

I also found on my work PC (without the Arduino IDE installed) that you can click on an Arduino sketch, windows will ask what program to open with.
Choose Wordpad or Word and that will keep the line formatting.

Opening with notepad doesn't pick up the line breaks and tabs.

As the Arduino IDE is free (unless you are on a restricted works PC! grr!) best just to load the sketch into Arduino IDE and view/print from there.

Link to comment
Share on other sites

Hi Kevin and welcome to the dark side!, I had not tried printing direct from the IDE. You have obviously progressed quicker than me so maybe you can help with some questions I have.

1 have you changed any of the code to correct the landing light not fully extinguishing or did yours work straight off?

2 which Tx/Rx are you using and how many channels do you have connected to the Nano and to which pins?

3 I have not tried the servo yet but which output pin is it connected to, as I could not see any reference to it in the sketch

I think that will do for now.

Barry

Link to comment
Share on other sites

Posted by Barryorbik on 23/02/2016 15:39:32:

3 I have not tried the servo yet but which output pin is it connected to, as I could not see any reference to it in the sketch

I haven't spotted any code in the navigation-light sketches for driving a servo. For that you'll need to arrange a pulse of between 1 and 2ms in length, repeated every 20ms or so. (Possibly stating the obvious, but the 1-2ms gives the servo position, and the 20ms repetition rate should be non-critical.)

Edited By John Privett on 23/02/2016 20:32:53

Link to comment
Share on other sites

Thanks Allan and Barryorbik. I'm new to Windows 7 as of a couple of weeks ago, and didn't know it had a built-in unzipper. As it happens, I realised after my previous post that I could "open with" and specify notepad to read the file, rather than asking Windows to find something that would work. It was missing the line breaks and tabs though, as Kevin has noted above.

As it happens, I don't think I'll be switching to Arduino for, even though it may be more capable than PICAXE, at £1.80 a time I'm quite happy building my own circuits with the PICAXE 08M2 chip. My interest is seeing how other people are doing things, and hopefully contributing too.

Link to comment
Share on other sites

There is a certain convenience with the Arduino having built in USB port, 5v reg and all the I/O s being brought out.
So although being a tight so and so, I am prepared to stump up the extra for a £2.99 Arduino Nano clone (allowed under their common use license).

Just to clarify. I have not loaded up this code for the Nav lights, that was just the teaser that made me follow Mr Bowkers links.

I am working my way through various Arduino tutorials. Both from www.Arduino.cc and from www.adafruit.com

To cover Mr Privett's observation regarding driving servos; there is an Arduino library (basically a function block) that can be called to do all the fancy servo pulsing. If I remember correctly the Nano can drive 5 or so servos (probably limited by the number of PWM pins).

A revalation to me that almost all the IO are universal and can be defined in code. Even to the point of pullup resistors being internal & coded.

Most entertaining.

Link to comment
Share on other sites

£2.99? I didn't realise they could be that cheap. Maybe I'll have to try one, for with my circuits I generally add a 5v regulator and some output transistors, or a darlington pair array, plus whatever resistors or current regulators are needed for the LEDs, and connector strips. Of course, building the devices is half the fun.

Link to comment
Share on other sites

  • 1 month later...

Hello

I have read through all the posts on this thread and am now totally confused on which code to use. Electronics passed me by some years ago and I am now back to basics. I have a Arduino Nano and Mini pro.

In fairness I did get Allan Bowker's system to work but I could never get the switches to work. What I would like to be able to have is the following. Landing lights switching on and off with one switch and then Red and Green nav lights, wingtip double strobe, Red and White rotating beacons and tailtip strobe/or rotating, all switched on and off with another switch. I would like to run 1/3 watt LED's as they are more visible during the day.

I appreciate any help offered, thank you.

Link to comment
Share on other sites

Hello Ron

I haven't had any time to progress this little project myself so far, I was hoping a few people might pick up the baton and run with it.

We do need a circuit diagram for those of us who want to run higher power LED's and we need somebody to work on the original code I posted so that the lights can be controlled from the transmitter.

I have seen some solution examples online when originally Googling around the web.
Anyone else up for the challenge? laugh

Link to comment
Share on other sites

"We do need a circuit diagram for those of us who want to run higher power LED's"

I know almost nothing about electronics so take my advice with a large pinch of salt.LED systems.

For a neat ready made solution, look here:
http://store.jdrones.com/jD_IOBoard_p/jdioboard11.htm
I have used a few of these with no problems.

For a home made solution, use a ULN2003A Darlington Array 7 NPN 500mA, for example:
http://www.hobbytronics.co.uk/index.php?route=product/search&keyword=uln
Hopefully, there's a picture nearby.

AJHimg_2664.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...