Page 2 of 7
Re: How to build a working IR Artillery Gun
Posted: Thu Jun 01, 2017 8:22 pm
by silversurfer1947
Sorry, I probably did not explain it well. If you are not a member of rctankregiment (like me) you can not get access to the forum. If I click your link, all it does it take me to the sign in page. I was not referring to your membership of either forum.
Re: How to build a working IR Artillery Gun
Posted: Thu Jun 01, 2017 8:22 pm
by wibblywobbly
The IR set up is remarkably easy. Getting over the fear of blowing something up is the hard part.
A light sensor is also on my to-do list. The sensor is a light activated on/off switch, so with the right code added to the 'Firecannon' code and replacing the switch on A0 it should be 'fairly' easy to figure out. I wish we had a few Arduino guru's on here as they could probably do these things standing on their head. It would be a far better way of activating the gun.
One thing I did find was that the Uno was heavier on a cheap Nimh than I expected. It didn't last 6 hours, the IR stopped working but the sensors were ok.
I did buy a Mega 2560 board to do the full Monty tank, but I don't have a bang up to date tx, and don't really fancy spending out on a new one just to play with the system. The board that I received was faulty so that went back for a refund anyway...

Re: How to build a working IR Artillery Gun
Posted: Thu Jun 01, 2017 8:47 pm
by T.Watson
silversurfer1947 wrote:Sorry, I probably did not explain it well. If you are not a member of rctankregiment (like me) you can not get access to the forum. If I click your link, all it does it take me to the sign in page. I was not referring to your membership of either forum.
My apologies for this - I am not totally sure what you mean??
Re: How to build a working IR Artillery Gun
Posted: Thu Jun 01, 2017 8:48 pm
by T.Watson
T.Watson wrote:silversurfer1947 wrote:Sorry, I probably did not explain it well. If you are not a member of rctankregiment (like me) you can not get access to the forum. If I click your link, all it does it take me to the sign in page. I was not referring to your membership of either forum.
My apologies for this - I am not totally sure what you mean??
Re: How to build a working IR Artillery Gun
Posted: Thu Jun 01, 2017 8:49 pm
by wibblywobbly
We can't see the page on the link as only forum members are allowed to see that part of the forum.
Re: How to build a working IR Artillery Gun
Posted: Thu Jun 01, 2017 8:53 pm
by T.Watson
wibblywobbly wrote:The IR set up is remarkably easy. Getting over the fear of blowing something up is the hard part.
A light sensor is also on my to-do list. The sensor is a light activated on/off switch, so with the right code added to the 'Firecannon' code and replacing the switch on A0 it should be 'fairly' easy to figure out. I wish we had a few Arduino guru's on here as they could probably do these things standing on their head. It would be a far better way of activating the gun.
One thing I did find was that the Uno was heavier on a cheap Nimh than I expected. It didn't last 6 hours, the IR stopped working but the sensors were ok.
I did buy a Mega 2560 board to do the full Monty tank, but I don't have a bang up to date tx, and don't really fancy spending out on a new one just to play with the system. The board that I received was faulty so that went back for a refund anyway...

No worries
You have been a great help - I am going to buy a soundboard and go from there - I will post a follow up
I think with the right programming someone with the right know how could make a killing using these boards - hmmm ELMOD comes to mind.....
Re: How to build a working IR Artillery Gun
Posted: Thu Jun 01, 2017 8:56 pm
by T.Watson
So far I have spent £37 on this project incase that includes the order for the soundboard which includes a speaker
Re: How to build a working IR Artillery Gun
Posted: Thu Aug 10, 2017 8:22 pm
by wibblywobbly
Total cost so far, roughly:
Arduino Uno £5.00
Switch £1.00
Emitter £1.00
4 sensors £1.50
Phono plug £0.50
I have just hooked a up an SD card £1.50 and can play a gunfire sound, but without an amp it is very quiet. I hooked up a £0.20 amp and although it is louder, I am getting interference from somewhere...and have yet to find the source.
The artillery gun fires IR off a pressure pad, and takes hits via the sensors, and flashes a hit led as well, so once I have the sound sorted out it will be a 100% working unit.
Once I have done that I can buy a sound detection or PIR movement sensor to replace the pressure switch.
Re: How to build a working IR Artillery Gun
Posted: Mon Aug 14, 2017 8:10 pm
by T.Watson
Well I have moved things on a little bit with the electronics finally!
Here is a short video of the gun sound. The sound file is a 16bit wav file and is stored on a 2mb flash memory on the Adafruit FX card. The FX card is connected to an 3.7w class D amplifier, the speaker is 8ohms and has a 15w output.
At the moment the sound is triggered via my mac using the serial monitor in the IDE software
Aside I will probably use a different speaker with the actual model.
https://youtu.be/G3ca6E47AWU
The next stage is get it to work with the Tank IR code - any thoughts as to how I can do this please?
I am also investigating how to get this whole thing to be active by either a PIR or Ultrssonic sensor to trigger an antitank gun (Thats the aim of this project

)
T
Re: How to build a working IR Artillery Gun
Posted: Mon Aug 14, 2017 9:20 pm
by wibblywobbly
I have been trying to eradicate the horrendous interference, like an out of tune radio, on mine. It is silent, I press the reset button, it plays the gun sound, and then squeals away like a piglet.
If I take the SD card out it carries on squealing, it seems to be a problem with the TMRpcm library, which carries on generating a tone after the track has played. There is a way to stop it by adding
audio.disable();
but as to where I add it, I haven't got a clue, I assume the line is added after
sample.play("gun.wav");
, but then I need to declare
audio
. I will have a go at this when I have the chance.
#include <SD.h>
#include <pcmRF.h>
#include <TMRpcm.h>
#include <pcmConfig.h>
// set the speaker pin
sample.speakerPin = 9;
// see if the card is ok
if (SD.begin(SD_CARD))
{
return; // It's not there, don't do anything
}
// quite loud
sample.volume(9);
// play the start up sound
sample.play("gun.wav");
Are you using an Adafruit sketch, or web sourced one? As for getting it working with the Standalone TankIR sketch, it will need to be triggered when the cannon is fired, so presumably calling this routine from a line of code immediately after it, or, included in the cannonfire code. This is all new stuff for me, so will have to solve things one step at a time.
The TankIR part of this, which Luke created, works flawlessly, my artillery gun was taking shots at any tank that ran over the pressure pad, and would take hits, complete with flashing led's. The cheap 7.2v Nimh battery lasted for a few hours too.