TankIR - Arduino Nano and TBS

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
IdefixRC
Recruit
Posts: 6
Joined: Tue Aug 31, 2021 2:23 pm

TankIR - Arduino Nano and TBS

Post by IdefixRC »

Hello everyone,

I'm in the process of building a Tamiya Gepard. As I'm going for a wireless connection between hull and turret and as the control board does not (yet) support the Tamiya Battle system, I installed an arduino nano with the TankIR sketch.

Loaded the sketch using the instructions (downgraded the driver) and can see it comes up nicely in the serial monitor.
Connected the apple to 5V, common gnd and the D5 and D2 pins. When I bridge D5 with 5V the apple LEDs light up.
Installed the transistor and IR and tested it by bridging D4 to GND. I can see the IR LED fire when I view it through the phone camera and the serial monitor indicates fire cannon correctly. So it overall looks like it works, however when I point the IR emitter at the apple and fire I get no hit indication. neither does the apple LED come on at any other time (when powered up for example).

I'm a bit at a loss on how to troubleshoot this without another working TBS setup (unless TankIR ignores the own IR signal somehow?) and test whether I have an issue with the Arduino/TankIR or the able is faulty.

Will be grateful for any tips.
Thanks !!
971wright
2nd Lieutenant
Posts: 2733
Joined: Tue Jul 22, 2008 8:16 pm
Location: nelson Lancashire

Re: TankIR - Arduino Nano and TBS

Post by 971wright »

Hi when it is transmitting a signal it cannot receive a signal. This is how it dosnt shoot its self, without another unit to test against it is hard to know if you have it correct, you can test the emitter by looking through a digital camera you should see a blue light from the emitter(whether the code is right is another thing) Tamiya code is different to heng long code.

regards pete
User avatar
LukeZ
Lance Corporal
Posts: 177
Joined: Sat Apr 17, 2010 8:03 pm
Contact:

Re: TankIR - Arduino Nano and TBS

Post by LukeZ »

Hi Eric, it sounds like you have everything set up correctly and have confirmed as much as you can with a single unit. You guessed the "problem," and Pete is right, the circuit ignores its own shots in order not to shoot itself. :)

So to really complete your tests you will need a second Nano IR setup or another brand of tank.
NO SUPPORT THROUGH PM - read why
User avatar
IdefixRC
Recruit
Posts: 6
Joined: Tue Aug 31, 2021 2:23 pm

Re: TankIR - Arduino Nano and TBS

Post by IdefixRC »

Ahhhhhhh awesome. Thanks for that :-) Spend a few hours trying to get it to shoot itself Lol !!!
I will test with another unit in that case (LED's ordered and on the way :-) !)

Thanks all !
User avatar
IdefixRC
Recruit
Posts: 6
Joined: Tue Aug 31, 2021 2:23 pm

Re: TankIR - Arduino Nano and TBS

Post by IdefixRC »

Hi guys,

Update: I built a 2nd TankIR to shot at my own tank.
Works fine and hits register on the apple now.

I could use some ideas for the trigger though.
I'm using a turret controller in the Gepard Turret which controls the muzzle flash LEDs. In essence, it switches the battery voltage to ground when triggered very rapidly to flash the LEDs.
I used a diode (BAT42 or 47) in an open direction between arduino and the ground wire to switch to gnd in order to tell the arduino to fire. This works great with no muzzle LEDs connected (just switches gnd) but with LEDs connected requires many repeat shots to actually trigger. Checking the voltage on the wire the switching to gnd is very rapid and probably not distinct enough for the arduino to recognize.

Any ideas on how I can get the arduino to recognize the trigger better?

Thanks,
Eric
User avatar
LukeZ
Lance Corporal
Posts: 177
Joined: Sat Apr 17, 2010 8:03 pm
Contact:

Re: TankIR - Arduino Nano and TBS

Post by LukeZ »

I agree the variable input is probably confusing something, though it's strange it works without the LEDs attached. However it would certainly be better to give the Arduino a clean signal. I wonder what signal is triggering your turret controller? That might be a better source to tap into if possible.
NO SUPPORT THROUGH PM - read why
User avatar
IdefixRC
Recruit
Posts: 6
Joined: Tue Aug 31, 2021 2:23 pm

Re: TankIR - Arduino Nano and TBS

Post by IdefixRC »

The turret controller connects to the main MFU via an IR scale bus so I cannot tap into that directly. Sadly there is no other signal output I can use on the turret controller.

The reason why it works without the non ir gun barrel led is that there is a clear signal to gnd when they are removed, with LEDs installed the line at at 8v and pulled down only for a split second when the leds are fired. I assume that there is a capacitive "lag" of sorts which prevents the arduino pin from dropping to GND fully.

I tried to use a capacitor between gnd and signal pin on the arduino to see if I can improve the signal but without success.

Update: strangely enough I had one instance now in which the IR led fired very consistently each time I triggered them after powering the system up..... Hmmm.....
User avatar
LukeZ
Lance Corporal
Posts: 177
Joined: Sat Apr 17, 2010 8:03 pm
Contact:

Re: TankIR - Arduino Nano and TBS

Post by LukeZ »

Well it sounds like the signal is a bit unpredictable, or else possibly a scope would be needed to characterize it more fully. I'm also not sure that 8 volts on the Arduino input is necessarily ideal, but maybe you have accounted for that somehow with your diode.

Since it seems to work well when you don't have the muzzle flash LEDs connected, maybe the most logical thing to do is have the IR Arduino control the muzzle flash. The circuit has a provision already for connecting a Taigen flash unit, see the schematic. They are cheap to buy and would be easy to hook up to this circuit.
NO SUPPORT THROUGH PM - read why
Post Reply

Return to “Open Panzer Tank Control Board”