I built a Class D AM transmitter with mostly recycled parts based on what I learned when I wrote the previous post. The only parts that weren't junk were the TC4426A MOSFET driver and the FPGA board.
Unlike in the virtual example, it needs the square wave to range from +/- 1 instead of just 0-1. To do that, you need 2 MOSFET's connected to the sides of a center-tap transformer and controlled by opposing square waves. That makes it so both sides are alternately sending power to one side of the transformer while the other one is off. Since they have opposing polarity, they make a fluctuating magnetic field. At first I thought that you could do it with just 1 MOSFET but that would be Class E and you would want to use an oscilloscope to make sure that it's turning off exactly when the output crosses 0.
Here is a schematic of what I built
TR1, TR2, and L1 are from PC power supplies, with TR1 being optimized for high switching frequencies around 500 kHz instead of 60 Hz. TR2 was from a different power supply and I chose it because one side had high inductance.
Q1 and Q2 are the MOSFET's. As you can see, I used 6[0]R280E6's from a switching power supply. These are rated for up to 600 volts and since the max RF stage voltage is 56, even the inductive spike from the output transformer can't burn them out. They're wired with common source (negative) so I could do push-pull with both of them operating as low-side switches which meant that I didn't have to do anything annoying like having one N-MOSFET on the low side and one P-MOSFET on the high side and have to use a high-side driver and bootstrap components for the higher voltage on the high side. P-MOSFET's are also slower so this means both sides switch equally fast.
L1 was a random inductor that I found. It's supposed to stop RF from going back to the power supply since switching power supplies can misinterpret that as an overload and turn off for protection. I originally tested this with a 19-volt switching power supply and it kept turning off until I added that. It eventually started happening again so I started using LiFePO4 (lithium iron phosphate) batteries instead.
TR2 was another random power supply transformer. This is used as a modulation transformer. In the previous post, I talked about using the audio to change the voltage to the RF stage. I thought about using a 6[0]R190E6 MOSFET for that since I had one and got my FPGA board to read WAV audio from a microSD card and play it to the headphone jack with PWM but decided to use a modulation transformer and stereo so I could test the RF stage sooner.
A modulation transformer works by passing the power supply voltage as DC in series and inducing the audio on it so you have fluctuating DC. You just connect a high-power speaker driver to the other side. I used a stereo from by the road and connected the left speaker output to the transformer. With 12 volts from 1 battery, I didn't have to turn up the volume much before the signal started clipping. You would want to turn it up more with a higher input voltage. This is because you want AM to be just below clipping and a higher DC input voltage needs to fluctuate more to get close to 0.
For the DDS, I needed 2 opposing square-wave outputs. This sets the output frequency. You can divide the main clock evenly which gives you fractional powers of 2 like half, quarter, etc. or you can generate arbitrary frequencies with a phase accumulator and tuning word. I wrote some Verilog code that generates opposing square waves on 2 GPIO pins based on a tuning word. The tuning word is
round((desired_frequency / clock_frequency) * 2bits)
where bits is how many bits are in the phase accumulator which is a variable or "register" as it's called in logic design that holds the current phase offset. To generate the output at whatever frequency, you just output the most-significant bit (MSB) while adding the tuning word on every cycle of the main clock. For example, to get 600 kHz with a 32-bit phase accumulator, the tuning word would be round((600000 / 12000000) * 4294967296) or 214748365 and I would just have to add that to the phase accumulator on every 12 MHz clock cycle. It's going to overflow and wrap which is what we want.
C1 is a bypass capacitor. It lets the MOSFET driver quickly get a lot of power. The 12-volt power supply can deliver enough but it takes time to get it over the wire and the power supply has to notice that the voltage is lower and compensate and MOSFET's have to switch really fast so this capacitor gives it a quick source while it waits for the power supply to recharge it.
R3 and R4 are gate resistors. They're supposed to help with ringing so the MOSFET gate drive stabilizes faster.
R1 and R2 are pulldown resistors. They guarantee that the MOSFET's will be perfectly off with nothing connected. This is important because MOSFET gates are capacitors and they can randomly turn on a bit from tiny charges in the air or from your finger. This is bad because you only ever want MOSFET's to be perfectly on or off. 10k ohms is enough to keep them off without wasting much power from the gate driver.
The TC4426A is an inverting driver so I think it would turn the MOSFET's on with a logic 0 input (I didn't test that because I didn't want to burn them up). This means that you have to be extremely careful about how you turn on the entire setup. This means you can't turn on the RF stage with the MOSFET's until you're sure that the FPGA is on and supplying opposing logic signals to the driver. If it's not supplying 2 signals, then one of the MOSFET's would probably stay on if the driver sees a logic 0. If one or both of them stay on, that would make a short circuit through the coil. I think a switching power supply would see that as an overload and turn off but large batteries would probably just melt something. MOSFET's often fail on which means they're stuck on when they burn out so you would have a short circuit until you replace it. A large battery would supply a lot of current and probably melt something. Another problem is that the TC4426A seems to have floating inputs so if you don't also use pulldown resistors on the FPGA side, it just amplifies whatever value it sees which can also burn out the MOSFET's. I didn't want to use pulldown resistors on the FPGA side so I was just really careful to not turn on the RF stage until I made sure the DDS inputs were connected.
For the antenna, you would want to either ground one side and connect an antenna to the other, or connect both sides to a dummy load. I currently live far enough from everyone else that I was able to just use a short wire for a while without worrying about building a filter until I accidentally touched one side and burned myself. I realized that the feeling and the mark it left were almost the same as when I accidentally touched a ballast output wire for one of my sodium streetlights and that gave me the idea to use a sodium light as a dummy load. Sure enough, it lit up and fluctuated with the audio which looked cool.
I used a large Pentium 4 heatsink for the MOSFET's. I also saved a thermistor from one of the power supplies and verified its output in ice water and room air with a voltmeter and an online calculator. The heatsink is cooled with a 120/240-volt EC (electronically-commutated) fan.
The yellow and blue are the DDS inputsThis looks like a mess so as the YouTuber grav3yardgirl would say, "Does this THING really WORK?" Yes it does and I took some SDR recordings to demonstrate.
As you can see, after I was sure that it was safe with 12 volts, I tried 24 volts and it still worked and the light got brighter. After that, I tried it with my 56-volt power supply and it still worked and the light got so bright that it started turning a bit yellower and making a dot crawl pattern before resetting the power supply over and over. I think this was because it finally got hot enough to vaporize the sodium which lowered the resistance and made it use more power than the 56-volt power supply could handle. A family member also reported hearing buzzing in their wired headphones toward the end.
Here is a video on Odysee showing the signal and audio quality. It was really quiet (probably low modulation) so I had to turn up the volume after recording it. I left some silence at the beginning so you could see how clean the carrier is.
https://odysee.com/class_d_am_transmitter_test_20260824:5b4a5b7bbbcb57dcf65cd6c86562fb9d0424d61f













No comments:
Post a Comment