Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Digitally controlled high voltage shocker

Author
Message
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 11th May 2012 00:45
I've been bored lately, so chances are you're going to see a few electronics related threads popping up here and there over the next few weeks containing small projects I took interest in. I will post my concepts, ideas, diagrams, test results, calculations, PCB layout data and full project descriptions throughout each thread I make. You are free to use it however you want.

Today's project was to conceive a high voltage shocker, however it has to be one where the level of pain can be controlled with digital inputs. It must not be lethal, but enough to give you a pretty good shock.

The aim is to have something that looks like this:



P_0 and P_1 control the level of pain according to this table:



Just as a side note, did you know "pain" means "bread" in French?

Back on track, I sketched a conceptual circuit. None of the values are correct, so disregard those.



Overall description

I'll use the simplest method to convert the digital signal to an analog signal, and then converting that to a PWM signal which powers the transformer. In theory, one should feel less pain with small duty cycles, and more pain when widening the duty cycle.

Triangle Wave Generator

I used (or should I say misused) the famous 555 chip in a typical astable configuration, however instead of taking the signal from the output pin 3, I'm actually getting it directly from the capacitor. This gives me an approximate triangle wave as seen in the diagram below. The curves of a charging/discharging capacitor are evident, but for this application an approximation is all I will require.



Digital to Analog converter

The digital signals are added together with different amplification using an inverted summing amplifier. The enable input pin will pull the output to GND, effectively setting the duty cycle to 0 (no output).

Comparator

As we all know, a triangle wave compared with a constant analog voltage results in a PWM signal on the output. This is demonstrated nicely in the following diagram. The red line is the analog voltage. You see that the higher I put it, the larger the duty cycle gets (green).



Output Driver

The output driver consists of a MOSFET and a transformer. They basically just amplify the PWM signal to a ridiculous scale (say 1000V). The diode is there to protect the MOSFET.

Next step

Since this is just a concept, I will have to perform a few tests in the lab to ensure the individual components actually function as predicted. I will hook up the output stage to a signal generator and simulate a PWM signal while holding my hand on the output wires. I will of course start at 0% duty cycle and move my way up until the pain is unbearable. With that info I will be able to calculate the rest of the circuitry.

I'll post again when I've made more progress, or if anyone has any questions they'd like to have answered.

TheComet

bruce3371
15
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 11th May 2012 01:10
You'll soon be able to change your location to;

'I`m under ur bridge shocking ur PONIES' lol

Dark Java Dude 64
Community Leader
15
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 11th May 2012 03:21
This sounds interesting! Please do post more stuff like this!

Dont kill yourself.
Kezzla
17
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 11th May 2012 03:55
you should make the time machine from napoleon dynamite

Sometimes I like to use words out of contents
nonZero
15
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 11th May 2012 09:49
.... Imaging appplying this to games. You get shot in the game, you feel it IRL.

Dark Frager
16
Years of Service
User Offline
Joined: 16th Mar 2010
Location: The Void.
Posted: 11th May 2012 23:33 Edited at: 11th May 2012 23:33
Quote: ".... Imaging appplying this to games. You get shot in the game, you feel it IRL."


Someone already posted a thread on something like this, it was a tent with Battlefield 3, and you actually had to run on a treadmill to move your character in game, and when you got shot, there were 4 paintball guns set up on the corners of the tent that would shoot you etc etc

Fruitella's a badman sweet, do you get me?
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 11th May 2012 23:55 Edited at: 11th May 2012 23:57
Quote: "'I`m under ur bridge shocking ur PONIES' lol"


Good idea!

Quote: ".... Imaging appplying this to games. You get shot in the game, you feel it IRL."


It's funny you should mention that, because that's in fact my master plan.

TheComet

nonZero
15
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 12th May 2012 00:08
Can't wait to play...

Oster200
15
Years of Service
User Offline
Joined: 21st Jan 2011
Location:
Posted: 12th May 2012 19:26 Edited at: 12th May 2012 19:28
My brother made one of these like 5 years ago. it used a 9 volt battery and i will try to upload pictures if you want me too. i dont know where it is though.

Yours sound way more complicated but i will still show you.

What does Star Trek and toilet paper have in common?

Sergey K
22
Years of Service
User Offline
Joined: 4th Jan 2004
Location:
Posted: 12th May 2012 22:03
did u made the divice already for it? or just chematics?

more 3d models .x/.obj and more foramts here:
[href]https://www.turbosquid.com/Search/Index.cfm?keyword=gogetax1&x=0&y=0[href]
jobromedia
14
Years of Service
User Offline
Joined: 9th May 2012
Location: Stockholm, Sweden
Posted: 13th May 2012 02:43
I'm not much into pain myself. So where would the pain be applied in your masterplan? Please also note that the pain scale is different from person to person, so what I feel as unbearable pain might be mild pain for you etc etc...

MIDI packs for sale.
Best regards
Johan Brodd
nonZero
15
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 13th May 2012 09:51
@TheComet
Ya'know this last post (jobromedia's) got me thinking, a Force Feedback device (like PS Dual schock) could be modified by placing a metal plate on either side of the controller. Maybe you could take advantage of the device's existing circuit board and replace the motors with "shocky". May make compatibility a non-issue as most usb gamepads etc are universally compatible.

@jobromedia:
you could have a "pain calibration" setup util. The more a person tried to be brave when configuring their threshold, the more it would bite them when they got shot (in game of course).

Kezzla
17
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 13th May 2012 10:32
my friend used to have a little gun lighter that everyone wanted to play with. when you pulled the trigger it gave your finger a shock.(the hammer was the actual sparker) gave a surprisingly strong jolt. great toy.

Sometimes I like to use words out of contents
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 13th May 2012 18:20 Edited at: 13th May 2012 18:23
@ Oster200 - Please do! I'd love to see it. I'm a little new to the theory of transformers, so any help I can get is appreciated.

Sergey K - Just schematics. And even the schematics aren't complete yet.

Quote: "I'm not much into pain myself. So where would the pain be applied in your masterplan?"


The idea I had would be to build this table with a screen in the centre, and four pads on each side where the players have to place their left hand on. Their right hand controls a joystick for game input. Placing your hand on the pad allows you to join the game, and removing your hand from the pad makes you lose.

The game would be something simple like pong, and for every error you make, you receive an electric shock.

Quote: "Please also note that the pain scale is different from person to person, so what I feel as unbearable pain might be mild pain for you etc etc..."


You make a good point. The trick to solving it is making the transformer energy-controlled instead of voltage or current controlled, because the amount of pain is proportional to the amount of energy, hence E=U*I*t. I'm not sure how to do it yet though.

Quote: "Ya'know this last post (jobromedia's) got me thinking, a Force Feedback device (like PS Dual schock) could be modified by placing a metal plate on either side of the controller. Maybe you could take advantage of the device's existing circuit board and replace the motors with "shocky". May make compatibility a non-issue as most usb gamepads etc are universally compatible."


That would be awesome, great idea! Not sure if making it go through your heart is a good idea though. Also, if I had a controller like that I'd probably try to hold it so I'm not touching the pads.

@ All

Progress has been made. I found out that controlling the transformer with a PWM is pathetically useless and retarded, and I slapped myself in the face when I saw the output curves on my oscilloscope. It was so obvious, but for some reason I didn't think of it when I designed the circuit above.

So what I'm going to do now is follow an idea inspired by jobromedia, and use the effects of a coil in order to get the high voltage rather than a transformer. Have you ever unplugged a vacuum cleaner from a wall and seen it spark? That's the effect I'll be exploiting.

Theory is simple.



A coil's current charges according to this formula:

I = I0 * e^( -t / τ )

Where I0 is the initial current of the coil defined by the resistor and total voltage. τ is a time constant calculated by:

τ = L / R

The energy of a coil can be calculated by this formula:

E = 1/2 * L * I^2

When you disconnect a coil from a circuit, the coil will reverse polarity and act as an energy source. It's output voltage can be extremely high depending on the load.

So it should be simple to design a circuit which charges the coil until the current reaches a certain threshold (controlled by the digital inputs for pain levels), and then have it discharge over the users hand.

This solves this problem:

Quote: "Please also note that the pain scale is different from person to person"


Because we're working with energy rather than just voltage.

More to come.

TheComet

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 16th May 2012 13:46 Edited at: 16th May 2012 13:52
Alright, so after a discussion with a good work colleague of mine, I decided to go back to the transformer idea I originally had. This time however the input won't be pulse-width controlled, but amplitude-controlled. Below is a schematic of a phase shift sine wave oscillator. It generates a 1.4 kHz sine wave at an amplitude of roughly 280 mV. This signal will eventually be used to drive the primary winding of a transformer.



A little theory again...

In order to create an oscillator, the gain must be greater than unity, and the phase shift must be 360° (or 0°, which is essentially just a positive feedback). The OPAMP is an inverting amplifier, so that already provides us with a 180° phase shift. Each RC network shifts the phase by another 60°, so that all adds up to 60° + 60° + 60° + 180° = 360°.

The RC networks dampen the signal by a significant amount, so the OPAMP helps amplify it again. In order to get a nice sine wave, the amplification must be as close as possible to the dampening of the RC network, but not too close as to stop oscillation.

Given that R8 = R9 = R10 = R15, and C1 = C2 = C3, the ultra complex formula can be shortened to this:

Frequency f = 1 / (2*pi*sqrt(6)*R8*C1)
Rgain R16 = 29 * R8

Upon calculation I receive:

f = 1.4kHz
Rgain = 290k


I chose 390k just to be safe.

The virtual ground input is nothing more than a power source providing half the amount of the supply voltage, in this case 6V. This gives the sinus a DC offset so the bottom half isn't chopped off. The circuit for the virtual ground is as follows:



TheComet

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 16th May 2012 14:44 Edited at: 16th May 2012 14:47
I've worked on the digital amplifier of the sinus wave. It amplifies the input signal by a factor controlled by the digital inputs.



Theory? Theory.

Calculation of OPAMP resistors.

This is the simplest form of the amplifier above:



The idea is to change the amplification of the circuit by adding / taking away resistors from the circuit, controlled by the two transistors, and therefore effectively changing the value of R1.

Since the amplitude of the sine wave is approximately 400 mV, I can calculate the maximum amplification I'll need on the output (which is of course 12V, and considering the losses of a non rail-to-rail OPAMP, I'm just going to say 10V by feeling):

Vmax = 10V / 0.4V = 25

From expirience, I'll choose R2 = 51k. Now I can calculate the minimum resistance of R1:

(R2/R1 + 1) * Uinput = Uoutput where Vmax = Uoutput / Uinput

R1min = R2 / Vmax = 51k / 25 = 2.04k

The minimum amplification I'll choose to be Vmin = Vmax * 0.2 = 5. With that I can calculate the maximum resistance of R1:

R1max = 51k / 5 = 10.2k

And since R1max is going to be in parallel with the other 2 resistors, it is the first resistor in the circuit at the very top (R22).

Right. Now that I know the maximum and minimum resistance of R1, and I know I'll be connecting the various resistors in parallel, I can approximate the other two which are in parallel. The following calculation gives me the resistance of both unkown resistors. I'll call it Rx:

Rx = 1/[ (1/R1min) - (1/R1max) ] = 2.55k

So knowing Rx = 2.55k, and knowing that it's a good thing to have the values pretty far apart (so one transistor can give more pain than the other), I'll choose one of the resistors, R23, to be 8.2k. Now I can finally calculate the last resistor:

R24 = 1/[ (1/Rx) - (1/R21) ] = 3.6k

Just to wrap up:

R22 = 10k
R23 = 8.2k
R24 = 3.6k

AWESOME, am I glad that's out of the way. Are we finished? Nope.


Calculation of base resistors for transistors

This is much simpler than the previous maths. Let's collect some values first.

Uce = 0.3V (datasheet)
Ube = 0.7V (datasheet)
hfe = 120 (minimum amplification of transistor)
u = 5 (Overamplification factor)
Uoutput = 10V (OPAMP output maximum)
Udigital = 5V (digital input voltage)
Rmin = 51k (smallest resistance between supply voltage and GND we're using).

First, we calculate the maximum current that flows into the collector.

Icmax = (Uoutput - Uce) / Rmin = 0.19mA

With that the current flowing into the base can be calculated:

Ib = Icmax / hfe = 1.6uA

And now we can calculate the base resistor:

Rb = (Udigital - Ube) / Ib / u = 550k

That just about wraps up the theory. More to come~

TheComet

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 16th May 2012 16:17
Well, it turns out theory is theory, and has little to nothing to do with practice. The oscillator oscillates at double the frequency I calculated, and the amplitude is also double the amount I calculated. This of course has some devastating effects on my calculations, so I'll have to recalculate everything accordingly.

Law #16 of electronics states : If a mathematical error occurs (and it will), it always occurs at the very beginning so you have to recalculate everything.

There are a total of 19 "Laws of electronics". Maybe I should post those at some point?

Anyway, here goes the recalculation.

Vmax = 10V / 1V = 10
R2 = 51k
R1min = R2 / (Vmax - 1) = 51k / 9 = 5.6k
Vmin = Vmax * 0.2 = 1

Which essentially means R1 = R2, so:

Rmax = 51k
R22 = 51k

Rx = 1/[ (1/R1min) - (1/R1max) ] = 6.2k

Choose a value somewhere between 51k and 6.2k.

R23 = 27k
R24 = 1/[ (1/Rx) - (1/R23) ] = 8.2k

R7 = 51k
R22 = 51k
R23 = 27k
R24 = 8.2k

Base restistors don't change because R7 is still 51k.

TheComet

Oster200
15
Years of Service
User Offline
Joined: 21st Jan 2011
Location:
Posted: 16th May 2012 23:59
Yeah i cant find it on my own he might have thrown it away. I will have to ask him when he gets back.

What does Star Trek and toilet paper have in common?

Sergey K
22
Years of Service
User Offline
Joined: 4th Jan 2004
Location:
Posted: 17th May 2012 18:38
@ TheComet: it seems you know a lot about electronics!
and im only learning though..

do u have skype or msn that i could add you in?

more 3d models .x/.obj and more foramts here:
[href]https://www.turbosquid.com/Search/Index.cfm?keyword=gogetax1&x=0&y=0[href]
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 17th May 2012 19:02
Of course. My skype name is : The__Comet

TheComet

Dark Java Dude 64
Community Leader
15
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 18th May 2012 00:32 Edited at: 18th May 2012 00:32
If you dont mind ill add you in skype as well.
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 18th May 2012 01:49

Login to post a reply

Server time is: 2026-07-21 13:26:30
Your offset time is: 2026-07-21 13:26:30