This is a simple combat module using IR signals. I implemented this very similar to the parkzone sonic combat module (except for using IR instead of ultrasonic sound).
I didn't have the time (nor friends) to test it up in the air though so in case the IR part isn't working properly you might want to use ultrasonic sound isntead. Both price and implementation are very similar. Then it can even be made compatible with the sonic combat module also. => You'll need to analyze the signal from the combat module then. I would do it with pleasure but I need to pay 140 USD shipping to get this 20 USD module delivered to my door :s.
You don't need much parts. If you really want to keep the cost low you could go for a barebone arduino set up (make sure to add a crystal, don't use the internal clock since timing is crucial here). I used the arduino pro mini because of it's size.
I linked an IR led, an IR receiver, a few status leds, a buzzer and 4x 3 pin headers for servo wires & buzzer. The buzzer and leds are optional. Everything is on the same power rail (+ and -) fed from the ESC input channel (or any other power source on the 3 pin headers) and goes to the arduino pro mini's GND and RAW pins.
The PCB pictured on top isn't very optimal in terms of layout... I'll redo that soon with a pcb the size of the pro mini and then stacked upon each other. Should allow for a smaller foot print.
This is a sketch of how everything is connected (sorry no electronic background here so no use of correct symbols):
The pins are not listed. If you get the sketch from my project website (listed below) and want to run it right away you need to connect the parts to the following pins:
// sensor pin
#define PIN_SENSOR 3
// Infrared LED on Pin
#define PIN_SENDER 2
// Trigger on Pin
#define PIN_TRIGGER 5
// Positive Lead on the Piezo
#define PIN_SPEAKER 4
// Positive Leg of the LEDs
#define PIN_LED_GREEN 13
#define PIN_LED_ORANGE 12
#define PIN_LED_RED 11
// throttle input
#define PIN_THROTTLE_IN 6
// throttle output
#define PIN_THROTTLE_OUT 7
The software is very basic for now. Main function is to retrieve the throttle input and pass it through to the throttle output if no hits were detected. If an IR signal is found then the throttle will be blocked for a predefined amount of time. 10 seconds by default though that might be too much to recover from... use at your own risk :-).
There is no check yet on the type of IR signal. So with current code release you could shoot a passing plane with a remote control for TV if you want (might be a fun game :-)). In later iterations I will work with an IR signal with encoded data.
The code also needs optimalisation on the throttle handling. You can see in the video that it has some delay. This has several reasons:
- I have no wait time defined on reading pulses so you'll always get the default max wait time if no signal is present = delay.
- The throttle is handled in the same loop of the other logic for now. Can be moved to an interrupt if desired. Then move the throttle input to pin 8 or another interrupt pin (is it 10 or 9?). And code needs update.
- I added smoothening to fix the jitterish feedback from the servo I first had. This causes the reduced resolution of the servo movement. Not sure what the effect of this kind of non smooth signal is on an ESC?
The sketch can very easily be adapted to whatever you can think of. You can add channels or add rules to the logic. Feel free to contribute and improve this code. I'll do my best to find someone with flying skills close to me to take it all up in the air and get a video of this thing in action!
For more details and code visit: http://redmine.hcpl.be/projects/tag-combat/wiki. If someone else gets this tested in action please let me know.
So instead I did a range test on the ground. Without any lenses, just the bare sensor and ir led I got up to 8m range.
I'll do my best to get it up in the air soon with another plane equipped with this module. Should be fun.
Log In to reply
Log In to reply
The arduino pro mini is light and small so I picked that one. For first time Arduino it might be better to start with a proper Arduino UNO. These have a USB connection built in. The cheaper barebone arduino's and this arduino pro mini need an external USB connection. If you check my project website you'll find a link to a tutorial using a 4.4 USD nokia cable for this.
=> http://letsmakerobots.com/node/23728
I know a good (dutch!) shop that will deliver these parts (except for the cheap programmer). I'll PM you "in het Vlaams" about that.
Log In to reply
Log In to reply
Log In to reply
Log In to reply
Log In to reply
Log In to reply
The arduino handles The in coming throttle pwm signal and just forwards in normale state. On hit it will block The signal for some predefined time. You could implement more realistic actions like motor stutter or even control other signals.
The ir led is triggered by the arduino when it finds a high pwm signal on the connected channel. So no switches needed.
Check the link at the bottom of the article for all the code. You can check it out from svn and adapt to your need.
Log In to reply
Log In to reply
Log In to reply