Recent Posts

Pages: [1] 2 3 4 ... 10
1
Other Open Source Projects / Re: Standalone Tank IR
« Last post by LukeZ on November 16, 2017, 11:49:42 AM »
Wibbly, I already added support for the Adafruit sound effects board to the project (as discussed here), no coding required, just use the sketch from the GitHub. Read the instructions on that page for how to interface with the Adafruit board, you can see I've also updated the schematic. It supports 4 sounds, cannon fire, cannon hit, destroyed, and repair sound.
2
Other Open Source Projects / Re: Standalone Tank IR
« Last post by Wibbly on November 16, 2017, 12:50:53 AM »
I built a standalone artillery gun, all of the IR cannon and hit functionality works, the gun is triggered via a microswitch acting as a hidden landmine, so when a tank runs over it, the gun is fired from a short distance away. Tanks can fire at the installation, and the led's flash in the diorama.

So far so good.

The one thing missing is a cannon sound.

To create a test bed I used a separate Uno and downloaded this sketch:
http://www.instructables.com/id/Audio-Player-Using-Arduino-With-Micro-SD-Card/

Quote
*/

#include <SPI.h>       //Enable use of SD library
#include <SD.h>        //Read MicroSD card
#include <TMRpcm.h>    //Play music from MicroSD card


//This value is assumed by the TMRpcm library, so I don't recommend altering it!
const int SD_ChipSelectPin = 4;

//Plug the speaker's red (non-GND) wire into this pin on the Arduino
//TMRpcm assumes this is 9 on Arduino, so I don't recommend altering it!
const int speakerP = 9;

//File name of the WAV audio file loaded on the MicroSD card
//Remember to include the file extension (should be .WAV)
const String audioFileTitle = "music.wav";

//Create TMRpcm object
TMRpcm tmrpcm;

void setup(){

  tmrpcm.speakerPin = speakerP;

  Serial.begin(9600);
  if (!SD.begin(SD_ChipSelectPin)) {  // see if the card is present and can be initialized:
    Serial.println("SD fail"); 
    return;   // don't do anything more if not
  }
 
  //Need to convert String variable to char*, per TMRpcm documentation
  char charBuf[audioFileTitle.length()+1];
  audioFileTitle.toCharArray(charBuf, 50);
 
  //Play the test sound
  //This sound file will play each time the Arduino powers up or is reset
  tmrpcm.play(charBuf);
 
  //Report to the user
  Serial.println("Sound file played!");
}

void loop()

tmrpcm.play("test.wav");
//delay(5000);
}

which is part of this project on Instructables.

To get a decent volume I used:

Arduino Uno
PAM8403 amplifier, the version with a volume control.
Voltage regulator set to 5v to power the amplifier (a resistor could be used)
SD card

After a bit of playing around, it all works. I get the cannon sound when I press the Uno reset button.

So, I now have a tank IR system, and a sound system, but running on separate Arduino's.

Does anyone know whether I can import the sound sketch into the Tank IR sketch, and where it should go in order that I get the sound when the cannon is fired? I am also concerned regarding the wiring/circuits, eg is there a conflict between the SD card hook up and the Tank IR?


 
3
Scout Dev / Re: Home Build
« Last post by LukeZ on November 12, 2017, 10:28:59 PM »
Another thing you can prepare for while you are waiting, if you haven't already, is the equipment you will need to program the microcontroller on the Scout. I haven't really posted about this because I assume people going through the trouble of assembling an SMD board at home probably already know this stuff, but for everyone's benefit here is a quick primer:

The ATmega chip on the Scout needs firmware, which you can flash to the chip using OP Config (or the Arduino IDE) and a standard FTDI cable (basically a USB-to-serial converter). BUT, before you do that, the chip will need a bootloader installed. Without the bootloader the chip can't even communicate yet over serial so to get the bootloader on requires a special one-time programming using a different device called a "programmer" connected to the ISP port on the Scout (ISP stands for "in-system programmer").

There are lots of compatible programmers but the cheapest that works well is the USBasp (actually Chinese knockoffs of it). These only cost a few bucks. I have used this one but they are sold all over the place including AliExpress, Banggood, eBay, etc... Note that many of them come with a 10 pin plug and you actually need a 6-pin, so be sure to get one with an adapter (such as the one linked) or buy an adapter separately (like this).

You will probably need drivers for the USBasp device, try these.

Ok, now you have your USBasp and your assembled Scout. The USBasp plugs into a standard USB port on your computer. The ribbon cable on the other end you need to connect to the ISP connector on the Scout which is the 6-pin rectangular connector in the corner of the board (shown in the image below). Align the red stripe on the ribbon cable with the little white triangle on the Scout board. You can either solder headers in those holes and just plug in the USBasp connector, or you can leave the board bare (as shown in the photo) and use a pogo-adapter like this one sold by SparkFun (just hold it on the holes in the board and press down tight). Note that you also need to power your Scout with a battery while performing this operation. Now you are connected, open up the Arduino IDE (you don't need to load any kind of sketch). Under the Tools menu:
- Select "Arduino Nano" as the Board
- Select "ATmega328" as the Processor
- Select "USBasp" as the Programmer
- And finally click on "Burn Bootloader"

If all goes well the bootloader will be installed (Arduino will tell you whether it was successful or not). If it works, you can put away your USBasp, you will never need it again.

Now you need to load firmware. This is much easier. You need an FTDI adapter (like this one or this one) or just an FTDI cable (like this one or this one), or any others that are legit "FTDI" cables/adapters (buy these from a reputable source or you will have driver issues). I prefer the adapters but you will need to supply your own USB cable then. The FTDI adapters/cables use the same drivers as the TCB so you probably already have them on your computer but if not you can get them from the Downloads page.

Once you have the FTDI drivers installed the rest is easy. One end plugs into your computer using standard USB, the other 6-pin wide plug connects to the Scout on the header shown in the image below. Note that one side of the FTDI connector will be labelled "Green" and the other end "Black", make sure these are aligned with the words "Green" and "Black" printed on the Scout board. For this operation it is not necessary to power your Scout with a battery, it will get power from the FTDI cable (though it doesn't hurt if a battery is connected). One thing you do need to make sure of is that you disconnect your Scout from the TCB if you had it plugged in there, because that will cause the firmware update to fail. Now just open up OP Config, select the correct COM port for your FTDI cable, go to the Firmware tab, select Scout ESC and "Get Latest Release", once that is downloaded click the Flash button and your Scout will be programmed. If you are really a glutton for punishment you could download the Scout source code from GitHub, open the sketch in Arduino, then program it from there.

Note that all this rigmarole is the same for the TCB if you are building one of those by hand, except there is no point in doing that since we can now purchase them. For the Open Panzer Sound Card none of this is necessary - the Teensy processor used on the Sound Card already comes with a bootloader pre-installed, and furthermore it requires no special Windows drivers. To load/update firmware for the Sound Card just plug it into your computer with a USB cable, then use OP Config to flash the latest firmware, should take five seconds.
4
Scout Dev / Re: Home Build
« Last post by LukeZ on November 12, 2017, 09:32:12 PM »
Yes, the 3 mil plastic is what you want. And yes, I try to keep the temperature to 200* C. I think the actual melting point of the paste is something like 183* Celsius but you need to go a little higher than that of course. If you keep it to 200* C you will have a very nice result.

If you go a few degrees over, don't sweat it, it's not the end of the world. But if you hit 210* C you are probably going to see discoloration of the bottom of the board including the silkscreen, and beyond that you risk delaminating the bottom copper and damaging the ICs.

OSH Stencils ship quickly, not like waiting for PCBs to be made. You will probably get the stencil this week.
5
Scout Dev / Re: Home Build
« Last post by Lotuswins on November 12, 2017, 09:15:51 PM »
Thank you so much Luke, you are the man!!

So I just ordered the stencil, 3 mils since I thought the thinner, the better.  Plastic, with a frame to ease the pain 8^).    Its getting easier already. 

I'll try out the heat plate tomorrow using my handy dandy Duratrax RC IR temp monitor while waiting for the stencil to arrive.  The paste bottle doesn't say its recommended melting point (the Mechanic Solder Paste from ebay/China I think you recommended), I assume its 200C, right?

Thanks again!!   Jerry
6
Scout Dev / Re: Home Build
« Last post by LukeZ on November 12, 2017, 07:35:34 PM »
I found the board layout finally that shows where to put which part (initially I thought I'd have to trace back from the schematic...yikes!).

For others reading this later, here is the Scout placement guide Jerry mentioned, from this thread.

Placement is the same for Rev 10 and 11.
7
Scout Dev / Re: Home Build
« Last post by LukeZ on November 12, 2017, 07:30:07 PM »
For placing components on the board curved tweezers work best in my experience, I've been using a cheap set I got from Harbor Freight but you can probably find even a nicer curved tweezer in the beauty aisle at Walgreens or the like.
8
Scout Dev / Re: Home Build
« Last post by LukeZ on November 12, 2017, 07:13:55 PM »
Jerry, you certainly can apply the paste "manually" but that would be quite the task and thankfully human resourcefulness has given us shortcuts. But if you were to do it by hand, I would apply the paste to the board using a toothpick, and then place the parts down. I wouldn't apply paste to the parts first, that would be too tricky. Pasting a board with a toothpick is fine for small circuits, but for the Scout I think the effort would be excessive.

What you really need to do is buy a stencil from OSH Stencils. I recently added links to these on the Downloads page, they probably weren't there when you first started your project so I apologize for that (be sure to buy the correct version, there are two revisions of the Scout now listed on the Downloads page, you no doubt have Rev 10).

The stencil will cost about $15. On checkout you can also buy a "jig set" for an extra 5 dollars, which are probably a worthwhile investment. Eventually you end up with a drawer of spare PCBs and those work just as well as the pre-made jigs but when you are first starting you won't have anything so the jigs are necessary.

Included for free with every stencil is a little spreader, which is basically just a credit card piece of plastic. You could also use a real credit card, or a regular spreader from the hardware store.

Here is a video tutorial that basically shows the process. Practice will make perfect, and also different people have different techniques. For example the guy in this video doesn't tape down his stencil while scraping, he just holds it by hand. In my view this is sheer madness, I always tape mine down (you only need to tape it along one edge, then scrape from that edge and away). If you don't like your paste job you can always wipe all the paste off your board and do it again, so you can practice as many times as you want (using rubbing alcohol for cleanup of your board, stencil, spreader, fingers, whatever).

A good spread will leave a thin film of paste on the board no taller than the thickness of the stencil. You really don't need much, less than you'd probably think. You might find it difficult on the ATmega processor to get the pins pasted cleanly so that the paste isn't smeared across multiple pins - don't worry, the paste will separate onto each pin individually during reflow, provided you didn't put too much on. Watching the solder re-flow is a magical experience. But remember not to burn it!

Feel free to ask questions as you go along.


9
Scout Dev / Re: Home Build
« Last post by Lotuswins on November 12, 2017, 06:44:16 PM »
Hi Luke,

Okay, we are just back from vacation so now I'm ready to start assembly of the board.  I have the hot plate you recommended, and have checked off all the parts from digitech and others.  I found the board layout finally that shows where to put which part (initially I thought I'd have to trace back from the schematic...yikes!).  So my first question is how much of the solder paste do you put on? and how is it normally applied, manually?  I was thinking of using a small screwdriver to put the paste on each tang of the part and set it down on the board though not much would be needed (the pads are awfully close together!). 

Thanks...obviously my first time at this!   Jerry
10
TCB Dev / Re: Ir - battle
« Last post by Deny on November 12, 2017, 11:40:03 AM »
Yes, you are right. The problem was in the selection of the resistance for the led
Pages: [1] 2 3 4 ... 10