Skip to main content

Adding some speakers, part 2

I added the audio transistors.

Before diving into this modification, I wanted to see how deteriorated the sound is when you try to link everything on the same power supply WITHOUT transistors. So I made this little video. You can hear the difference !



First, I noticed that my three little wires (on the output of the VS1053) were badly soldered and caused a short-circuit somewhere. So I removed them, and replaced them with a naked Jack plug. (I took it from a selfie stick. True story. These selfie sticks have an audio Jack plug to be able to take a shot from a button near the hand, that acts just like a button from headphones with mic. End of the story, back to business :p )

I wired the output of the VS1053 to the input of the transformers, and I wired the output of the transformers to the input of the PAM8403 (the amplifier). Since on the input and on the output, they have common ground between the two channels, I kept the common ground. You can see a rough scheme below (the "Audio scheme" on the bottom).

I also replaced the power source I soldered on the PAM8403 (the amplifier) by a nice socket.
Then, I wired with pluggable wires the power input of the PAM8403 with the one on the VS1053 (which is also the one on the ESP8266), so that the 3 components are powered in parallel by the same power input (the USB from the ESP8266 actually). That's the "Power scheme" on the top you can see below.


At first, I tried to put these audio transformers without any special care, and I placed them very close to each other. I noticed that there was a leakage of the left channel in the right channel, and the other way around too ! You could hear a little the left channel in the right speaker, and the right channel in the left speaker. I assumed that these transformers are not very well isolated and they leak their magnetic field into each other ! To avoid this magnetic field leakage, I placed them the farthest I could (like 6cm apart) and then I couldn't hear that audio leakage. Be careful of where you place your audio transformers !

Here's a little close-up :



Finally, putting it together, my speakers have quite a good punch !


After that, I have to wait for my microcontrollers to arrive to develop my interface. I de-soldered some push-buttons from the original radio, and two rotary knobs. I'm pretty sure the rotary knobs are delivering some Grey code, I don't know if I will use them. I mean, isn't is simpler to use an old scroll wheel from a mouse ? Each time you roll, it's like a button is pressed. You get 2 buttons, one for rolling forward, one for rolling backward. I'll think of this.

In the future, I'll have to do some work to make a beautiful front face, with room for the screen and for some buttons. But I'm afraid that won't be anytime soon (my microcontrollers haven't left China yet :(   )

See you !



Comments

Popular posts from this blog

Flashing an STM32 "Blue Pill"

Flashing this STM32 "Blue Pill" board took me 5 hours. I finally recieved my microcontrollers. I have at disposal : A brand new WeMos D1 Mini (it's a smallish NodeMCU) An Arduino Pro Mini (it acts just like a Leonardo, but it lacks some interesting pins sadly :(  ) An STM32F103C8T6, I'll call this the Blue Pill for short. The Arduino Pro Mini has an Arduino bootloader out-of-the-box, so  I could play with it directly. It's nice ! Still, it lacks the double Serial of the original Leonardo, and most importantly, there's no A4 and A5 pins, so libraries for I2C won't work without modification. But the Blue Pill needs more work. Basically, I followed the instructions on this site : http://wiki.stm32duino.com/index.php?title=Installation Since it's quite complicated, consider the following as a tutorial to set up your Blue Pill. I tried different things, the following has worked for me. Before doing anything software-related, while reading the B

Anti-optimization, hardware crumbling apart, GitHub

Today, short post about deceiving software. Remember when last time, I said I had to do optmizations on my code ? Well I tried. And it went worse than I expected ! First, I tried to gather similar codes in some tasks, but it came out they were too heavy for FreeRTOS to handle them correctly, resulting in heap panic... So trying to enhance my code, I worsen it ! So I hard to roll it back. Then, I tried to implement real mutexes for some resources that are shared among the tasks, in particular the screen (and maybe the UART one day, but I can manage to use it only in one task, if I split it in several functions). When I though I understood it and implemented it correctly, it turned out to make the STM32 crash at bootup, and being non recognizable by my PC anymore ! So again, I had to rollback to the previous version. I'm still trying to figure out how to re-design my code, while keeping it runnable on that picky Blue Pill. You can FINALLY find my code on Github ! I suggest

Buttons and alarm

Now I have my buttons. And it didn't go smooth sailing. Before all, let's try to review what I want and how to do that : I want buttons to control the KaRadio. 6 buttons are enough. We will detail them a bit afterwards. I want my buttons to also set an alarm clock. This should stay visible, and should use the already implemented buttons to be modified and set. I want that any push in a button results in changes that are visible on the LCD screen. If the volume changes, I want to see it. If the station changes, well that's already implemented. First, I went to read the documentation on how to operate the GPIO. I knew I needed only to read digital states of the GPIO. At first, I found this document straight from Maple docs : http://docs.leaflabs.com/static.leaflabs.com/pub/leaflabs/maple-docs/0.0.12/libmaple/api/gpio.html It's quite dense, but there is some information. GPIOs must be initialized with gpio_init(), then you need to set their state to output or in