Team Fortress 2 Mini Sentry

Thread Starter

Blargenth

Joined Apr 30, 2015
45
I was hoping @bertz would provide further assistance, but I assume he's otherwise disposed. I'm a bit busy myself, but I'll try to help. Can you list out everything you currently have and, where possible, include links to the products you've purchased?

What did you decide on for a remote control? Hobby, IR, other form of wireless? Of has this been decided yet?
Finally! I thought I'd never get help with this, and its been doubly stressful cause I'm running out of time. Anyways...

Here's what I have so far.
  • PICAXE-18 Standard Project Board
  • PICAXE-18M2 microcontroller
  • AXE027 PICAXE USB Download Cable
  • IC 2262/2272 4 CH Key Wireless Remote Control 315MHZ Receiver module F Arduino
What I still need to get
  • Battery pack
  • Output speaker
  • Bright LED
I found a manual online for the Picaxe standard project board but I have no idea how to wire it to the wireless arduino, I haven't tried to download a programming application for the microcontroller/project board and I have a concern that this board can't handle a sound output other then a buzzer
 

elec_mech

Joined Nov 12, 2008
1,500
Okay, the remote is easy. I have several and they're a cinch to hook up. I'll need a couple of days to get a schematic together though.

What sound are you looking for? A simple sound that can be generated from a piezo buzzer (these can play MIDI tunes by the way) or something pre-recorded like a sound file (MP3 or similar)?

How loud does it need to be? You can increase the sound level of a piezo by supplying it with a higher voltage. Otherwise you'll need a player with an amplifier built in or add an amplifier to whatever is producing the sound.

How big will this be? Will you be able to get a lot of batteries into it? Related - how long, terms of hours, do you want the batteries to last before they need to be replaced? 1 hour? 10 hours?

What do you plan to use to spin the turret? The simplest would be with a standard servo. The PICAXE only needs one pin to control a servo.

How do you envision the operation of the remote? As an example:

Button A: Turn turret clockwise
Button B: Turn turret counterclockwise
Button C: Make noise
Button D: Go to sentry mode

We can set the program to go into sentry mode automatically if no buttons are pressed after x seconds/minutes.
 

Thread Starter

Blargenth

Joined Apr 30, 2015
45
Seriously man thank you for this help.

Ok lets see, first the sounds. Mostly the noises I want to make are different types of beeps and a chirp style beep. But the most complicated sound it would have to make is the sound if it firing bullets.

Second I want it to be loud enough to be heard in a convention hall... which may be noisy.

I haven't built the sentry yet because its going to be built around the circuitry, but I will have plenty of room to put in as big of a battery box as I need

I think I have a standard servo... I salvaged it out of the RC car I had originally planned to use.

I actually envision it being just 3 of the buttons, the first three like you said with the make noise being it lighting up an led and making shooty sounds, and the 4th I had figured could be a reset button so if it bugs it'll go straight back into idle mode
 

elec_mech

Joined Nov 12, 2008
1,500
Okay, take a look at this video. It uses a cheap sound effects keychain that has eight artillery sounds. If you keep the speaker exposed (you can drill grill holes in your housing), it is reasonably loud. Not bullhorn loud mind you, but enough to grab attention of people nearby. I won't say this is best possible solution, but it is simple, inexpensive, and easy to implement. I bought a bunch of these from eBay and added wires to arcade buttons for a different project and it worked great. We'd need to add an optoisolator or transistor since these work off 3V. Alternately, we could power the PICAXE with 3V and just use a transistor for the servo (or simply a separate battery pack).

You can purchase this keychain from Amazon here. The reviews are piss poor because it is a cheap toy, but we'll be replacing the buttons, so I don't think you'll have a problem.

Alternately, you could use an MP3 or similar player. I've used these with success, but they cost more and you need to find and load the sounds you want.
 

Thread Starter

Blargenth

Joined Apr 30, 2015
45
Not the sound effects I was going for, I think I may have to go the mp3 player route. I have some old ones here and there unless I need a specific one to wire it up to the circuit board...
 

elec_mech

Joined Nov 12, 2008
1,500
The second option would be better then. You can convert an MP3 or WAV file into the appropriate format and load it onto the sound module. The one I linked to allows you to play four unique sounds if this is of interest. I've often found these on eBay (sold by the same company) for $15 USD or less including shipping. They come with a speaker unlike most MP3 players these days. The sound won't be incredibly loud, but you can play with the file settings beforehand to try to increase the loudness or you might get away by simply removing the speaker and hooking up to a pair of amplified speakers. Just a thought.

I've made MP3 players work, but you'll need to remove the case to get to the controls and solder tiny wires to the button traces on the PCB. Not impossible, but it requires a degree of finesse. If this is okay, take a look at this $3 MP3 player. It requires a microSD card and speakers. For $8, you can get the player and a card. This may work as a speaker, but note you'll need to add your own stereo headphone plug in order to plug into the MP3 player.

Between the two, I think the USB sound module would be the easiest to work with. It operates off of 4.5-5VDC, same as the PICAXE and the controls would be easy to wire up.
 

bertz

Joined Nov 11, 2013
327
Hi, I'm back.
Elec_Mech was spot on. During the summer I spend a lot of time at our camp on Lake Pymatuning. Consequently, I spend very little if any time on the computer. Came home today to see that this thread is revived and elec_mech has offered some good suggestions on sound which I am not going to hijack.

With that being said, I do have a number of comments. First, your power supply. I am going to suggest 4 D-cell batteries. Why? The main reason is that in order for your sounds to be heard above the din of an auditorium you need POWER. Using an 8 ohm speaker and a small amplifier you should be able to jinn up about 4 watts of power. Even this may not be enough if the background noise is too high. Also, when you order your speaker, make sure that it can handle this much power or it will distort so bad as to be useless.

Now 4 D-cells will give you a solid 6 volts which could well fry your Picaxe chip. You will need to solder in a 78L05 regulator as called for in the data sheet. By the way if you haven't read the data sheet, do so now! Then re-read it. There is a wealth of info there that we cant cram into these postings. If you send me a PM with the info, I can mail you a 78L05 as well as a male header.

Which leads me to my next topic. You will have to use the servo to rotate the turret because the Picaxe project board does not allow you to reverse the rotation of the motor. The data sheet is very vague about the servo connections, but if you study the schematic you will see that there are two servo outputs: Ports B.0 and B.7.
You can see these on the board because there are three holes next two each other spaced at 0.1". This is where you need to solder the 3-pin header so you can plug the servo directly into the board. Then in the software you can call out which Port you want to move the turret. I suggest making the C-ports inputs and the B-ports outputs.

In addition, you might want to buy some screw terminals to solder onto the board. This way you can connect and disconnect wires without having to fire up the soldering iron each time. I suggest you order at least half a dozen of these: Jameco P/N 189676.
 

bertz

Joined Nov 11, 2013
327
Ok lets see, first the sounds. Mostly the noises I want to make are different types of beeps and a chirp style beep. But the most complicated sound it would have to make is the sound if it firing bullets.
The 18M2 will generate the beeps. You can program to this automatically. When do you want it to "beep"? Use the "sound" command.
 
Last edited:

elec_mech

Joined Nov 12, 2008
1,500
Now 4 D-cells will give you a solid 6 volts which could well fry your Picaxe chip. You will need to solder in a 78L05 regulator as called for in the data sheet.
Doesn't a 78L05 need at least 7.5V to output 5VDC? Perhaps, if the 5V current draw is small enough, we could get away with a 4.7V or 5.1V Zener to save complexity?

You will have to use the servo to rotate the turret because the Picaxe project board does not allow you to reverse the rotation of the motor.
If using a servo, isn't the direction simply changed by changing the servo signal? Or are you referring to something else?

Use the "tune" command to simulate the staccato sound of a gun.
I suggested an external sound module because I couldn't find (quickly) any examples of using a piezo/speaker to generate artillery sounds from the PICAXE. I tried looking for MIDI examples as well without luck. Do you have some code that will do this or have you seen an example online?

Here is a cheap amplifier module. Problem is they come from China on a Slo-o-o-w boat.
http://www.ebay.com/itm/Power-Suppl...588?pt=LH_DefaultDomain_0&hash=item46357112f4
Nice.
 

bertz

Joined Nov 11, 2013
327
Doesn't a 78L05 need at least 7.5V to output 5VDC? Perhaps, if the 5V current draw is small enough, we could get away with a 4.7V or 5.1V Zener to save complexity?
Good catch! However, adding a zener makes things more complex because now he has to hack the project board, whereas the project board already has a provision for the 78L05. My suggestion then is to power the board with 3 D-cells. These will also power the servo. Then use a separate (6 to 12 volt supply) for the audio amp.
 

bertz

Joined Nov 11, 2013
327
If using a servo, isn't the direction simply changed by changing the servo signal? Or are you referring to something else?
I was referring to the fact that this project board does not have a L293D motor driver, so a DC motor is out. He will have to use the "pulsout" or "servo" command to change the servo direction.
 

bertz

Joined Nov 11, 2013
327
http://www.ebay.com/itm/TDA7297-DC-...405?pt=LH_DefaultDomain_0&hash=item486813868d
I suggested an external sound module because I couldn't find (quickly) any examples of using a piezo/speaker to generate artillery sounds from the PICAXE. I tried looking for MIDI examples as well without luck. Do you have some code that will do this or have you seen an example online?
Yeah, here is where it gets tricky. He could use the "tune" command to generate a series of notes to simulate a machine gun. But this involves a lot of trial and error. How about this for a Rube Goldberg solution:

1. Buy one of these recordable modules.
http://www.ebay.com/itm/Voice-Sound...941?pt=LH_DefaultDomain_0&hash=item1c4bbbacbd

2. Download the actual sound of a machine gun from this or a similar site:
http://soundbible.com/tags-machine-gun.html

3. Record the machine gun sound onto the module. There is a playback button on the module that the OP would have to hack into. Connect that to one of the output ports on the 18M2 so every time it goes high you get the sound of a machine gun firing.

4. Feed the output into an audio amp and speaker. Here is another little gem available stateside:
http://www.ebay.com/itm/TDA7297-DC-...405?pt=LH_DefaultDomain_0&hash=item486813868d
 

Thread Starter

Blargenth

Joined Apr 30, 2015
45
I'm gonna say that I'd rather go with the 200S USB MP3 for the sounds. It may not be that loud but considering how iconic the tf2 sentry sounds are it may be loud enough. Plus I already have access to the sentry sound clips through the game itself, I just need to edit them down to just their sounds minus the background noise, plus covert them to mp3 format to work.
 

bertz

Joined Nov 11, 2013
327
I'm gonna say that I'd rather go with the 200S USB MP3 for the sounds. It may not be that loud but considering how iconic the tf2 sentry sounds are it may be loud enough. Plus I already have access to the sentry sound clips through the game itself, I just need to edit them down to just their sounds minus the background noise, plus covert them to mp3 format to work.
I just looked up this little device. Very nice! And it will play back up to 5 different sound bites via push button which makes interfacing with the 18M2 and programming a snap.

However, if you do not feed the output of the MP3 to an amplifier and suitable speaker you will never hear it in an auditorium. I speak from experience.
 

bertz

Joined Nov 11, 2013
327
Wait I won't ever hear it with the amplifier?
Now you have me confused, to which amplifier are you referring?

My recommendation is to disconnect the tiny speaker from the MP3 and feed that signal into an amplifier module powered by a 12 volt source. Connect the output of the amplifier to a good 4 or 8 ohm speaker capable of handling at least 10 watts. Now you have an attention getter!

If you just try to use the tiny speaker that comes with the MP3 your output will be less than 0.4 watts and I'm afraid you'll be sadly disappointed after putting the effort into this project.
 
Top