Sunday 23 January 2011

Finishing the sensors

Today I drilled my sensor PCBs. There were only two hole sizes, 0.8mm for the TSOP IR detectors and cable holes and 0.6mm for vias.

I use high speed tungsten drill bits with this 10000rpm PCB drill I blagged in a broken state from my previous employer:



I just populated two boards, which is sufficient to complete one gun. Here are the boards, one enclosed in a transparent sensor dome:



The next step is to mount these on a headband and connect them to the gun.

Saturday 22 January 2011

Milestag sensor PCBs

As I've mentioned, I was fortunate to be in the USA last year and was able to get an American friend to order Milestag RevH PCBs for me, which saved me about 35UKP on postage. However, Jim was out of stock of sensor PCBs at the time. So I still needed to source these.

I decided to make my own. First I used Kicad to implement the simple schematic published on the Milestag site:



Then I designed a PCB around it. As I intend to make this myself, I changed the diameter to 31mm as this is the internal diameter of the 35mm holesaw that I have, and I replaced the two through hole resistors with surface mount ones to give me some more real estate to work with. Here is the design:



I repeated this 8 times onto an area of 160x100mm which is a standard dual layer size supplied by Maplin.

I then printed the top and bottom layers onto tracing paper with my laser printer:



The top layer is cut and overlayed onto the bottom layer. I align them using a lightbox to make sure the alignment is as accurate as possible:




When aligned, I fastened them together to form a pocket using cellotape and inserted the pre-sensitised PCB, fastening it with tape to prevent it from moving:



I then exposed the PCB to UV light from a single sided UV source, turning the board to expose the other side.

I develop the PCB with commercial developer, in the past I have used 99% sodium hydroxide crystals but this is nasty stuff. I got this from Mega Electronics. They do commercial grade PCB stuff but are willing to deal with individuals:



I etch my PCBs in a home made tank:

It's tuppaware with tropical fish tank heater and air pump with a wooden surround. Basic, but it works. God help me if it ever leaks though:



Here is the etched PCB:



I then cut each unit out with the holecutter:



After cleaning with wire wool, I used this stuff from Mega Electronics:



To tin plate the copper tracks to prevent oxidisation.

Here is the finished sensor PCB:

Sunday 16 January 2011

Full assembly

I experimented with IR focus and the results were interesting. The circuit published in my previous post could detect IR from the gun at about 50m without a lens to focus it. My plan was to get as far away from the test circuit as I could until it failed to detect a transmission, then adjust the focus until the sensor saw the IR pulse again, then move further away.

Unfortunately, I was unable to get far enough away from the sensor in my test environment! I resorted to the IR camera and got a satisfactory beam focus by visually examining the size of the beam on my monitor.

I haven't built the IR sensors yet, but I decided to build the milestag gun up fully. It went together well. I also fitted a picatinny rail to the top of the gun and fitted a cheap red dot sight I got from ebay.

It looks pretty good. Trouble is, I now need to paint 60% of it bright orange to conform with UK imitation gun laws. Ah well.....





Saturday 15 January 2011

Focus, focus, focus

I've been trying to optimise the focus of the Milestag IR beam today. At first I thought the best way would be to observe the beam, and try to get the brightest dot at the furthest distance.

To achieve this I created this unholy device:



This is a super sensitive IR camera with a battery powered CCTV alignment monitor + the Milestag IR focusing section of my gun with faux reload and trigger switches.

My idea was to see how far I could get the beam to be a minimum diameter.

It worked very well, except that at the distances I want I could hardly detect the IR light on the small monitor.

Also I looked a bit of a cock as I walked about my street in darkness with this thing.

So I sat back and thought 'what am I trying to achieve?'. Answer: IR reception at maximum distance so I came up with this:



It's the TSOP4856 detector the Milestag system uses connected via a transistor to a LED. When it detects a 57kHz IR signal the LED illuminates. With the aid of a helper I should be able to optimise the IR focus. The further away the LED lights, the better the focus.

Here is the test circuit built up:

Wednesday 12 January 2011

Starting Assembly

I started assembling the breech section of my reprap  Milestag gun today. It was quite a squeeze to get all the components in, but they did fit.

Here is the system powered up:



The next stage is to fully assemble the breech and barrel sections and adjust the IR LED focus.

Sunday 9 January 2011

Baud to tears

I was hoping to get the complete milestag gun assembled this last week. But before I could finish it I needed to program the ISD1790 sample playback chip which is present on the milestag PCB.

The ISD1790 has A/D and D/A converters, and FLASH memory to allow it to record and playback up to 90s of audio as 8kHz mono samples.

The IC also has an SPI interface to allow microprocessor control.

The milestag RevH core software has a mode to allow this IC to record audio played through a PCs line out socket. All that is required are an RS232 lead to the milestag PCB and an audio connection from the PC to the PCB.

This caused me no end of problems. I constructed RS232 and audio leads as specified in the RevH manual.

During the record phase, the ISD1790 board routes the audio input pin to the audio output pin so you can check the sample quality through the target speaker.

Putting the RevH mode into sound record mode did this, but the PC sound recorder software supplied did not force the sounds to record on the RevH board.

I checked all connections to no avail.

I then got back to basics and checked the PIC oscillator frequency with a scope. The PIC software is written to work at a particular frequency, and the RS232 baud rate it uses to communicate with the PC is a function of this frequency.

The scope showed that the clock was not running at all. I read the PIC memory with my ICD2 and this showed that I had set the PIC clock config byte incorrectly. This meant that the PIC was being clocked at 4MHz instead of 16MHz.

The result of this is that the PIC was expecting data from the PC at 2400 baud instead of the 9600 baud the PC uses.

I reprogrammed the PIC with the correct oscillator config and the sounds recorded successfully.

During all the plugging and unplugging I managed to damage the LCD display so as as soon as I have a replacement I will complete the build

Sunday 2 January 2011

It Lives

I programmed the PIC 18F2525 MCU today. I've been working with PICs for a long time and I am fortunate to have a Microchip ICD2 programmer/debugger. I extended the wires from this to allow me to program the MCU on breadboard:



I wanted to attach the LCD module to the RevH board using an IDC connector to minimise soldered connections. This is where I encountered one of several unsatisfactory issues with the Milestag RevH design. The LCD connector has been CADed so that odd and even pins are swapped in relation to IDC connectors.

i.e. Pins 1 & 2 are swapped, pins 3 and 4 are swapped.

This prevents using a female IDC connector at the RevH PCB end and a male one at the LCD end. I was forced to solder the leads to the LCD with the pins swapped.

Once this was done, I powered up the board. I initially thought it was dead as nothing appeared on the display but on closer inspection, the LCD was displaying:

COMBAT
T.A.G

but very faintly. Issue 2 with the Milestag design is that the LCD contrast is set with 2 fixed resistors. This is fine when using the stock Lasertagparts LCD module but I got mine from Ebay priced 2.87UKP including delivery.

The Milestag schematic uses two fixed value resistors to form a potential divider to set the LCD contrast. I had no idea what values were required for my LCD module so I swapped the 17K resistor for a 2.2M pot and tweaked it until I got an acceptable result, then measured the pot resistance which came out at 175K. I upped this to 180K. This really should have had a trimmer on the PCB to simplify this for none stock LCD modules.




And so it lives: