Jump to content

UI for a musical tesla coil

Hi! I am almost done with building my tesla coil, the only thing that is left is a UI, but while coding i ran into a problem. I can't figure out how to identify songs and play them. I am using Arduino Mega 2560 with an LCD and an SD card module.

Main code:

int forward = 22;
int back = 23;
int Stop = 24;
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;



#include <LiquidCrystal.h>
#include "SD.h"
#define SD_ChipSelectPin 53
#include "TMRpcm.h"
#include "SPI.h"

 // LCD RS pin to digital pin 12
 // LCD Enable pin to digital pin 11
 // LCD D4 pin to digital pin 5
 // LCD D5 pin to digital pin 4
 // LCD D6 pin to digital pin 3
 // LCD D7 pin to digital pin 2
 // LCD R/W pin to ground
 // LCD VSS pin to ground
 // LCD VCC pin to 5V
 // 10K resistor:
 // ends to +5V and ground
 // wiper to LCD VO pin (pin 3)
//CS ---------------------->> 53
//SCK ---------------------->> 13
//MOSI -------------------->> 51
//MISO--------------------->> 50
//VCC --------------------->> +5v
//GND--------------------->> Arduino's Ground


LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
TMRpcm tmrpcm;

void setup()
{

pinMode(forward, INPUT);
pinMode(back, INPUT);
pinMode(Stop, INPUT);

  
lcd.begin(16, 2);
tmrpcm.speakerPin=9;
Serial.begin(9600);
if(!SD.begin(SD_ChipSelectPin))
{
  Serial.println("SD fail");
  return;
}
tmrpcm.setVolume(6);


}

void loop() {
  lcd.setCursor(0, 1);
  lcd.print("Now Playing:");

}





Thank you for reading, I really appreciate it.

Link to comment
Share on other sites

Link to post
Share on other sites

How do you play music with what is essentially a spark generator on steroids?

Jeannie

 

As long as anyone is oppressed, no one will be safe and free.

One has to be proactive, not reactive, to ensure the safety of one's data so backup your data! And RAID is NOT a backup!

 

Link to comment
Share on other sites

Link to post
Share on other sites

On 5/25/2019 at 9:52 PM, Lady Fitzgerald said:

How do you play music with what is essentially a spark generator on steroids?

To open Collectror-Emmiter path you need to feed power to Gate, but if you feed it normal music, nothing would happen. The solution is to create a PWM signal with variable duty cycle and frequency and feed it to the gate, that way, the H-Bridge acts as an amplifier and you can feed it directly to the Primary winding.

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, _SAITAMA_ said:

To open Collectror-Emmiter path you need to feed power to Gate, but if you feed it normal music, nothing would happen. The solution is to create a PWM signal with variable duty cycle and frequency and feed it to the gate, that way, the H-Bridge acts as an amplifier and you can feed it directly to the Primary winding.

Ok, now I'm really confused? Where does the sound itself come from? A several hundred thousand volt speaker?

Jeannie

 

As long as anyone is oppressed, no one will be safe and free.

One has to be proactive, not reactive, to ensure the safety of one's data so backup your data! And RAID is NOT a backup!

 

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, Lady Fitzgerald said:

Ok, now I'm really confused? Where does the sound itself come from? A several hundred thousand volt speaker?

Arduino makes the PWM signals which gets amplified by the MOSFET drivers to drive the Gates of IGBTs, which further amplifies the signal and is fed to the Primary Winding. A tesla coil basically is a High-Voltage transformer, which converts a couple dozen volts to 10s and 100s of thousand volts.

Link to comment
Share on other sites

Link to post
Share on other sites

36 minutes ago, _SAITAMA_ said:

Arduino makes the PWM signals which gets amplified by the MOSFET drivers to drive the Gates of IGBTs, which further amplifies the signal and is fed to the Primary Winding. A tesla coil basically is a High-Voltage transformer, which converts a couple dozen volts to 10s and 100s of thousand volts.

I know what a tesla coil is; I even made one when I was a kid over half a century ago.

6 minutes ago, Unimportant said:

The plasma arc itself can vibrate the air when modulated

https://www.youtube.com/watch?v=2mqEkVenq_Y

 

Thanks! Now I get it.

Jeannie

 

As long as anyone is oppressed, no one will be safe and free.

One has to be proactive, not reactive, to ensure the safety of one's data so backup your data! And RAID is NOT a backup!

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×