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.
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 »

For those following this, we did a range test on the IR at yesterdays club meet. The set-up will send and recieve hits at over 30ft, we ran out of space in the hall, so for all intents and purposes it is perfect for IR tank battles.
Tiger 1 Late
Panther G
King Tiger
M36 B1
User avatar
LukeZ
Lance Corporal
Posts: 178
Joined: Sat Apr 17, 2010 8:03 pm
Contact:

Re: Arduino Uno IR Battle System

Post by LukeZ »

wibblywobbly wrote:Just for reference, this is what appears when I upload the sketch to the Uno.
Those are interesting, but we can ignore them. It appears optimizations are not enabled in your IDE, and who knows what other unusual things there may be in a Linux build. Just to cover my own behind, I should say I only support Windows! But even so those are just warnings and your code appears to compile just fine, so I think we're ok.
wibblywobbly wrote:For what its worth, and don't shoot me for saying it, lol, I can use the RX18 +/- pins to power an led. As an led will only light up if the anode and cathode are the correct way around, is this an indication that the RX18 positive is positive, and the RX18 negative is negative?
Yes that is correct, those are the positive and negative voltage sources for the Heng Long IR emitter. However only one side is "switched" (rapidly - to create the IR signal). The other side will be held steady. I don't know which side Heng Long chose to switch, the high or the low. Obviously if we connect the side that is held steady to the Arduino, nothing will be detected. The Arduino needs to read the switching side, and the other connection is superfluous. If we were driving an LED then yes, you have to connect both the positive and negative to he IR emitter for the circuit to be complete.

If you haven't already, you may want to repeat the latest round of tests with an Airsoft unit connected to the RX-18, and make sure the airsoft cycles when you fire the cannon. This way we know the RX-18 is getting the airsoft trigger switch signal, which it may be waiting for to fire the IR (I don't know, but just guessing).

Otherwise I really think for me to troubleshoot this further I would need an RX-18 to work with in person so I can see exactly what is going on. To be completely honest this would have to fall rather low on my priority list as my time is pretty much taken up completely with other Open Panzer commitments right now...
NO SUPPORT THROUGH PM - read why
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 »

Thanks for the explanation, I can see where you are coming from now.

I fully appreciate that you have things to do that have a higher priority. I'll take a look at the airsoft when I get the chance. All of the other tests were successful, so I know that we have a perfectly functioning IR, recoil servo, muzzle flash, and working sensors. Even if I don't get the RX18 hookup working, the system, especially with a Nano board will make an excellent unit for standalone artillery guns, which is what I am currently working on.

Thanks for your assistance with this, it was worth a try. :thumbup:
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 »

After a bit of fiddling about, I got this working from the RX18.

Rightly or wrongly I removed the voltage divider, so its one wire straight from RX18 IR+ to A0 on the Arduino.
The RX18 IR- is not used.
The Arduino sketch includes the latest updates referred to above.

I have a standard led plugged into the emitter output so I can see whether it illuminates without needing a camera.

Using the RX18 tx I can fire the gun, the emitter circuit is live, the led flashes, and the recoil works.

I am awaiting delivery of some pin strips, heatshrink and some more servo's, so that I can create soldered joints and tidy up the wiring. Once the sensors are hooked up it will be a bit of rats nest of wiring, and I need to make sure that they are all secure.

The only issue that I have is that for no apparent reason, continued use corrupts the servo, Hextronic HXT900. At the last meet I was testing the IR range using the manual momentary button, the IR and the servo worked throughout the test. Tried it during today's faffing about, and although it initialises, and moves back when fired, it doesn't return forwards on the recoil. Tried the same servo on a Clark board and it still did it. Tried another new servo on the Arduino and it works perfectly?

There could be all sorts of reasons why it is doing this, but testing will continue. It could be loose wires shorting the servo, bad contacts, battery power etc. It is possible to power a servo from a 6v battery pack and just take the signal externally.

For anyone contemplating this, or just wants to mess around with an Arduino this is how it is all hooked up:

RX18:
IR+>A0

Using a prebuilt IR emitter board:
SIG>D3
GND>GND
VCC>VIN

Sensors:
SIG/OUT>D2
GND>GND
VCC/VS>5v

If using a TSOP 4838, with the dome facing you:
SIG GND VCC

Servo:
SIG>D8
GND>GND
5v>5v


If using a microswitch to activate the fire sequence:

An old binding button off an HL tx will do.
One wire to D4
One wire to GND

You may find that you run out of GND pins on the board. Multiple GND's can go to the same pin. The Uno has two on one side and one on the other. Once I have a neat installation I will post up some step by step pics on how and where everything goes.

Cost to convert HL to Tamiya compatible IR:

Arduino Uno. £5-£10.
IR emitter plug in board. £3.
4 TSOP 4838 IR sensors. £2
1 YH70M IR emitter. £1

If you use one of the new Heng Long RX18's with the decent sounds, you will have a half decent tank for very little money. Certainly a good way to get into IR battling on the cheap, if you don't want to spend lots of money on a the fancy systems.

The Arduino system is programmable via a USB. All of the usual battle settings can be set, plus servo reverse, recoil distance and speed etc, repair tank mode, reload times, no of hits etc...which is more than Tamiya offer?

The unit can be used either in a tank, or an artillery gun, and of course when used in a gun emplacement it can take hits and be put out of action. Firing can be via an RX18 plus tx, or via a microswitch/landmine arrangement.
Tiger 1 Late
Panther G
King Tiger
M36 B1
User avatar
Saracen
Lance Corporal
Posts: 200
Joined: Mon Dec 29, 2008 8:51 am

Re: Arduino Uno IR Battle System

Post by Saracen »

> The only issue that I have is that for no apparent reason, continued use corrupts the servo, Hextronic HXT900

Have you tried limiting the range of movement for the servo ? When I was designing a 1/6th recoil system, I found I could lock out a servo by asking it to go beyond its comfort zone.
Powering it off and moving the arm back usually reset it OK, and I don't remember killing any, but your ones may be more sensitive to over rotation.

Have you thought about using the Arduino Pro Mini ? Pin and code compatible with the Uno but just the size of your thumb, rather than your palm :thumbup:

Adrian.
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 »

The servo isn't operating an arm, the recoil is a gear wheel operating a toothed bar, a linear actuator of sorts. I was thinking the same thing about the operating range though, and will try reducing the span in the programming to see if that does the trick. It will have to wait until I get the bits I have ordered as this will be the final assembly with solid plugs, soldered joints etc. I now know that it works, which is a milestone. I do need to plumb in an led flash rather than an HL one.

I used the Uno as it was larger and easier to play around with, it's an Open Source project so as long as a board with a compatible chip is used, anyone can use whatever suits them. The advantage for me was being able to run a jack plug from the tank switch and power the board with easy removal.
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 »

Bingo! Perseverance pays off. :D

I at long last received the voltage regulators in the post today.
IMG_20170508_134102.jpg
IMG_20170508_134102.jpg (71.82 KiB) Viewed 6550 times
IMG_20170508_134053.jpg
IMG_20170508_134053.jpg (70.37 KiB) Viewed 6550 times
I needed one to use the airsoft circuit to trigger a pulse to the Arduino board. The RX18 pushes 7v on pins 2 & 5 (new T90 board, I haven't checked the old RX18's yet).
The Arduino can only take 5v max.

I hooked up the VR to pins 2 & 5, and then attached a multimeter. Sure enough it was 7v when I fired the gun. The VR has an adjuster on it, so I just kept firing the gun, and adjusting the voltage until the maximum readout was under 5v, 4.8v in my case.

I then hooked up pin 2 (+) to pin AO on the Arduino. Fired the gun and nothing.
I then hooked up pin 5 (-) to GND on the Arduino. Fired the gun, and praise be, the IR flashed.

No resistors, they aren't needed as the input voltage is controlled by the VR. Though in theory I could now (and I will try it) replace the VR with a 10k resistor.

So, although I couldn't get the signal to trigger the Arduino using the RX18 IR pins, I can do it using the Airsoft pins on the 8 pin plug.
I already know that the IR sensors work, and that the hit led's work, so that will be ok.
The only think left to check is the recoil servo. I received a bag of six cheap ones from China yesterday.
I am still awaiting a bag of amplifiers from China.

On the face of it this set up will now work, an HL tank can be converted to Tamiya/Clark/IBU/Elmod IR battle standard for a pittance, and add a servo recoil.

Total cost, here are some example prices, the downside of the supercheap Chinese boards is the delivery delay, which is 2-3 weeks. I still haven't received the amplifiers.

Arduino Uno
http://www.ebay.co.uk/itm/162172118256? ... EBIDX%3AIT

Amplifier:
http://www.ebay.co.uk/itm/192010440914? ... EBIDX%3AIT

Emitter:
http://www.ebay.co.uk/itm/152310171428? ... EBIDX%3AIT

Voltage Regulator:
http://www.ebay.co.uk/itm/DC-DC-Buck-Co ... SwMgdXyjJS
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 »

Those prices are ridiculous.
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
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 »

:D Just shows how cheap components really are? They are still making a profit....??
Tiger 1 Late
Panther G
King Tiger
M36 B1
User avatar
LukeZ
Lance Corporal
Posts: 178
Joined: Sat Apr 17, 2010 8:03 pm
Contact:

Re: Arduino Uno IR Battle System

Post by LukeZ »

Good work Wibbly, the airsoft pin is no doubt the better approach. Now you know it works you can create a simple voltage divider using 2 resistors which would be much simpler and cheaper than a voltage regulator. See the photo below, using a 4.7k and 10k resistor will work so long as you stick with NiMH batteries, and those are very common resistor values.
wibblywobbly wrote:On the face of it this set up will now work, an HL tank can be converted to Tamiya/Clark/IBU/Elmod IR battle standard for a pittance, and add a servo recoil.
It should be said for anyone following along that you probably still couldn't participate in battles against Tamiya tanks because this setup does nothing for speed reduction, therefore your HL would have an unfair advantage.

But anyway it's a fun project for those that like to tinker and experiment. It's always interesting to me the wide variety of hobbyists we have. When I announced the TCB over at RCU there were complaints left and right that it was going to be too complicated and no one would be able to figure it out. I allow it's not an entry-level concept but at the same time it has to be a step up from using a TV remote for programming, which people have been doing now for years. Here on the other hand we have someone like yourself who cobbles together a franken-project with wires, soldering, custom programming and components from all across the globe just to get Tamiya IR in a Heng-Long!

It goes to show, no matter the level there will always be someone interested.



.
Attachments
VoltageDivider.png
VoltageDivider.png (60.55 KiB) Viewed 6539 times
NO SUPPORT THROUGH PM - read why
Post Reply

Return to “Open Panzer Tank Control Board”