Welcome to CuVoodoo,
the sorcery of copper.
Today I will talk about this.
This is the infrared cock grenade.
For the bachelor party of a friend we decided to go and play laser tag.
And we wanted to give him the ultimate weapon.
First we thought about a holy grenade (Monty Python),
but then we decided because of his dirty talk to make it a cock grenade.
It's pretty simple.
You press on the button here to start it,
and after 5 s you see these LEDs blink.
These are infrared (IR) LEDs.
You can see it in the camera,
but in real life you won't see it with the naked eye.
They send a certain code
which kill all the players which are in the neighbourhood.
That's why it's a grenade.
We'll study how it works and how I made it.
To be able to build this infrared grenade
I needed to find out which signal I had to send using the IR LEDs.
And for that we need to know what the technology is,
and which is the one which is used by laser tag weapons.
Actually it's not "weapons".
These are called "taggers".
And they don't have to look as real as real weapon replicas.
In air soft generally you like when it's a very similar replica to the real weapon,
here it's not really important.
And you can find any kinf of shape, toys, and so on.
But as the name says "laser tag", this is a bit misleading.
because they don't use lasers.
Lasers are far too expensive for such equipment.
They are not easy to drive,
and they consume a lot of power.
Instead they use IR LEDs
And this is also what I used.
LEDs are very inexpensive.
They are very easy to drive.
And they don't consume a lot of power.
They're very efficient.
How it works is that, here you have an IR LED.
And on the front you have a small plastic optic
which narrows the beam,
so just a small focus in the end gets the IR signal.
And on the other end, I can build a grenade with very wide angle LEDs,
so I can cover a larger area than normal taggers do.
But let's find some information about how these work.
These are the taggers which they use at this place,
in Berlin, where we went.
"HT-11".
And we already know it's from a company called Hi-Tech.
A very original name.
If we look in the downloads,
we try to find some kind of documentation about this product,
how they work,
and what the technology is behind.
This is the manual.
And if you search for "protocol" you won't find anything.
Same thing if you search for system.
It's really just a manual,
I doesn't give you a lot of information.
But we know the company is called "Hi-Tech"
and the products are HT-9, HT-11, and so on.
So we just look for it.
"Hi-Tech taggers".
And here we find the website of the manufacturer.
As you can see it's not very professional.
Even the layout is broken.
Here the text is flowing away.
It's not correctly put.
Here the tagger have been taken using a green screen,
but then they didn't change it.
They just left it as it is.
It does not look very professional.
But at least they make it.
Here are the taggers again, with details.
And then is How To ...
This category I don't know why it's called How To.
It's probably the manuals.
But you should call it "Support" or something like that, and not How To
And to show how unprofesional it is, let's have a look at this manual.
When you click on manual you expect some king of PDF,
and they give a Word document.
This is completely ridiculous.
And if you look at it, it's just a text file with 4 links.
No description. No title. Nothing.
Just 4 links to YouTube videos.
Why not directly embed it? I don't really know.
If you're serious I think in the market you could make a lot of profit.
If you're more serious than this.
This is the manual which they provide.
And it seems already quite interesting.
"Hi-Tech Operation Manual".
If it's operation or service manual that's a good lead.
Then we have a firmware version.
If they talk about firmwares they will probably talk about the technology.
So again let's look for protocol.
Find.
And here we can see
Worlds of Wonders refers to a very simple IR signal used in older Laser Tag gear.
The latest MilesTag operating system does not support the WoW protocol.
So the operating system is "MilesTag".
This is quite some good information.
If we look again here,
"MilesTag protocol".
We find two quite good links.
Here we even have a C implementation.
When it comes to protocols and specifications
I really prefer PDFs.
This shows that it has been somehow specified the right way,
and somebody put some thoughts into it.
It doesn't always have to be this way,
but specifications are generally done in PDFs.
And this gives you already the IR protocol format.
This is actually the same than the first link we found.
The first like also shows exactly the information which we've found, and describes the protocol.
But let's have a look at the PDF.
The IR MilesTage 2 protocol,
that's the latest,
is modulated onto a pulse width modulation (PWM) waveform.
This is when you switch on and off the LED quite fast,
at a certain frequency.
And this frequency is here.
This PWM frequency: 38 to 56 kHz.
Half of the time the LED is on,
and the other half it's off.
And this blinking of on/off happens at this frequency.
To do that you use pulse width modulation.
It's pretty common.
I didn't play with IR previously,
so I also learned everything about IR signal transmission for this project.
And this is how it works.
You switch on the LED,
the PWM signal,
and for 2400 μs you just leave it on pulsing at this frequency.
The you switch it off for 300 μs.
And if you want to send a 0,
you switch it on for 600 μs and then switch it off for 600 μs.
Or you switch it on for 1200 μs and then off for 600 μs,
This is the space.
And this will send a 1.
So we have a header,
and then the bits are either
600 or 1200 μs,
and you have a space between all of them.
And this is pretty common in IR signals.
There are lots of protocols.
And the remote which you use for your TV also uses a specific IR encoding and protocol.
There are tons of them.
And this one is actually quite well specified.
We know how to transfer 0s and 1s (bits),
now we have to transmit the data itself.
Here is the data protocol.
It describes how shot packets work,
how the message packet work,
with all the information you need.
And then you have special commands.
These are the commands packets.
If you look at one ...
This one.
This is the one I used:
"Explode player".
I just had to send this information out
and this causes a grenade to be triggered.
"Causes the explosion sound effect to be played",
and "Set the health to 0".
This is the effect of the grenade.
We known the protocol.
We know how to send bits.
We know what data we have to send for the grenade action.
And the last information we need is at which frequency it operates,
since it can operate at ...
The signal can be modulated at different frequencies.
For that we look again at the manual.
And we look for "frequency".
Here.
"IR carrier frequency".
This is 56 kHz.
And with that we have all the information we need
to implement and create our grenade.
Before I came with this last design
I wanted to prototype it.
And for that I used this development board.
It's not really a development board.
It's a hardware badge
which I got from a computer security conference called "Troopers",
which happens in Heidelberg in Germany.
And what this is,
is simply a customization of this.
This is the TV-B-Gone from Mitch Altman.
It's pretty simple.
You just put the batteries inside,
you press on the button,
and then these high power IR LEDs
will send lots of TV codes to switch all TVs off.
This is why it's called TV-B-Gone.
You just press on it,
all the codes are stored in here,
and it will go through all the codes
and try to switch off all the TVs.
And with that there is actually everything I need.
I needed a micro-controller (μC),
which I could program.
I needed LEDs.
And I needed one button.
But I didn't had this TV-B-Gone in the beginning.
I only had this hardware badge.
But it's the same thing.
It's just a different layout.
Here is the μC.
Here is the clock.
Here is the ceramic resonator to have a very precise clock.
Here are the LEDs.
We have 6 of them instead of having just 4 of them.
Here is the LED to blink.
Here is the button.
And on the back you again have
the 3 batteries.
And what I did is,
I soldered this programming header.
This uses an Atmel ATtiny85.
And on the back this is the In-System Programming (ISP) header,
for programming Atmel devices.
There was even a serial ... I even used a serial output.
And this is why I have this UART to USB converter.
So I can debug it.
I have 2 ways to debug it:
the serial output,
and this LEDs blinking here.
And with that I programmed on the raw chip the code itself.
These Atmel μC,
and almost all μC,
support generating PWM signals.
It's one of the timer options.
You simply program the timer in the PWM mode,
you set the frequency at which it operates,
and then you say this pin "toggle every time",
to generator this signal, so it ...
This is the first transistor,
which then controls all these 6 transistors.
And these 6 transistors will control if power goes through the LEDs or not.
The μC here can not provide enough power for all these LEDs.
I think each LED uses 100 mA.
So we have 600 mA.
And the output current of this chip
is rated I think at 40 mA per pin.
And this is why we have all these transistors to control the power.
And the resistors are just for protection.
With that I implemented the grenade using high power LEDs.
But I needed to find out if it's really the right signal which is sent.
So I used this one for that.
This is the USB Infrared Toy
from Dangerous Prototypes.
But really, I cannot recommend it.
It's simply a PIC μC,
with USB.
And it comes with pre-programmed firmware
which help you developing with IR.
You can send codes.
I didn't need it.
I just needed to receive codes.
Normally it comes with this demodulator.
That's a TSOP38328.
And it only demodulates signals which are modulated at 38 kHz.
You don't want to implement this demodulation of the modulated signal into bits themselves,
so you use these demodulators.
They detect signals modulated at 38 kHz,
and they will just tell you on or off.
This is exactly what we require.
I removed the one for 38 kHz,
and I put one, that's a TSOP31456
which operates at 56 kHz,
because this is the frequency used for the taggers.
And then the firmware itself here can give you timecodes.
I've files 4 bugs because I had to use different firmwares for different features,
and it didn't work quite well.
I spent a lot of time and I cannot recommend it.
It's pretty simple actually.
I should have taken just the receiver and put it somewhere on a free pin
and then just read out the information myself.
Because this demodulator gives you on/off,
so it's pretty simple.
But I will still give the decoding program.
Using that I just receive the signal,
it sends me the data out over USB,
that's pretty useful.
Then I implemented a program which takes the times at which it was on and off,
and then told me which packet is sent.
This way I was able to,
on this board send the code,
send the signal for the grenade,
using the format I programmed,
and verify using a second implementation,
using this tool.
And that was the development.
After this development I made this board.
And we will have a lot at this board.
It's pretty simple,
but I'll still show how it works.
This is the schematic of the board which I produced for the infrared cock grenade.
It's pretty simple.
On the center here we have the μC:
ATtiny45.
It's a very small μC,
but it's sufficient for this task.
I don't need a lot of pins.
On the top we have the battery:
3xAAA.
It provides 4.5 V,
around 4.5 V.
We can connect it directly to the chip
because this one easily operates between 3.3 and 5 V.
Here we have UART for debugging.
Here we have the In-System Programming (ISP) port,
so we can program this chip itself.
This is the button to trigger the grenade,
so then it will explode.
Here there is a small LED
to indicate that the grenade is activated,
and that you have 5 seconds to throw it.
This is a very precise clock,
at 8 MHz,
because we want to pulse the IR at a precise frequency.
But actually I don't think that this is required.
Probably it also works quite well without this,
and you can generate this frequency of 56 kHz
quite accurate enough without external clock.
But it's here, so we have a precise clock.
And this what you see here,
this is normally a Linear Drop Out (LDO) voltage regulator.
But this is the adjustable version.
And this is particular because,
now I can directly connect it to the battery on this side.
But on the other side
it's not a fixed voltage,
I use it as fixed current source.
And this is why you see this resistor here.
This resistor will define which current will flow through here.
And I've used fixed current because this is how I want to drive the LEDs here.
We have 2x2 LEDs.
There are two in rows and series,
because each of them uses around 1.8 V.
So the two of them will use 3.6 V.
And because my battery source is 3xAAA batteries
I can provide power for this,
but not for all four in series.
Generally you want to put as many LEDs in series as you can,
because if you have a constant current
the current which will go across the LEDs will be the same for each of them.
So they will have the same brightness.
For example here there are two in parallel,
if this forward voltage drop was slightly different
The voltage in this path will be higher or lower than the voltage in this path,
and it can happen that this two paths are not as bright.
But for this application it was good enough.
I had the LEDs from the same batch.
And it's not really critical to be that precise.
The grenade will be thrown somewhere away
and then just blink all over.
But in theory try to keep them in series if you can
and provide a constant current.
And this resistor here will define which will be the constant current which will go through the LEDs.
The μC just controls if they are on and off.
Here there will be the PWM signal
which is coming out of this pin.
This will switch on and off this pMOS
which will provide power or not to the LEDs,
and this will modulate the signal
and send the MilesTag grenade data command.
Here the resistor is less than 120 Ω.
120 Ω will provide 100 mA to this.
This is far too bright.
100 mA means it will kill everyone within 10 to 20 m,
if you use this grenade in a room.
Amd if you have a grenade you want that is kills everyone within less than 5 m,
or 10 m,
But you don't want it to kill all the players in the whole room and also far away to get killed.
And this is why you need to choose a resistor which is less than 120 Ω.
This fine tuning of which resistor you use
you can either use a trim potentiometer,
or you put a fixed value once you tested it yourself.
This is an empiric value.
You can put a low value if you want to use it indoors,
or high value if you want to use it outdoors.
Now that we've seen the schematic, let's have a look at the board itself.
Here is the board.
Let's open it to see what's inside.
This is the back to protect it.
This plastic thing,
"the cock",
comes actually from a penis vacuum pump.
Normally you put your penis here,
then you have here a small hole
where you have a small pump,
and then you can vacuum it.
But we found it pretty useful because it has a lot of space,
it's in form of a cock,
which is pretty appropriate for him,
and it's quite hard plastic.
And it's transparent,
so the IR can go out.
Although we didn't need it,
we could have put the LEDs inside,
and then use the transparent plastic to allow the IR go outside.
We put it on the outside because it looks nicer and works better.
These are the 4 IR LEDs which you saw.
This is the indicating LED.
This is the button.
This is already two years old,
and it still works.
I didn't change the batteries since then.
That's pretty good. I didn't expect it to last it so long.
This is the board.
Quite a lot of cables.
Let's diconnect the cables.
Now I have to remember what is where.
But that's not really important actually.
To produce this board I used a CNC milling machine,
the LPKF ProtoMat S63.
You just put a bare plate of copper clad
and you define where you want the CNC bits to mill these paths.
So you can insulate the traces.
Using that you can prototype PCBs.
For fast prototyping it's quite useful.
As you can see I also did some mistake.
Normally you put through hole components on the other side,
on the front.
And then the traces on the back.
And the surface mount components on the back.
Here I forgot to put the through hole components on the front, so you can solder the leads on the back.
This is why the μC is on the back.
These one can still be on the front because they only have two pins.
It's not really important which side they are since you can invert them, since you can mirror them.
This is the ISP programming header.
This is serial.
This is the voltage.
This is the input voltage (battery).
Here we have the Atmel ATtiny45 μC.
Here we have the first transistor which control all the other transistors.
Actually this is the pMOS.
This is the pMOS transistor which will switch on and off all the LEDs.
This is where you connect the LEDs.
We have 6 ports.
I only use 4 of them.
I don't know what the other is.
Oh. So ...
4 ports for the LEDs.
1 port for the switch.
And 1 other port for this LED.
The last one is probably for serial.
I don't remember exactly.
But this is a very simple board.
You just connect all the cables inside,
and for a prototype it worked quite well.
I'll put the schematic online, on the wiki.
Not on the git this time.
But it's pretty simple.
With that you can already have a lot of fun.
And with a simple thing like having IR LEDs blinking,
having IR LEDs blinking,
using IR is pretty simple,
And it's a good entry program if you never programmed μC:
setting up the timer,
looking at interrupts,
putting the μC to sleep so it doesn't draw a lot of energy,
using ...
Now I remenber.
Using pMOS to drive LEDs,
high power LEDs,
using a voltage regulator to have constant current.
This last connector which is here
is simply for ...
I don't know if I can see it.
Here. This one.
As you can see here there is a resistor.
This last thing is the fixed value resistor to define how bright it should be.
I just put it in a room,
test a couple of resistors,
and measured how far the signal went.
Then you just connect the resistor here so you can define which current goes through the LEDs.
With that the project is done,
and was pretty fun as you can see.
Enjoy.
video blog: https://www.cuvoodoo.info documentation: https://wiki.cuvoodoo.info source files: https://git.cuvoodoo.info Creative Commond Attribution Share-Alike 4.0 International