SMMedical's Punishment Boxie

From another project I had left over a small boxie with a 10-LED bar array in green and red. I decided to re-use it for a shocker boxie. On my Fetlife profile I already have a similar device called Homotrainer Encourager, so I also re-used the code for the Punishment Boxie, from now on PB. I’m an avid PIC micro fan and love coding in assembly so I quickly kludged up the hardware and the firmware. In the thread about the Lilly Wave I already posted some imagery but here’s some more:

This is the schematic. 10 Ports of the PIC are used for the LEDs, one doubles as FIRE button. The arrangement is rather haphazard because of the need of using port B to wake from SLEEP (DN/UP buttons). The anodes of the LEDs are driven by two PNPs. The output is a low gate threshold MOSFET and the audio transformer something I dug up from my junk box. It could be from an ancient cordless phone:

This is the inside:

with still another transformer inside. Because it has a ferrite core it doesn’t store enough magnetic flux to create a useful shock. It’s an incredible mess because the boxie is actually too small so I had to cram everything inside…

The level is indicated by the LED bar:

and changes color as the level increases.

A propos level, forum member mer indicated that the maximum unloaded peak voltage across the output should be no more than 500 V. It’s a bit more:

On this screenshot from my scope (50 µs/div, 100 V/div) you can see it’s more than 700 V… Hopefully the output capacitor can cope with this voltage. But since it’s from an old TV it probably can.

The firmware caused quite a few headaches:
shocker.txt (8.7 KB)
Change txt to asm because it’s assembly. Now at version 0.8. It runs on two interrupts, the RB port change to wake from sleep and the timer0, which is used to make a state machine. It scans the buttons and goes to sleep if nothing is pressed. UP and DN set the level which is indicated on the LED bar. FIRE causes a burst of pulsed to be generated. Its level is decoded from the LEDs. The comments in the code show the fun I had with fixing the bugs…

Hi,
why there is an output capacitor?
I see you use a neon lamp as a voltage limiter? I am not sure if it can ionize fast enough to limit the spike.
With these voltages I would be afraid about the transformer insulation breakdown - they are not designed for that. The enamel could deteriorate after some time.

edit: Also there is no protection diode for the FET. It should be there.

edit2: 330pF output cap will do absolutely nothing.

The neon bulb was there for testing. It is now gone. If the transformer goes phut the pulse will be gone and the boxie won’t work anymore. It is only stressed for very short times. The FET is a 200 V device and is intended not to have a flyback clamp diode because that’s what it’s supposed to generate in the first place. And the output C stretches the flyback pulse:

No C

330 pF C

That capacitor was a remnant of my attempt to generate a symmetric pulse. While that failed I left it in because it reduces the rise time of the flyback pulse. The forward pulse doesn’t do a whole lot as it’s always 70 volts.

I will shorten the longest pulse because it is too strong.