A loudspeaker with a supercapacitor PCB next to it

Hackaday Prize 2023: Supercapacitors Let Solar Speaker Work In Darkness

Solar panels are a great way to generate clean electricity, but require some energy storage mechanism if you also want to use their power at night. This can be a bit tricky for large solar farms that feed into the grid, which require enormous battery banks or pumped storage systems to capture a reasonable amount of energy. It’s much easier for small, handheld solar gadgets, which work just fine with a small rechargeable battery or even a big capacitor. [Jamie Matthews], for instance, built a loudspeaker that runs on solar power but can also work in the dark thanks to two supercapacitors.

The speaker’s 3D-printed case has a 60 x 90 mm2 solar panel mounted at the front, which charges a pair of 400 Farad supercaps. Audio input is either through a classic 3.5 mm socket or through the analog audio feature of a USB-C socket. That same USB port can also be used to directly charge the supercaps when no sunlight is available, or to attach a Bluetooth audio receiver, which in that case will be powered by the speaker.

A speaker's passive radiator next to a solar panel
The solar panel sits right next to the passive radiator before both are covered with speaker fabric.

The speaker’s outer shell, the front bezel, and even the passive radiator are 3D-printed and spray-painted. The radiator is made of a center cap that is weighed down by a couple of M4 screws and suspended in a flexible membrane. [Jamie] used glue on all openings to ensure the box remains nearly airtight, which is required for the passive radiator to work properly. Speaker fabric is used to cover the front, including the solar panel – it’s apparently transparent enough to let a few watts of solar power through.

A salvaged three-inch Bose driver is the actual audio source. It’s driven by a TI TPA2013D1 chip, which is a 2.7 W class-D amplifier with an integrated boost converter. This enables the chip to keep a constant output power level across a wide supply voltage range – ideal for supercapacitor operation since supercaps don’t keep a constant voltage like lithium batteries do.

[Jamie] has used the speaker for more than nine months so far and has only had to charge it twice manually. It probably helps that he lives in sunny South Africa, but we’ve seen similar solar audio projects work just fine in places like Denmark. If you’re taking your boombox to the beach, a sunscreen reminder feature might also come in handy.

Upcycled Practice Amp Build Goes To Eleven

What do you call someone who gives the toddler in your life a musical instrument as a gift? In most cases, “mortal enemy” is the correct answer, but not everyone feels quite so curmudgeonly, and might even attempt to turn up the volume a bit. Such is the case with this wonderfully detailed practice amp for the grandkids’ electric ukelele.

The aptly named [packrat] [Professor Mayhem] really made this build a tour de force of scrap bin sourcing. The amp is built around a module salvaged from an old TV, a stereo Class-D amp that was modified to provide 30 watts output and a volume control. The driver came from a flood-damaged speaker unit, and the power supply from a gutted wall wart. The case was built with scrap plywood and covered with pebble-grain fabric to give it that pro audio look, while the chassis for the electronics was bent from a piece of sheet steel.

But it’s the tiny details that really sell this project. Everything from the pilot light to the pointer knob screams 1970s, as do the painstaking front panel lettering and vinyl “Monkeydyne” logo. [Professor Mayhem] even went the extra mile to create an etched-brass serial number plate, a mock specs and safety label, and even a QA inspection tag that was (sort of) stapled inside the cabinet.

We tip our hats to [Professor Mayhem] for this four-month labor of love and obvious nostalgia trip, which the kids are sure to love. [Professor Mayhem] does admit that some will argue with his decision to use a Class D amp and a switch-mode power supply, but let’s be real — for the application, it’s probably more than sufficient.

Thanks for the tip, [packrat].

Know Audio: Amplifier Nuts And Bolts

As we’ve followed a trail through Hi-Fi and audio systems from the listener’s ear towards the music source, we’ve reached the amplifier. In our previous article we gave a first introduction to distortion and how some amplifier characteristics can influence it, and here we’ll continue along that path and look at the amplifier itself. What types of audio amplifier circuits will you encounter, and what are their relative merits and disadvantages?

A Few Amplifier Basics

Horowitz and Hill's Transistor Man
Horowitz and Hill’s Transistor Man

If you know anything about a transistor, it’s probably that it’s a three terminal device whose output pin forms part of a potential divider whose state is dependent on what is presented to its input pin. The Art of Electronics had it as a cartoon of a man standing inside a bipolar transistor and adjusting a variable resistor between collector and emitter while watching an ammeter on the base.

Properly biased in its conducting range, a transistor can behave as a linear device, in which the potential divider voltage moves in response to the input in a linear relationship, and thus the voltage on the output is an amplified version of the voltage on the output. This is the simplest of transistor amplifiers, and because different types of amplifier are referred to by lettered classes, it’s known as a class A amplifier. Continue reading “Know Audio: Amplifier Nuts And Bolts”

ESP32 Becomes Music Player In Under 40 Lines Of Code

The demo code for [XTronical]’s ESP32-based SD card music player is not even 40 lines long, though it will also require a few economical parts before it all works. Nevertheless, making a microcontroller play MP3s (and other formats) from an SD card is considerably simpler today than it was years ago.

Part of what makes this all work is I2S (Inter-IC Sound), a format for communicating PCM audio data between devices. Besides the ESP32, at the heart of it all is an SD card reader breakout board and the MAX98357A, which can be thought of as a combination I2S decoder and Class D amplifier. The ESP32 reads audio files from the SD card and uses an I2S audio library to send the I2S data stream to the MAX98357A (or two of them for stereo.) From there it is decoded automatically and audio gets pumped though attached speakers.

A few economical components, and only a handful of connections between them.

It’s amazing how much easier audio is to work with when one can take advantage of shuffling audio data around digitally, and the decoder handles multiple formats with an amplifier built in. You can see [XTronical]’s ESP32 player in action in the video embedded below.

Continue reading “ESP32 Becomes Music Player In Under 40 Lines Of Code”

Tiny Amplifier With ATtiny

Small microcontrollers can pack quite a punch. With the right code optimizations and proper use of the available limited memory, even small microcontrollers can do things they were never intended to. Even within the realm of intended use, however, there are still lots of impressive uses for these tiny cheap processors like [Lukasz]’s audio amplifier which uses one of the smallest ATtiny packages around in the video embedded below.

Since the ATtiny is small, the amplifier is only capable of 8-bit resolution but thanks to internal clock settings and the fast PWM mode he can get a sampling rate of 37.5 kHz. Most commercial amplifiers shoot for 42 kHz or higher, so this is actually quite close for the limited hardware. The fact that it is a class D amplifier also helps, since it relies on switching and filtering to achieve amplification. This allows the amplifier to have a greater efficiency than an analog amplifier, with less need for heat sinks or oversized components.

All of the code that [Lukasz] used is available on the project site if you’ve ever been curious about switching amplifiers. He built this more as a curiosity in order to see what kind of quality he could get out of such a small microcontroller. It sounds pretty good to us too! If you’re more into analog amplifiers, though, we have you covered there as well.

Continue reading “Tiny Amplifier With ATtiny”

A Class D Amp Made From Scrap

[Boolean90] needed an amplifier for a subwoofer, and had a lot of parts sitting around in a scrap bin. His project, a Class D sub amp made out of scrap, is a great example of what you can build with the right know-how and a very large pile of junk.

With digital logic and PWM chips, a Class D amp is one of the simpler ways to get a lot of amplification easily in an efficient package. It’s really not that complicated; an audio signal is turned into a PWM’d square wave, this is sent out to a Mosfet bridge, and finally out to the speaker.

Most Class D amps have a switching frequency of hundreds of kilohertz to the Megahertz range, but since this is an amplifier for a subwoofer that has a cutoff frequency of about 1kHz, the switching frequency doesn’t need to be quite as fast. [Boolean] is using a 50kHz carrier frequency; it’s more than high enough to recreate low frequencies.

With the completed project, [Boolean] has an extremely loud amplifier that has around 75-150W of output power. The subwoofer is only rated for 200W, but with the volume [Boolean] is getting, this isn’t an amp he’ll be rebuilding anytime soon.

[Afrotech]’s Guide To Class D Amplifiers

classd

Hang around in any of the many guitar or audiophile forums or discussion boards for long enough, and eventually you’ll come across the arguments over amplifier topologies. One of the more interesting and useful of these classes of amplifier is class d – they’re extremely efficient and when well designed can sound pretty good. [Afrotech] is here to show you how they work, and how to build a 15 Watt amp using a $3 class d amplifier chip.

The very definition of an amplifier is taking a low power signal and transforming it into a high power signal. A great way to modulate a high power signal very quickly is by modulating a square wave with pulse width modulation. A class d amplifier takes a low power input signal, uses it to modulate the duty cycle of a high power square wave, and with a little filtering, amplifies the low power input.

To demo this, [Afrotech] used TI’s TPA3122 class d amplifier chip. It’s a pretty cheap chip for being a 15 Watt stereo amplifier, and the circuit is simple enough to build on a breadboard. With a few caps, resistors, and a pair of inductors, [Afrotech] built this one-chip amplifier that’s capable of powering some pretty big speakers. It’s also very efficient – no heat sink required.

Although class d amps are extremely efficient. there are a few people out there that say because the amplifier is basically a filtered square wave, you’ll be able to hear a difference in the audio over class a or class ab amplifiers. This led to the development of class t amplifiers, basically a class d amp with a higher switching speed (Megahertz for class t, a few hundred kilohertz for class d). Still, if you need a cheap amplifier for a DIY boombox or any other high power application, you could do a lot worse than a simple class d amp.

Continue reading “[Afrotech]’s Guide To Class D Amplifiers”