If you enjoy our forum, why not join us? :) Login removes all the ads too! Click here to register in a few simple steps
We started a spare parts donation program, check it out :) http://intofpv.com/forum-spare-parts-exchange
Our IntoFPV LiPo Straps are back in stock! Purchase Here

Login to remove this ad | Register Here
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Capture the Flag
I would like to share something I’ve been wanting for a while so I just decided to learn Arduino and do it myself.

It’s Capture The Flag for your drones (with FPV).

See explanation video here:

This mod was made with Tiny Whoops (check TinyWhoop.com) in mind but really you can use it with any size drone as long as it has a 5.8 Ghz video transmitter on it.

It’s fairly easy to build, costs around £9 (or $12) per flag in materials and you just need to solder a few cables.

You can battle 4 drones (BLUE TEAM - RACEBAND 1 to 4) vs 4 drones (RED TEAM - RACEBAND 5 to 8) in a game of Capture The Flag (as long as your VTX signals allow for that many to be flying at the same time) with as many flags as you are bothered to build!
There are also several new modes you can now try out  - read more on this below.

The code itself is GREATELY based off Chorus RF Laptimer
Visit their repo if you are interested in knowing more about it here: https://github.com/voroshkov/Chorus-RF-Laptimer

Unlike Chorus RF Laptimer, at this moment this mod is standalone and cannot be accessed remotely (yet)

You can though, change the code to match your needs.
I've commented everything that I've changed in the code with and the explanation behind it so it's easy for you to find it and replace it. Pretty sure the code can be improved by A LOT but hey .. it's working!

Materials you need

> 1x Arduino Nano (or an uno if you have one should also work)

> 1x FPV Receiver module with SPI mod (these below already have the mod but double check - google vtx spi mod or check the pictures in this repo)

> 1x WS2812 led strip (I used the one below - do not recommend using a bigger strip then 10 leds without external power)

> The ability to solder a few cables Smile  ( oh .. you also need a few cables Tongue )

How to assemble it

1. Start by soldering the WS2812 strip Ground cable (black) to Arduino ground, the WS2812 strip 5V cable (red) to Arduino 5V and the WS2812 strip din cable (blue) to Arduino D5
2. Now solder the Channel 1 pin in your VTX receiver to your Arduino D10
3. Solder the Channel 2 pin in your VTX receiver to your Arduino D11
4. Solder the Channel 3 pin in your VTX receiver to your Arduino D12
5. Solder the Ground pin in your VTX receiver to your Arduino Ground (the same ground you connected the WS2812 ground to)
6. Solder the 5v pin in your VTX receiver to your Arduino 5V (the same 5v you connected the WS2812 5v to)
7. And finally, solder the RSSI pin in your VTX receiver to your Arduino A3

You can see a build video here:

What? That's it?
Almost! You just need to upload the code to your Arduino via usb and you are done.

How to upload the code

1. Start by downloading and installing Arduino IDE (https://www.arduino.cc/en/Main/Software)
2. Next, download THIS repository and unzip it somewhere in your desktop.
3. Go to the new folder you downloaded and open the file called CTF.INO
4. You will now be able to see a bunch of code and several files open.
5. Goto Tools/Board and pick Arduino Nano (if you bought an arduino nano, otherwise pick the one you have). The processor is ATMega328P.
6. Now to go port and pick the port your Arduino Nano is connected to. If you don't know which one it is, disconnect the nano and check what ports are available. Reconnect the nano, the new port will be the nano. If you don't get any new ports I'm afraid you will need to google how to troubleshoot it Smile
7. You will need to download a Library called FASTLED. Goggle this if you don't know how. You can do it directly from Arduino IDE.
8. VERY IMPORTANT. You will need to play with the RSSITHRESHOLD value to find what works best for you. I find that most receivers work differently and that value can be between 190 to 260. Test it out with with EACH nano you build
9. You can also change MODES (view further down) by changing the MODE value in the code.
10.Finally, when you are ready, goto sketch menu and select upload. If you done everything right you will see an increasing bar on the bottom right handside of the program and then a message saying Done uploading on the lower left handside.

You are now the proud owner of a CTF flag!

1. The arduino board can be powered by connecting 5v to the 5v connection OR by connecting it to a power bank via USB.
2. You can now also 3D print a neat cover for the arduino : https://www.thingiverse.com/thing:2766437
3. Once you power up the arduino board it will start scanning for all RACEBAND frequencies. It takes ~6 seconds to do a complete loop. 
4. Once it finds the first frequency it will change the LED colour depending if you are BLUE TEAM (RACEBAND 1-4) or RED TEAM (RACEBAND 5-8)
5. Once the flag changes colour it will only scan for the other team frequencies so the scanning takes place faster (~3 seconds for a loop)
6. Protect your flags anyway you can!


There are currently a few modes available

Mode 2. Capture the flag. Your standard capture the flag where two teams battle it out to have their flag and their opponents flag captured
- R1-R4: TEAM BLUE    //     R5-8: TEAM BLUE

Mode 5. Free For All Deathmatch. You are on your own and need to capture as many flags for yourself as you can.
- R4 RED

Mode 6. Scavenger Hunt. All flags have been hidden. It's your mission to find as many as you can before your battery ends.
- R4 RED

I will try to keep this post up to date with news and new releases, but to be honest, if you follow me in Youtube it will be much faster for you to get updated Smile
Feel free to ask any questions you might have!

My YT channel: http://www.youtube.com/SeekNDFPV
[-] The following 7 users Like Carlos Costa's post:
  • Kerni_fpv, xcalibur, Oscar, RENOV8R, sloscotty, jimbo_wa, Tom BD Bad
Great work Carlos - love the new version for solo play too! Smile

I've also created a nifty(!) case for the Arduino, VTX and LED strip to snuggle down in - up on Thingiverse...


Got a couple of them built up (not by me) and will be testing them out tomorrow...
[-] The following 4 users Like jimbo_wa's post:
  • unseen, Carlos Costa, Oscar, Tom BD Bad
Love it! I've added your stl link in my github description.

As you said, SP CTF is out, and soon other modes will too Smile
[-] The following 4 users Like Carlos Costa's post:
  • unseen, jimbo_wa, Oscar, Tom BD Bad
Login to remove this ad | Register Here
Great work guys Big Grin Carlos we need to play this next time we meet Smile lol looks fun!
Don't be a LOS'er, be an FPV'er :) -- Blog - Facebook - Instagram - Twitter - Google Plus
[-] The following 1 user Likes Oscar's post:
  • Carlos Costa
Very cool Carlos. We should get this in our office!!
(07-Feb-2018, 02:34 PM)xcalibur Wrote: We should get this in our office!!

A team building exercise everyone will want to attend!
Windless fields and smokeless builds
Login to remove this ad | Register Here
(06-Feb-2018, 03:27 PM)Oscar Wrote: Great work guys Big Grin Carlos we need to play this next time we meet Smile lol looks fun!

The Single Player mode CTF is wicked! and super hard if you play on harder modes Big Grin
I'm changing a few things for the next release and making it it even harder hahaha .. but you will have the opportunity to change how hard it is (like you do in the current version).

Meanwhile the new release also has Domination CTF where you have to stand by the flag to fully capture it AND a point system to tell you who won, or how well you did in SP mode.
[-] The following 2 users Like Carlos Costa's post:
  • Tom BD Bad, unseen