Tesla coil playing music
-
- Posts: 40
- Joined: Tue Apr 23, 2019 4:38 am
- OS: windows
- IDE: System workbench
- Core: N/A
- Board: Blue pill, STM32F407
Tesla coil playing music
I have used a timer on a STM32F4 to create square waves at freq of music notes to be able to play music on my Tesla coil.
See https://www.youtube.com/watch?v=-upXNRTEMkQ
See https://www.youtube.com/watch?v=-upXNRTEMkQ
- Vassilis
- Posts: 174
- Joined: Wed Feb 27, 2019 5:09 pm
- Location: Thessaloniki, Greece
- OS: Linux, Win10, MacOS
- IDE: Arduino 1.8.9
- Core: Roger, STM official
- Board: Bluepill, Maple mini, STM32F4xx
- Contact:
Re: Tesla coil playing music
Wow, really cool !
I have seen old 1.44" floppy drives playing music but Tesla coil playing music is more impressive
I have seen old 1.44" floppy drives playing music but Tesla coil playing music is more impressive
-Vassilis Serasidis
-
- Posts: 40
- Joined: Tue Apr 23, 2019 4:38 am
- OS: windows
- IDE: System workbench
- Core: N/A
- Board: Blue pill, STM32F407
Re: Tesla coil playing music
I am not the first to create music with a Tesla coil see https://www.youtube.com/watch?v=-f6GijQXaBI&t=70s
But as far as I can tell I am getting much clearer tones than anyone else. Most people just try to alter standard audio to sound better then send the output to the Tesla coil but a Tesla coil isn't a speaker and doesn't create good quality sounds (this is the first thing that I tried). Then I discovered that Tesla coils can create very clear mono tones if given a clean square wave. So I don't use the Tesla coil like a speaker but rather as a musical instruments that I play with the timers on the MCU.
But as far as I can tell I am getting much clearer tones than anyone else. Most people just try to alter standard audio to sound better then send the output to the Tesla coil but a Tesla coil isn't a speaker and doesn't create good quality sounds (this is the first thing that I tried). Then I discovered that Tesla coils can create very clear mono tones if given a clean square wave. So I don't use the Tesla coil like a speaker but rather as a musical instruments that I play with the timers on the MCU.
-
- Posts: 210
- Joined: Thu Mar 07, 2019 6:15 am
- OS: linux
- IDE: eclipse, arduino 1.8.5
- Core: Roger's
- Board: Maple mini, Bluepill
Re: Tesla coil playing music
+1 nice 
i did a smaller / simpler one that plays rtttl tunes on stm32duino libmaple core here
https://www.youtube.com/watch?v=uUC695nTkXw
https://github.com/ag88/stm32duino_rtttl

i did a smaller / simpler one that plays rtttl tunes on stm32duino libmaple core here
https://www.youtube.com/watch?v=uUC695nTkXw
https://github.com/ag88/stm32duino_rtttl
-
- Posts: 40
- Joined: Tue Apr 23, 2019 4:38 am
- OS: windows
- IDE: System workbench
- Core: N/A
- Board: Blue pill, STM32F407
Re: Tesla coil playing music
OK that is quite interesting. I hadn't seen RTTTL player before. This is much the same as the signal that I am sending to the Tesla coil except that I also have the length of time the note is played for and can play a rest where needed. I was thinking about possibility using midi format but atm I am using my own format of a struct array that stores the note and the length it is played for.ag123 wrote: ↑Wed Dec 04, 2019 5:31 pm+1 nice
i did a smaller / simpler one that plays rtttl tunes on stm32duino libmaple core here
https://www.youtube.com/watch?v=uUC695nTkXw
https://github.com/ag88/stm32duino_rtttl
I used this info for calculating the freq of a note https://www.intmath.com/trigonometric-graphs/music.php
frequency = 440 * 2^(n/12) where when n = 0 is middle A so for a standard keyboard will range from n = -21 to n = 27
My song struct simply stores n and number of beats n will be played for usually (0.25, 0.5, 1, 2, 3) and I use when n = 100 to mean a rest
I am going to add that I can connect up multiple Tesla coils to be able to play cords (a mono tone from each coil but multiple coils playing mono tones at the same time to make a cord). I will use a different timer for each coil.
-
- Posts: 210
- Joined: Thu Mar 07, 2019 6:15 am
- OS: linux
- IDE: eclipse, arduino 1.8.5
- Core: Roger's
- Board: Maple mini, Bluepill
Re: Tesla coil playing music
nice link to the note formula, i'm pretty much a noob about music. i implemented that after buying some cheap beepers (it turns out they are tiny speakers)
https://www.aliexpress.com/wholesale?ca ... Text=12085
rtttl probably isn't a good way to play music, midi is much better than that but significantly more difficult to implement
rtttl files are still rather widely available remnants from the nokia phones days
https://en.wikipedia.org/wiki/Ring_Tone ... r_Language
https://www.mobilefish.com/tutorials/rt ... ation.html
rtttl files are often so small it is possible to create a jukebox on a bluepill, the songs are simply an array of strings
in my implementation, i simply play it out of ram downloaded over usb-serial, stm32f103 has just the right amount of ram and most songs are hardly a k bytes or 2
and your tesla coils display is far more cool
https://www.aliexpress.com/wholesale?ca ... Text=12085
rtttl probably isn't a good way to play music, midi is much better than that but significantly more difficult to implement
rtttl files are still rather widely available remnants from the nokia phones days
https://en.wikipedia.org/wiki/Ring_Tone ... r_Language
https://www.mobilefish.com/tutorials/rt ... ation.html
rtttl files are often so small it is possible to create a jukebox on a bluepill, the songs are simply an array of strings
in my implementation, i simply play it out of ram downloaded over usb-serial, stm32f103 has just the right amount of ram and most songs are hardly a k bytes or 2
and your tesla coils display is far more cool

-
- Posts: 13
- Joined: Mon Mar 25, 2019 1:01 am
- OS: Linux & Windows 10
- IDE: Arduino
- Core: Roger & Official
- Board: Bluepill mostly
Re: Tesla coil playing music
I built a dual resonant solid state Tesla coil. I put the PCBs on-line as open source
https://github.com/profdc9/DRSSTC-PCB-Pack
I use the ATTINY85 interrupter that takes Midi files. Here's an example of my coil playing:
https://www.youtube.com/watch?v=RaoAdWs ... d5HA2F0HZe
https://github.com/profdc9/DRSSTC-PCB-Pack
I use the ATTINY85 interrupter that takes Midi files. Here's an example of my coil playing:
https://www.youtube.com/watch?v=RaoAdWs ... d5HA2F0HZe
-
- Posts: 40
- Joined: Tue Apr 23, 2019 4:38 am
- OS: windows
- IDE: System workbench
- Core: N/A
- Board: Blue pill, STM32F407
Re: Tesla coil playing music
Nice. I enjoyed watching a number of your videos.profdc9 wrote: ↑Thu Dec 12, 2019 4:47 amI built a dual resonant solid state Tesla coil. I put the PCBs on-line as open source
https://github.com/profdc9/DRSSTC-PCB-Pack
I use the ATTINY85 interrupter that takes Midi files. Here's an example of my coil playing:
https://www.youtube.com/watch?v=RaoAdWs ... d5HA2F0HZe
Nice job on the design. I brought my coil as don't really have enough knowledge to design my own
I noticed that your only using 1 coil to play multiply notes at once to create cords. I am going to try is using a different coil for each note in a cord.
What I found was that the coils could play very clear mono tones but have poor sound quality when trying to play multiple notes (waves freq) at once. I have played for Fourier Series to break up the cords into their separate waves and I have very good understanding of how multiple waves add together.
Have you noticed when your coil played pink panther the parts of the song that was a single note were very clear then the parts of the sond that had multiple notes being played at once aren't clear at all??
The tesla coils can't play an analog waves rather it only plays square digital waves. The shape of the wave that is formed by adding up many sounds (different freq) can't be represented by a square digital wave. This is why instead of trying to get just 1 Tesla coil to play cords (multi freq at once) I am going to try using a coil for each separate sound (wave)
-
- Posts: 13
- Joined: Mon Mar 25, 2019 1:01 am
- OS: Linux & Windows 10
- IDE: Arduino
- Core: Roger & Official
- Board: Bluepill mostly
Re: Tesla coil playing music
You should check out http://www.highvoltageforum.net/ . Good people on there if you're interested in building you own tesla coil. I made the PCBs I designed for my coil available, including controller, interrupter, and full-bridge PCBs, so it makes building coils easier.
The DRSSTC (Doubly Resonant Solid State Tesla Coil) has a low duty cycle, with the pulses lasting between 50 to 200 microseconds, and the pulse rate being 600 Hz or less. There's a peak power limit and an average power limit. The full bridge on my Tesla coil is overengineered so peak power is not the limiting factor, however, the residential mains power here in the USA is fairly low, and so I am limited to 2 kW right now of average power. If the pulse rate increases, the duty cycle must decrease in order to keep the average power down, otherwise, you overload the breaker and everything shuts down.
I was thinking of making my own Midi interrupter that would use the STM32F103 which, instead of using the same pulse width for each note, would modulate the pulse width to better approximate a sinusoidal wave, using some kind of sigma-delta modulation to change the pulse width.
The interrupter as it is combines two notes by generating two sets of interlaced pulses at different frequencies. Because these both compete for the total power available to the bridge, there is some interaction between the two notes.
There are Midi interrupters that can control two coils at once that might be useful for you.
The DRSSTC (Doubly Resonant Solid State Tesla Coil) has a low duty cycle, with the pulses lasting between 50 to 200 microseconds, and the pulse rate being 600 Hz or less. There's a peak power limit and an average power limit. The full bridge on my Tesla coil is overengineered so peak power is not the limiting factor, however, the residential mains power here in the USA is fairly low, and so I am limited to 2 kW right now of average power. If the pulse rate increases, the duty cycle must decrease in order to keep the average power down, otherwise, you overload the breaker and everything shuts down.

I was thinking of making my own Midi interrupter that would use the STM32F103 which, instead of using the same pulse width for each note, would modulate the pulse width to better approximate a sinusoidal wave, using some kind of sigma-delta modulation to change the pulse width.
The interrupter as it is combines two notes by generating two sets of interlaced pulses at different frequencies. Because these both compete for the total power available to the bridge, there is some interaction between the two notes.
There are Midi interrupters that can control two coils at once that might be useful for you.
-
- Posts: 210
- Joined: Thu Mar 07, 2019 6:15 am
- OS: linux
- IDE: eclipse, arduino 1.8.5
- Core: Roger's
- Board: Maple mini, Bluepill
Re: Tesla coil playing music
+10 nice ! 
