Arduino Uno IR Battle System

This forum relates to the Open Source Tank Control Board (TCB). Please read the sticky and visit the main site to find out all about the board and how to install it.
Post Reply
User avatar
wibblywobbly
Major
Posts: 6398
Joined: Fri Oct 17, 2008 9:30 am
Location: South Wales Valley
Contact:

Arduino Uno IR Battle System

Post by wibblywobbly »

As a little side project I am going to see if I can build an inexpensive Tamiya compatible battle system that will plug into an RX18.

In theory, and it is only a theory at this moment in time, I can do this using an Arduino Uno board, some IR code to transmit and receive the signals, and a few components consisting of a couple of resistors and a transistor, and of course, an IR led, and the sensors.

The Tamiya IR code can be obtained using the Uno, as I should be able to load in some code from the online library, fire a tank at a sensor, and have the code appear on screen.
This code is then written into the programming so that the battle system knows what to detect.
It's standard 38khz frequency, but within that the pattern of the signal needs to be known.

I already know that a Maplins YH70M emitter will provide the correct 940nm IR beam.
I already know that TSOP4838 sensors will detect the 940nm IR signal.

The Arduino has a limitation on the power that it can put through an led. 5v volts is the absolute maximum.
The led is 5v.
To get around this a small pcb will be required that controls the current, and that will allow the emitter to operate at full power, thus allowing full range, otherwise it will be around 10ft, rather than 30m. This may explain why the HL IR has such a short range.

I am intending to have the Arduino powered from the 7.2v tank battery.
The board will be connected to the RX18 IR socket.
When a pulse is detected on the HL circuit, the Arduino will fire the emitter.

The sensors will be wired into the Arduino.
When a hit is detected it will flash an led.

The theory is that using one of the T90 RX18's which have better sounds, I will get the gun fire sound when the gun is fired, a muzzle flash is easily done, and the IR will fire as well.

What may be possible, and it's all pie in the sky at the moment, is to plumb the power supply to the RX18 through the board, and incorporate voltage reduction with each hit. I can't at the moment see an easy way to set light/medium/heavy tank hit counts without a USB hookup to a pc, but it should be possible to set them when the programming code is loaded, which takes seconds to do.

Hit sounds may also be possible if I can find a cheap enough soundboard.

This will all be done as and when time allows, and my objective is to use the RX18 which comes in every tank, and see if a battle system can be designed that anyone can put together and plug in.

http://www.ebay.co.uk/itm/UNO-R3-ATmega ... Compatible

http://cdn.sparkfun.com/datasheets/Kits/PowerIR-v11.pdf

Code: Select all

/*
Automatically Generated by AnalysIR - Batch Export Utility
Registered to: xxxxxxxx
Session History
Type : Key : Value : Bits
0 : RAW :  :  : 0
*/

// NB: Not all protocols are supported by IRremote or IRLib. You may need to edit the code below manually
// Automatically Generated by AnalysIR for xxxxxxxx, visit http://www.AnalysIR.com or email info@....... for further details
int khz=38; //NB Change this default value as neccessary to the correct modulation frequency

unsigned int Signal_0_0[] = {3100,2800,5950}; //AnalysIR Batch Export - RAW

My_Sender.IRsendRaw::send(Signal_0_0, sizeof(Signal_0_0)/sizeof(int), khz); //AnalysIR Batch Export - RAW
// AnalysIR IR Protocol: RAW, Key:  
Await the magic smoke.... :wtf:
Tiger 1 Late
Panther G
King Tiger
M36 B1
RobW
Warrant Officer 2nd Class
Posts: 1163
Joined: Mon Sep 29, 2014 2:55 pm
Location: Sheffield

Re: Arduino Uno IR Battle System

Post by RobW »

Don't worry, I've found the smoke replacement kit; you'll be fine. You just need to check the part number to make sure it's the correct grade.

Image
User avatar
wibblywobbly
Major
Posts: 6398
Joined: Fri Oct 17, 2008 9:30 am
Location: South Wales Valley
Contact:

Re: Arduino Uno IR Battle System

Post by wibblywobbly »

:haha: :haha: :haha: ....I buy mine in bulk.

The Arduino Uno is on its way, and to save myself building dodgy circuits I have ordered two pre made pcb's, one for the emitter and one for the sensors.

I will just have to figure out how to get it working using the Arduino coding...which doesn't seem wildly difficult, but if there are any Arduino chappies on here all input is appreciated.
Tiger 1 Late
Panther G
King Tiger
M36 B1
User avatar
silversurfer1947
Lieutenant
Posts: 3338
Joined: Tue Oct 27, 2015 9:54 pm
Location: Bristol, UK

Re: Arduino Uno IR Battle System

Post by silversurfer1947 »

Not sure I have understood much of this, but it sounds very interesting. I assume the Arduino Uno is some form of programmable control board and that, if successful, it would be a comparatively cheaper and easier way of turning a Heng Long BB firer into a combat IR tank. Would it work for Taigen and Torro tanks as well?
Richard
Tamiya Tiger 1, Taigen FlakPanzer IV,Torro M16 half-track, Tamiya Panther,WSN/Torro T34,Taigen M41 Bulldog,H/l/Taigen Sherman M4A3,H/L T90, Haya M3 Grant, Metal Origins 234/2 Puma, Nashorn by Alwyn. I was only going to have one tank - honest! :D
User avatar
Rad_Schuhart
Warrant Officer 1st Class
Posts: 1979
Joined: Tue Jan 19, 2016 9:22 am
Location: Spanish living in Graz, Austria. Heart in UK.
Contact:

Re: Arduino Uno IR Battle System

Post by Rad_Schuhart »

It would be amazing if you manage to make a small unit independent of the rx18. We could use it in flaks, panzerfaust, etc etc.
My RC tanks website, loads of free info for everybody:
https://radindustries.wordpress.com/
User avatar
wibblywobbly
Major
Posts: 6398
Joined: Fri Oct 17, 2008 9:30 am
Location: South Wales Valley
Contact:

Re: Arduino Uno IR Battle System

Post by wibblywobbly »

Yup, the Uno is a programmable board, it is a smaller version of the board that is used drive most 3D printers. They can be configured to do all sorts of things, there is an entire industry based around them. They have multiple inputs and outputs, and can be powered from a USB, a mains adaptor or anything up to a 12v battery pack. The uses to which they are put is quite incredible, you can buy all sorts of ready made boards to plug into them.

The complicated part is writing the code, the code itself will take a bit of understanding, not because it is complex in itself, but because I'll be writing code that controls electronics, and for that I will need to understand what those components do, how they affect a circuit, and which readings to take and act upon.

If it works, it should function with any tank that shoves a 5v pulse to the IR pin, as this will kick the IR emitter into action. I will just program it to scan the pin, if detects 5v then it sends a 1000ms burst to the emitter led. As long as I get the code right, and it has to be a minimum of 3 repeats of the code in the burst, it should hit a sensor and register a hit.

When it registers a hit the sensor opens a circuit back to the board, and when the board gets that signal, it lights up the hit led's, and if possible reduces the motor voltage. When the voltage drops to a predefined level, say 6v, it cuts the power completely and the tank is dead.

This may all sound very simple, but it's not.... :wtf:

I only decided to try and do this because the new RX18's have decent sound, which makes having proper IR on a tank with one a cheap way of getting into IR battling. My guess is that HL shot themselves in the foot with IR as they haven't got the components on the board to properly power an emitter, hence why an external board is the only way to go.
Tiger 1 Late
Panther G
King Tiger
M36 B1
User avatar
wibblywobbly
Major
Posts: 6398
Joined: Fri Oct 17, 2008 9:30 am
Location: South Wales Valley
Contact:

Re: Arduino Uno IR Battle System

Post by wibblywobbly »

Rad_Schuhart wrote:It would be amazing if you manage to make a small unit independent of the rx18. We could use it in flaks, panzerfaust, etc etc.
We already have one of those in the club, they are available from Oz, and work very well, complete with sound effects.
Tiger 1 Late
Panther G
King Tiger
M36 B1
RobW
Warrant Officer 2nd Class
Posts: 1163
Joined: Mon Sep 29, 2014 2:55 pm
Location: Sheffield

Re: Arduino Uno IR Battle System

Post by RobW »

Slightly more seriously! Sounds like an interesting project. Roughly how much would the system cost, and what sort of space is needed?
User avatar
wibblywobbly
Major
Posts: 6398
Joined: Fri Oct 17, 2008 9:30 am
Location: South Wales Valley
Contact:

Re: Arduino Uno IR Battle System

Post by wibblywobbly »

Forgot I had this demo of our Panzerfaust unit. Richard has since modelled a decent set up for it.

phpBB [video]


The Uno is very small and flat, plenty of room in a tank with an RX18. The dimensions are on the web, though it will get taller if you plug various modules into it.

At the end of the day, if this doesn't work I can use the board for other things.
Tiger 1 Late
Panther G
King Tiger
M36 B1
User avatar
Rad_Schuhart
Warrant Officer 1st Class
Posts: 1979
Joined: Tue Jan 19, 2016 9:22 am
Location: Spanish living in Graz, Austria. Heart in UK.
Contact:

Re: Arduino Uno IR Battle System

Post by Rad_Schuhart »

wibblywobbly wrote:Forgot I had this demo of our Panzerfaust unit. Richard has since modelled a decent set up for it.

phpBB [video]


The Uno is very small and flat, plenty of room in a tank with an RX18. The dimensions are on the web, though it will get taller if you plug various modules into it.

At the end of the day, if this doesn't work I can use the board for other things.
If I remember correctly this unit was made by RCTA, and it worked alone, shotting automatically. But im afraid is no longer produced...

What would be great is to make a small unit that lets us choose what and when to shoot. Machine gun, flak 88 etc, and for moving it would be enough with servos.
My RC tanks website, loads of free info for everybody:
https://radindustries.wordpress.com/
Post Reply

Return to “Open Panzer Tank Control Board”