arun 0 Posted October 7, 2012 Share Posted October 7, 2012 As mentioned on the "Winter Build" thread, I've been working on some code/hardware to use an Arduino to interface with a receiver and control one or more lighting circuits. I'm posting it because some people expressed interest on knowing more, but I apologise as the information is quite raw and although the prototype now works, there is still some way to go... For the impatient, here is a video. You can see the Tx, but you can see Rx is linked and hear switch clicking! Video The prototype that can: * Read a 3-position switch from receiver signal and decide which circuits to lights * Control the circuits in both a constant and flashing pattern The prototype is set up currently so that switch position: * LOW - everything off * MID - flashing (green) and constant (yellow) navigation circuits enabled * HIGH - as for MID but with landing lights on (red) The colours above correspond to the LEDs on the breadboard, you would replace these with circuits using more LEDs of higher-intensity and correct colour for an actual installation - probably putting multiple LEDs in series or parallel as you see fit. E.g. 2x white LEDs for landing, flashing navs ed/green etc. depending on your choice of model. The circuit is transistor switched to a 2s LiPo so should be no concerns to supply correct current to high-intensity LEDs. Just make sure you choose the right resistors! Ok, here's the bit that might only make sense if you are a software engineer... Source code is in an OK state, and can be found here. I'll put together a release version at some point with better documentation of the circuit etc. Source code One note, although this runs on an Arduino, I didn't develop in the Arduino IDE as it is a bit lacking in features for writing more complex code. I've used Eclipse, compiling against core Arduino libraries although may port to pure AVR at some point meaning that the only "Arduino" bit actually used is the convenient USB interface+bootloader. Trying to use the basic Arduino delay/readPwm type functions won't work for code that is doing many things at once such as this. As such code itself is based on interrupt driven events both for reading Rx pulses, and taking timer events for the strobe. When doing nothing the device goes to sleep and will awake on next interrupt to save power. As such there is plenty of low level stuff in the code to manipulate the timer check+compare registers that will only make sense if you read the ATmeg328p datasheet (which is the proc on many Arduinos). I'll post some more here if I don't get consumed by the havoc that is selling our house In the meantime, PM me if you are interested in actually trying to use it... Link to post Share on other sites
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now