Arduino Forum

Topics => Robotics => Topic started by: Paulware8 on Sep 05, 2011, 12:12 am

Title: IR Battle Tanks
Post by: Paulware8 on Sep 05, 2011, 12:12 am
I would like to start a forum on controlling tanks via rf and arduino/atmegas.

I have had some success reusing the receiver boards on toy state industrial tanks and using the nrf24l01 module for receiving RF.

Yesterday I was able to read a psx analog controller which I think would make a better transmitter interface than my previous namco pacman joystick transmitter.

Currently I am able to read and reproduce IR pulses from Forces of Valor, Huan Qi, Danbar, and Airbender devices.

I have also created some pcbs that www.iteadstudio.com can reproduce for $1.40 each (must be purchased in packs of 10).

I would like to create a smaller version that will fit in a megatech megatanx.  

I would like to open this forum to talk about useful things we learn as well as possibly defining standards that could allow multiple teams to compete.  I believe the nrf24l01 is a good choice for rf as it is a low cost, decent range, and supposedly has 100 software selectable channels (I have only used 1 so far).  

thanks,
Paul
Title: Re: IR Battle Tanks
Post by: Paulware8 on Sep 07, 2011, 06:27 am
I combined the PSX Analog controller with an nrf24l01 transmitter to control a tank.  I uploaded a youtube video: http://youtu.be/MWm9OSi9U6c (http://youtu.be/MWm9OSi9U6c)
Title: Re: IR Battle Tanks
Post by: trandi on Sep 07, 2011, 10:19 am
Wow, that looks really nice !
It's a shame that the controls don't seem to be proportional...

Dan
Title: Re: IR Battle Tanks
Post by: Paulware8 on Sep 11, 2011, 08:45 am
I hacked the receiver board for toy state industrial tanks: http://atmega.site40.net/default.php?bookmark=Toy State Industrial Tank (http://atmega.site40.net/default.php?bookmark=Toy State Industrial Tank),megabotz: http://atmega.site40.net/default.php?bookmark=MegaBotz (http://atmega.site40.net/default.php?bookmark=MegaBotz), megatank:http://atmega.site40.net/default.php?bookmark=MegaTech Mega Tank (http://atmega.site40.net/default.php?bookmark=MegaTech Mega Tank), and heng long 1/30 Sherman:http://atmega.site40.net/default.php?bookmark=Heng Long 1/30 Sherman (http://atmega.site40.net/default.php?bookmark=Heng Long 1/30 Sherman).  

The idea is to reuse the receiver board so that you don't have to buy an h-bridge.  Also reusing the power supply makes the finished product a little cleaner.  Next I want to reuse the receiver boards from battle bots and Heng Long, scale 1/16 tanks
Title: Re: IR Battle Tanks
Post by: Paulware8 on Sep 28, 2011, 07:32 am
I hacked a usb missile launcher.  
Here is a youtube video:
http://youtu.be/kwi1YTnKUTA (http://youtu.be/kwi1YTnKUTA)
Title: Re: IR Battle Tanks
Post by: Philthy on Oct 03, 2011, 05:08 pm
This is really good stuff! I'm pretty new to this, but my plans are making as many Arduino controlled RC toys as I can. I already have found a few of these things on your page at the local Savers. Awesome.
Title: Re: IR Battle Tanks
Post by: Paulware8 on Oct 04, 2011, 05:37 am
I hacked the Heng Long Scale 1/16 Tank receiver board.

Here is a link to the information

http://atmega.site40.net/default.php?bookmark=Heng Long 1/16 Tank (http://atmega.site40.net/default.php?bookmark=Heng Long 1/16 Tank)

Thanks!
Title: Re: IR Battle Tanks
Post by: Paulware8 on Oct 05, 2011, 06:50 am
Confirmed that the Heng Long receiver board will respond to arduino 5V signals

http://youtu.be/Ff2zCvAuMhw (http://youtu.be/Ff2zCvAuMhw)
Title: Re: IR Battle Tanks
Post by: Xenosis on Oct 25, 2011, 06:50 pm
Good stuff, keep it up.
Title: Re: IR Battle Tanks
Post by: Paulware8 on Dec 03, 2011, 06:23 am
Confirmed that the Heng Long Scale 1/24 (Type 90?) has same receiver board and pinout as the above scale 1/16
Title: Re: IR Battle Tanks
Post by: crzy_suzhou on Dec 11, 2011, 07:47 am
hi Paulware, http://paulware.comeze.com/#Heng Long 1/16 Tank is really a good stuffs link. tkx sharing.
Title: Re: IR Battle Tanks
Post by: Paulware8 on Dec 30, 2011, 08:49 am
Thanks for your comments.  I really appreciate them.
I hacked the IR pulse on the BattleMachines helicopter.  They are very stable and I highly recommend them.  You can get them at Target or Toys R Us for about $50.00 (with air-ground unit and 2 controllers).
I integrated this air component into the existing ground (tanks) plus added a repair (Rumble) robot.  

Here is a short video:
http://youtu.be/91kl_eZslRY (http://youtu.be/91kl_eZslRY)
Title: Re: IR Battle Tanks
Post by: Paulware8 on Jan 02, 2012, 07:42 am
Back in September Dan mentioned it would be better if the tank movement was more realistic/proportional.  I agreed but was limited by the number of pwm outputs on the atmega168/atmega328.  I use up 1 PWM output on my IR transmitter (D3) and more are tied up with the SPI output to my RF component (D8..D13).  That only left me D5, and D6 but I needed 4 PWM outputs for Left/Right Forward/Reverse.  

To solve this, I placed an additional slave atmega168 on my pcb.  The master communicates with the slave via IIC.  The slaves sole purpose is to control Left/Right Forward/Reverse.  Here is a sample video: http://youtu.be/ph8wXu_7DWQ (http://youtu.be/ph8wXu_7DWQ)  

Thanks for your comments
Paul
Title: Re: IR Battle Tanks
Post by: Paulware8 on Mar 07, 2012, 05:34 am
Spy gear has a tank that also has a camera on it.  
(http://paulware.comeze.com/Images/spygearTank.jpg)
I believe that the feed that goes from the controller to the eyeglass can also be sent to the RCA input of a television.  I need to confirm this.

I was able to find the pins that controls the tanks movement:
(http://paulware.comeze.com/Images/SpyGearTankBoard.jpg)
Title: Re: IR Battle Tanks
Post by: Paulware8 on Apr 04, 2012, 11:13 pm
Created a video showing the tank created in the previous post.
I also created some IR towers that use an ultrasonic range finder to detect enemy vehicles.
(http://www.youtube.com/watch?v=Fbrxld2OA1M&list=UUUR__E9nmtKAaVntOULWwGg&index=1&feature=plcp)
Title: Re: IR Battle Tanks
Post by: strykeroz on Apr 04, 2012, 11:17 pm
That's awesome stuff.  Is there a way for the towers to identify friend-or-foe or do they target any nearby target ?
Title: Re: IR Battle Tanks
Post by: Paulware8 on Apr 04, 2012, 11:29 pm
That's a good point.  Currently the ultrasonic sensor only detects distance rather than type, a tank could be killed by friendly fire.

IR pulses are unique and could be rejected, if the tank detected a "friendly" IR shot. 

For example HuanQi pulses are different from Forces of Valor pulses which are different from Battle Machine pulses. 

Currently my "hacked" tanks output all the pulses and accept all the pulses as hits. 

I was thinking that I might add RF receiver to the tower to turn them "off" when I wanted to pass.

Alternately I could add an IR receiver to them and use an IR remote to turn them on/off.  This is probably the cheapest method.

What do you think?
Title: Re: IR Battle Tanks
Post by: strykeroz on Apr 05, 2012, 07:40 am
I presume these turrets are not going to be immortal in the final design?  If so, another option (not as straightforward perhaps?) is to have your turrets use their iR sensor that's used for recording hits to decode an iR beacon LED on each tank which broadcasts a friend/foe or team iD?
Title: Re: IR Battle Tanks
Post by: Paulware8 on Apr 09, 2012, 04:20 am
 (http://www.youtube.com/watch?v=6iDKtThJRgc)
 To add an element of strategy, I used the repair robots to enable/disable the tower.  Previously the repair pulse only fixed vehicles, but now the tower will respond to a repair pulse by stopping its scan and firing.  

 Another possible future option would be for a repair robot to repair a disabled enemy unit and "claim" it for the friendly side.

 Note:  I hacked up this rumble robot pretty bad.  The problem ended up being old AA batteries.  It needed fresh ones. The way their motors are geared, they don't behave well with marginal batteries.
I ended up adding a TIP120 (NPN transistor) to the arm movement because I couldn't find the pin that controlled them.  If anyone knows where this pin is located, please send me a .jpg...thanks.

 Most people place their rumble robot controller in the head, but this requires that the arm motors be removed.  I kind of liked the arm motion, so I had to place my controller on the outside of the robot...Not very pretty, but the arm motion is cute for simulating the repairing of the vehicle.
Title: Re: IR Battle Tanks
Post by: Paulware8 on Jun 27, 2012, 04:34 am
I think landmines could be made cheaply using: http://www.instructables.com/id/DIY-Force-Sensitive-Resistor-FSR/step5/Notes/ (http://www.instructables.com/id/DIY-Force-Sensitive-Resistor-FSR/step5/Notes/) force sensors made from conductive foam + atmega168
Title: Re: IR Battle Tanks
Post by: Paulware8 on Jul 02, 2012, 12:12 am
Update for Huan Qi Tanks.  They now support 4 channels
http://www.youtube.com/watch?v=K-tgRfZG1ec&feature=plcp (http://www.youtube.com/watch?v=K-tgRfZG1ec&feature=plcp)
Title: Re: IR Battle Tanks
Post by: strykeroz on Jul 02, 2012, 02:33 am
Hi Paul

Do you find multiple ultrasonic sensors from the towers etc interfere with each other much?  Or how do you avoid that?

Geoff
Title: Re: IR Battle Tanks
Post by: Paulware8 on Jul 04, 2012, 05:05 am
Hi Geoff,

  Ultrasonic sensors have a range of about 3 feet.  I suppose that there is a potential for the transmission of one to be received as an echo by another, but I'm not sure if internal hardware may discount it (as the value would be higher than a normal echo).  Its a fair question and honestly I haven't created enough sensors to be able to test for this.  

 Which brings up another point that I am just starting to grasp.  An IR battlefield is composed of mobile units and static models and static interactive units.  I have been focused on the mobile units, but truly the larger effort is creating the Battlefield complete with models of cities, farmlands, terrain and static units.  To create a quality battlefield is at least as time/money consuming as creating a quality G-Scale train layout.  This hasn't necessarily discouraged me from continuing but it has given me a better grasp of what I want to create.
Title: Re: IR Battle Tanks
Post by: AWOL on Jul 04, 2012, 09:07 am
Quote
, but I'm not sure if internal hardware may discount it (as the value would be higher than a normal echo)

I think you may be overestimating the sophistication of U/S sensors.
I've seen them fooled by the U/S components of the sound of keys being jangled.
Title: Re: IR Battle Tanks
Post by: Paulware8 on Jul 05, 2012, 06:45 am
I hacked the star wars "Hellfire" tank.  Here is the board pins identified for left/right forward/reverse and fire:

(http://atmega.site40.net/Images/StarWarsTankBoard.jpg)

Here is some more info:
http://atmega.site40.net/default.php?bookmark=#StarWarsTank (http://atmega.site40.net/default.php?bookmark=#StarWarsTank)

I will post a video shortly
Title: Re: IR Battle Tanks
Post by: hoff70 on Jul 13, 2012, 08:36 pm
Those are really cool! Do you have any pictures of the mechanical workings, motors, tracks etc?
Title: Re: IR Battle Tanks
Post by: Paulware8 on Sep 16, 2012, 04:26 am
Any particular model that you would like to see gears/motors?  I have a bunch of Heng Long 1/16, no Tamiyas.  The GI  Joe tanks I've actually had trouble with the gears and need some help to refurbish them.

You know what would be cool?...Take a wifi camera that has pan/tilt, and hack the pan/tilt to control the movement of the tank.  I have a wanscam that I am trying to get to work...Anybody read chinese?

Paul
Title: Re: IR Battle Tanks
Post by: Mortis on Dec 10, 2012, 12:58 am
Hi, Paulware!

Nice work!!! I loved your tanks!!! XD

I have only one Huan Qi Tank, model 516-10 and green color and 40MHz, I could not find the yellow one yet and I'm working on a arduino bot to fight with green.

I made arduino tank using chassis from another tank, it is controlled by bluetooth and I added an IR emitter and receiver. I found on your library the code for barrel shot (huanQiPulses[] = {12500, 600, 2150, 600, 700, 1950, 600, 8500};) and now my arduino tank can fire against green tank with barrel XD. Thank you for it.

Now I want one little favor from you ^^

Can you scan machine gun pulses? Please?

Oh.. and sorry for my bad english, i'm brazilian and my portuguese is bad, imagine other languages lol

I am alert here to see your upcoming projects!!! ;)

Happy development!
Title: Re: IR Battle Tanks
Post by: Paulware8 on Dec 10, 2012, 03:19 am
Machine gun is very similar.  I'm glad you liked it.  I'll have to check my library, or do quick check.  I have a library for hacking an ir pulse.  That may be useful as well.  Can you point me to how you did the Bluetooth control.  I have a Bluetooth shield but I'm not sure if you need a master or a slave.
Thanks
Paul
Title: Re: IR Battle Tanks
Post by: Mortis on Dec 10, 2012, 12:52 pm
Hi, Paulware!!

I have used https://github.com/shirriff/Arduino-IRremote (https://github.com/shirriff/Arduino-IRremote) and using dump sample I got pulses codes from my green tank (arduino can receive shots now).

My problema was know the pulses that green tank recognizes as barrel and machine-gun (from the yellow tank, that I not have). Thanks to you I have the barrel and I will be very happy if you can hack (dump) machine-gun pulses from your 27MHz yellow tank.

I'm not using an arduino bluetooth shield, I'm using a module, this one http://dx.com/p/jy-mcu-arduino-bluetooth-wireless-serial-port-module-104299 (http://dx.com/p/jy-mcu-arduino-bluetooth-wireless-serial-port-module-104299).

I use this module to PC connection as a simple serial connection, to control  the tank using keyboard or my ps3 controller connected to PC. I'm on work now, but I use codes similar to this: http://www.instructables.com/id/how-to-Control-arduino-by-bluetooth-from-PC-pock/?ALLSTEPS (http://www.instructables.com/id/how-to-Control-arduino-by-bluetooth-from-PC-pock/?ALLSTEPS)

I'm following the most easy way ;)
Title: Re: IR Battle Tanks
Post by: Paulware8 on Jan 24, 2013, 06:20 am
Hey guys,
   Sorry I haven't replied for awhile.  I can't find my old version of code that had the machine gun pulse so I will have to resurrect my little lab to sample the pulse. 
   I just saw something today that explained why I was getting (relatively) crappy range on my IR firing.  I had the IR LED directly connected to the DIY arduino so that it was limited to Arduino power (20 mA).   I should've using a transistor and ground/power to amplify the pulse like this example: http://www.instructables.com/id/Duino-Tagger/step4/Transmitter/ (http://www.instructables.com/id/Duino-Tagger/step4/Transmitter/)
   
   Also I saw this cool flamethrower pumpkin http://www.instructables.com/id/Flamethrowing-Jack-O-Lantern/ (http://www.instructables.com/id/Flamethrowing-Jack-O-Lantern/)and I think it would make an awesome addition to the battlefield.  But instead of a pumpkin we will put it inside a plastic building!

  What do you think?
Title: Re: IR Battle Tanks
Post by: strykeroz on Jan 24, 2013, 06:23 am

But instead of a pumpkin we will put it inside a plastic building!  What do you think?
Oh my. I think your insurance premium just went up.
Title: Re: IR Battle Tanks
Post by: Paulware8 on Jan 25, 2013, 06:39 am
Flame affect mockup of building or vehicle should probably be placed outside, surrounded by non-flammable rocks.  Even better: Make a fenced off arena which has these kind of affects and don't let the patrons inside the arena.  Sounds like a great kickstarter idea.  Kids would love it.  What boy doesn't like fire. yeah he he yea yea burn
Title: Re: IR Battle Tanks
Post by: Mortis on Jan 27, 2013, 08:01 pm
Hi buddy!

Do not worry! My job stole all my time in last months and I could not play with my arduino. I hope I return to the scene in a few weeks.

I tried to find in my country the Yellow tank, but is hard to get here (for a just price). I will purchase from ebay/China probably.

About IR Transmitter, 20mA is really low (I was doing the same thing as you ^^) But 300mA sounds so much (for short intervals between pulses).

Fire is nice!!! But strykeroz is right... lol
Title: Re: IR Battle Tanks
Post by: Paulware8 on Feb 11, 2013, 06:09 am
I just saw this chasis.   I've been waiting for a cheap base I think this could be used for a basic frame $12.  http://www.hobbyking.com/hobbyking/store/__26250__4WD_Robot_Chassis_KIT_.html (http://www.hobbyking.com/hobbyking/store/__26250__4WD_Robot_Chassis_KIT_.html) what do you think?
Title: Re: IR Battle Tanks
Post by: AWOL on Feb 11, 2013, 08:51 am
Quote
I just saw this chasis.   I've been waiting for a cheap base I think this could be used for a basic frame $12. 

Leave your browser open on that page for a couple of minutes, and they'll offer you a discount  :)
Title: Re: IR Battle Tanks
Post by: Mortis on Feb 11, 2013, 06:23 pm
Sounds nice and cheap... I need to see how much will be the shipment to Brazil  :~

The robotic things are expensive here =(
Title: Re: IR Battle Tanks
Post by: strykeroz on Feb 11, 2013, 09:42 pm
That looks very cheap compared to other platforms.  Looking forward to your review, then might pony up for a couple.
Title: Re: IR Battle Tanks
Post by: Paulware8 on Feb 12, 2013, 05:14 am
Darn, shipping is outrageous, will have to wait until they stock this item in their US store.
I did however find this: http://www.ebay.com/itm/160840372337?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649 (http://www.ebay.com/itm/160840372337?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649) which is basically the same motor plus a wheel for $4 with free shipping.  
 I think this would make a nice robo/battlefield base.

 I started a github repository located https://github.com/Paulware/IRBattleField/ (https://github.com/Paulware/IRBattleField/)
 It contains a schematic for the receiver that uses an nrf24l01 and has a place for an hbridge to control 2 wheels.
  I'm going to order the pcb from iteadstudio so it will be a few weeks before I know whether it is correct.

Title: Re: IR Battle Tanks
Post by: strykeroz on Mar 14, 2013, 04:45 am
Hi Paul

Nothing I have here is large enough to hide the RPi with DIY Arduino inside - have you tried to get them physically inside one of your iR tanks?  And was there a reason you needed the extra horsepower of the RPi rather than doing it all within the Arduino code?

Geoff
Title: Re: IR Battle Tanks
Post by: Paulware8 on Mar 14, 2013, 12:05 pm
  Although you could possibly fit a raspberry pi inside a scale 1/16th tank I don't recommend it.
Remember, the raspberry pi is used for the controller.  The controller will be connected to the transmitter.
In the tank itself you will place the receiver, and yes I've made very small receivers with diy Arduinos that fit in smaller than 1/16 tanks.

  But back to the horsepower question.  This was the easiest/quickest way for me to read wiimote/Bluetooth.  I saw a link to a usb host shield solution, and I also have a Bluetooth shield that I would like to try.  But I haven't had success yet.
Title: Re: IR Battle Tanks
Post by: strykeroz on Mar 14, 2013, 02:32 pm
Gotcha.

I've not got a bluetooth shield, but have used the bluetooth bees and seen the cheap bluetooth modules used too.  Very straightforward, just send them commands much like the old-school AT modem controls.
Title: Re: IR Battle Tanks
Post by: Mortis on Mar 14, 2013, 05:17 pm
cool to see arduino controlled by wiimote! Nice work!

I'm waiting the components to mount a minimal arduino and I can put inside my tanks (arduino mega is so big :))

When I have some time I'll post some pics and infos sbout my tank.
Title: Re: IR Battle Tanks
Post by: alanparfitt on Sep 22, 2013, 09:48 am
So..... (just to make sure I understand all this): if I solder wires to those seven points on my tank's board and then connect these to digital ports on my  Arduino, I can control the tank's movement with e.g. an ultrasonic sensor, point the gun at e.g. a heat source, fire it if the cat walks in front of an ir heat sensor, etc.? I'm new to this stuff and a tad geriatric as well, so I need things spelled out to me... :-)
Title: Android and UDP
Post by: Paulware8 on Jun 04, 2014, 06:10 am
Wow its been more than a year since my last post. 
I just finished testing out a new interface here is a list of components and why they were chosen.
1) Heng Long Scale 1/16 battle tank: Chosen because the pinouts to the board are known and lots of room to add components
2)L298 H-Bridge: Chosen for price (about $3.00 on ebay), and it can also convert 7.2V battery to 5V for Arduino
3)Access Point: Chosen for price (about $10.00 on ebay) and will allow udp communications from a Android Tablet
4)ENC28J60 module: Chosen for price (about $4.00 on ebay) and has a decent library for udp
5)Mini pro knockoff: Chosen for price (about $3.00 on ebay) and runs arduino code

A video and source code for android app and arduino mini pro will follow
Title: Re: IR Battle Tanks
Post by: Paulware8 on Jun 11, 2014, 09:05 am
I added an Android directory to https://github.com/Paulware/IRBattleField/ which contains Android java code used to control a Scale 1/16 Heng Long Tiger tank
I added a youtube video: https://www.youtube.com/watch?v=u4fnYeL2eCA (https://www.youtube.com/watch?v=u4fnYeL2eCA)