Skip to main content

Posts

Anti-optimization, hardware crumbling apart, GitHub

Recent posts

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 input. For me…

New functions for LCD and time !

It's been a while since I rewrote them, but I always forgot to post.

This article will be text-only. Sorry, but it will be about code, so I don't have a lot to show, except that "it works" just as shown in the previous vidéo. Go take a look at the previous article !

So, I had that problematic misconception of my previous screen functions. Remember, the whole problem was :
I wrote them as part of the LiquidCrystal_I2C library, which means I had to share my modified library, which is highly unpractical and dirty,I wrote them with delays everywhere, which stopped the whole microcontroller, and this is a huge pain in the ass because nothing looks okay. So the goal was to rewrite them as RTOS tasks, so they can be lauched "in parallel", or at least, they allow the microcontroller to do another task while in a waiting state.

The thing is, on my little 20x4 screen, space is limited. The main feature I wanted was a scrolling feature, like you would find in any seri…

Casing : the front

The student makerspace opened at my University. I wanted to try it out !

For the case, I found some wooden tissue box that would fit my needs. Actually it's a bit big, but better safe than sorry. The thing is, the cut in the middle is super handy to start cutting with a jigsaw.

So I started working my little front panel for my alarm clock. First, I made a model on Solidworks, just to see what it would look like.

For the front panel, there is four cuts, made from the middle cut that was originally present on the box (to let the tissues go out).
2 circular holes for the speakers,1 big rectangular hole for the LCD screen,1 smaller rectandular hole for the clock. Sadly, my 7-segments display never came, I guess it got lost, so I'll have to deal with the seller to try to have them send it again. :(

For the moment, I didn't do any cuts for the buttons, but they will surely be on the top side of the box. This is because, when you want to press a button, you don't want the hold…

First steps with a screen

I haven't written anything for months ! But lots of things happened.

First, I made my first steps with the STM32 and the KaRadio communication through serial. It ran into lots of trouble regarding the Arduino Code, and the limitations of writing with Arduino only. In order to get it working, I used the existing code from Jean-Pierre Cocatrix (the creator of KaRadio) for his own STM32 with full LCD screen and IR remote. As I read it, I slowly started to understand that he used special functions from the FreeRTOS implementation for STM32, which allowed him to use timers to schedule multiple functions to be run in parallel. I though it was brilliant, and since I had problems with the serial buffer size with regular programmation (sorry not to give more information about this, there is some on Facebook but I desactivated my account some time ago), I ended up adapting Jean-Pierre's code to use the FreeRTOS implementation of scheduled tasks for the different tasks of my program. It …

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 Blue Pill page …

KaRadio DVT-01

I packed everything in my little case.

It's really a mess in there, with cables flying around and every card floating, not fixed on the inside. But it looks quite cool ! I removed the old radio antenna to use its hole to pass my USB cable.

Here's how it looks !






As you can see, I let the rotary knob (it's a simple angular potentiometer, in fact) from the amplifier out. It holds with a little nut that was provided with it. The buttons you can see are all fakes, they belonged to the old radio and I forgot to remove them (in fact they're simply glued to the back). 
Maybe I'll find some tools to make a nice-looking front panel when my stuff arrives. I'll ask people around me to lend me their tools...  In the end, the radio would have a 20x4 LCD screen to display artist + title and useful infos (like the IP or the volume when you change it from the website, maybe). I think I'll need two more buttons to change the station. I won't bother myself to add a volume…

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 "Aud…

Adding some speakers, part 1

I've got speakers, an amplifier, audio transformers, and a KaRadio.
Let's have fun with that !

So in order to connect everything, I took the plugs from the original radio and soldered them along with headers, to connect things easily.



Then I soldered headers on the amp side, easy connection. And I wired them together. I also soldered a USB cable on the power input of the amp board.

On the VS1053 side, I have a Arduino-shaped board, so I took advantage of some unused pins to wire the output speakers to 3 pins. Again, the easier, the better... Except that soldering these 3 little cables was FRIGGING HARD, they kept swinging and moving around, it was hellish. But oh well, it's done now.



Finally, I took 3 wires to link the VS1053 to the amp (it's a PAM8403). The pair ESP8266 + VS1053 has its own power supply (it's a USB battery) while the amplifier has a separate USB power supply.



Aaaaaaand it works very well :)

I tried to put the whole on the same power supply and I g…

A kitchen table goes, another comes

I'm moving out of my appartment.

Since my kitchen table couldn't go with me, I left it, so you won't have the marvelous tablecloth full of little cakes anymore. :'(

Hopefully, in my room where my mother lives, my desk is an old kitchen table. So in the end, I'm still building stuff on a kitchen table, which is nice.

Some pictures of what I got

I found the radio fully working in a flea market for 2€. :)
The WeMos D1 mini costs 3€, the VS1053 8€ (but there are cheaper models).

From the original radio, I'll keep the two speakers. Although they're not the best ones you could dream of, they'll do the job for the moment. I may be able to re-use the buttons and rotary knobs (they work as spammers-buttons : each time you rotate a little, it's like a button is pushed). I'll get rid of the cramped screen, as I have a nice LCD 20x4 I2C screen waiting in a box.
But this pleather is so nice, and the size is just perfect ! Plus, there's quite some room inside.

Here's some pictures. I wasn't lying : it's really a kitchen table. I mean, in which other table would you put a tablecloth full of little cakes ? :D



Start of a blog - KaRadio Project

Hello everyone !

I decided to start a blog to keep a track of my electronics stuff I want to build.

I found the KaRadio Project, that aims to build a webradio - you know, the thing, not the stream. A real object that connects to the Wi-Fi and plays your favourite radios.

Some useful links :

KaRadio's GitHub : https://github.com/karawin/Ka-RadioThe Hackaday Page : https://hackaday.io/project/11570-wifi-webradio-with-esp8266-and-vs1053The KaRadio Group on Facebook (very active !) : https://www.facebook.com/groups/162949914181385/

As I tried a first prototype, I was really amazed what the main chip, the ESP8266, was capable of. So I decided to buy second-hand stuff in flea market to build a nice little webradio.

For the moment, I have my prototype working, but most of the work lies ahead : adding control through a second microcontroller (MCU for short), adding buttons, pushing everything into a case, adding energy support... heh, I'm hyped !

Nonetheless, I will have to wait a litt…