*

Offline LukeZ

  • 106
    • View Profile
Standalone Tank IR
« on: January 18, 2017, 06:18:27 PM »
For the fun of it I've taken some code from the TCB having to do with IR, simplified it and packaged it as a self-contained sketch for running on any Arduino Uno/Nano/or other board with ATmega328 processor.

The sketch can be downloaded here: TankIR

What does it do? Basically it lets you send and receive tank IR signals. Sending (ie, "firing the cannon") can be triggered in three ways:
  • Manually with a pushbutton (connect pin D4 to ground)
  • With a positive 5 volt trigger on pin A0 from some other circuit (greater than 5 volt inputs are possible but further input protection will be required)
  • Or the device can automatically fire a repair IR signal in response to being fired at by some other tank (useful as an "automatic tank repair station.")
The sketch can also control a recoil servo which will articulate whenever the cannon is fired (pin D8). Cannon fire will also cause a brief positive signal to appear on pin D6, this could be used to trigger a Taigen High Intensity Flash unit.

Within the sketch is a file called "A_Setup.h" (it will appear as a tab in your Arduino editor). That is where all user settings can be adjusted. Recoil servo end points and retract and return times can all be adjusted, as well as which protocols are sent and which are received.

Leave your Arduino attached to your computer with a USB cable and open the Serial Monitor from within the Arduino IDE to see informational messages printed during operation.


*

Offline LukeZ

  • 106
    • View Profile
Hardware Notes
« Reply #1 on: January 18, 2017, 06:19:59 PM »
Hardware Notes

Included in the project files is a simple schematic in PDF format, please review it for wiring details. An Arduino Nano is shown but the pins are the same for the Uno.

You can connect a standard Tamiya "apple" directly to your Arduino (Tamiya 53447). The Tamiya apple combines an IR receiver and notification LEDs; the LEDs already have current limiting resistors included inside the apple. If you build your own receiver and use your own hit notification LEDs, you need to include your own current limiting resistor appropriate to the LEDs you choose. Most Arduinos can't source more than 40mA per pin.

For the IR transmitter you can use the Tamiya IR LED that is included with the apple. We have also found the Vishay TSAL6100 (DigiKey 751-1203-ND) to be a comparable replacement.

For maximum distance the IR transmitter should be driven far beyond its typical current rating, but even so it still needs a current limiting resistor. The LED will survive the high current because the IR signal is very brief. In testing we have found a 3.3 ohm, 1 watt resistor to be the best compromise between range and LED longevity.

If you wish to send repair signals it is often desired to prevent the beam from traveling very far. In this case a higher value resistor is used inline with the IR emitter - we have found 1k ohm will give you a range of just a few feet.

Re: Standalone Tank IR
« Reply #2 on: May 24, 2017, 12:17:27 PM »
Hello, new bloke here!

I designed my own Arduino powered tank battle system a while back, great to see this project!    I did a cut down version like this specific part to run a Panzerturm...  This runs a servo for a random time, fires the cannon then rests for a reload period and starts again.   Adds an interesting feature to the battleground!    I have also designed my own tank sound system which works pretty well.

Here's a video of the Panzerturm during dev....

https://www.youtube.com/watch?v=LaTYOzBSGUo

Drew.

*

Offline LukeZ

  • 106
    • View Profile
Re: Standalone Tank IR
« Reply #3 on: May 25, 2017, 10:36:52 AM »
I've always known there were others working on Arduino tank projects, it's been nice to meet several of you recently. That's a good idea for your autonomous Panzerturm. A similar functionality could be added to the TankIR sketch, it is already set up to control up to 4 servos, right now only a single one is being used for the recoil. One of the others could be set to turret rotation and then as you did code it to turn and fire randomly. If you or anyone else would like to add these or other features don't hesitate to submit a pull request to the GitHub project.

I'm sure many people would be even more interested in your sound project. If you want to share more details about that feel free to start a thread in the Sound Forum.