• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required as is 20 years of participation in forums (not all true). There are daily reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

My first PCB - a micro streamer - advice welcome

MarcosCh

Major Contributor
Joined
Apr 10, 2021
Messages
1,818
Likes
1,470
Hi all, I am in the process of drafting and ordering my first PCB ever, and thought i would post it here for suggestions or important deficiencies before sending out to print in China.

This is a project I make for fun. I came across recently of that very cool project squeezelite-ESP32 that shows you how to build a squeezelite streamer around a ESP32 microcontroller.


These things are tiny and i find fascinating that with one of them and a couple of cables you can build a fully working wifi and bluetooth streamer for less than 6 euros!

1675517597982.png

A raspberry pi zero looks gigantic besides this.

By coincidence, i am in the need of a streamer with a toslink output and i thought that for the money a spdif hat for my raspberry pi costs, i can build a squeezelite-ESP32 with toslink output and have a beer with the rest. And it works! I have it working attached to the programmer board that i got for it. As you can see, you just need to attach a toslink emitter to the power, ground and a gpio pin and you are in business! I still can't believe it.

1675517849273.png


Well what i need now is to have it working stand alone, without having to plug it to the programmer board. To achieve this, i want to make a small PCB with a voltage regulator based on AMS1117 (5V from a usb charger to 3.3V) and the possibility to add the toslink emitter and a spdif coax output. For the coax, it is necessary to bring down the voltage of the GPIO from 3.3 to 0.6V (as explained in the project github). I have not tried coax myself yet.
The PCB must fulfill the following:
1. that it is as small as possible, so i can glue the streamer to the back of the dac. My current draft is 18x65 mm.
2. the most important and difficult: That i can still insert the ESP32 in the programmer after soldering it to the PCB in case i need to flash it again.
3. versatile enough that i can build toslink and/or coax, that i can power it with 5V or leave the voltage regulator unpopulated and feed 3.3V directly
4. I also added 6 header pins to be able to use the two i2s ports that the ESP32 has (not necessary for the squeezeplayer project though)

What i think is the trickiest part is to be able to insert it in the programmer again. The programmer has "spring" pins that fit the two castellated sides of the ESP32. The only solution i can think of is making the pcb as thin as possible and 1 mm narrower than the ESP32 (that is, 17 mm wide instead of 18 mm). The problem in this case is how to solder it. I thought if i leave some holes coincident with some of the pads of the microcontroller, i can solder through the hole. I have no idea how this is going to work and that's why i am posting this here. Another option would be to be able to extract the module, but i cannot think how without making the pcb too big...

Other features are a header pin under the AMS1117 in case i need to skip it and use 3.3V source (i.e. a raspberry pi) and two header pins under the USB connector in the probable case that i don't manage to solder it (it is tiny) and i opt to just solder two cables or two header pin connectors. I left pin 1 disconnected not to short 5V to ground if i finally add the USB connector. i will solder the small bridge only if i use the header pins instead of the connector.

Well, long story short, this is the first time i use kicad, i had no clue of what a voltage regulator or a voltage divider was until this week, and the attached is where i am. Any advice is welcome. Note that i will only use 100 ohm resistors, i don't have other values.

These are the two very simple circuits on the board:
5V to 3.3V:

Voltage-Regulator-Circuit-5V-to-3.3V.png

Somewhere i read that the ams1117 is more stable using 22uF condensers, but that goes far beyond my understanding, so i will give it a try with what i have (10uF) unless someone tells me i must use more than that... Could i use 2x10uF in parallel??

spdif coax connector:

100nF
GPIO ----210ohm-----------||---- coax S/PDIF signal out
|
110ohm
|
Ground -------------------------- coax signal ground
 

Attachments

  • streamer.zip
    23.2 KB · Views: 24
Last edited:
OP
M

MarcosCh

Major Contributor
Joined
Apr 10, 2021
Messages
1,818
Likes
1,470
Decided to mount and test the circuit without pcb (yes, soldering smd components to free standing cables, never thought i would manage) and after a lot of troubleshooting i realized i missed a part that is shown in the datasheet of the programmer. The enable pin must be connected to power with a 10K resistor and to ground with a 0.1uF capacitor.

I don't understand what that does, but without it, it doesn't boot.

1675614917000.png


Fixed now and working, but must add that to the PCB draft.

I find surprising that this detail is not mention anyware i could find in the internet, i thought these modules were super popular in DIY circles....
 
OP
M

MarcosCh

Major Contributor
Joined
Apr 10, 2021
Messages
1,818
Likes
1,470
And the PCBs arrived!

1677327363205.png


I eventually ordered one partially assembled (it adds very little to the cost and i was afraid of soldering the small SMD). That is the big one, it can output both toslink and coax and has a voltage converter to plug to a USB charger. I also added a few pads for programming and potential i2s inputs and outputs in the future. The medium is only coax and keeps the 5V to 3.3V circuit and the smallest one is toslink only and 3.3V only.

The picture does not really show it but they are super small:

1677328023419.png


Yes, it is one cent, not one euro :D

It took me like 20 min to add the ESP32 module and the toslink emitter to one of the partially assembled ones. It was easier than i thought. castellated edges are very noob friendly (first IC that i solder ever):

1677327045254.png


Plugged it, and in a couple of seconds (this is the magic of microcontrollers vs computers) it was working!!!

1677326820172.png


I can't believe it guys, what a time to be a tinkerer...

There are, however, a few learnings and things that i would do differently today, and the first one is already evident in the last picture. That led is way too bright. The good thing is that this particular one is aimed to be used in the summer outside, so not a big deal...
 

Marc v E

Major Contributor
Joined
Mar 9, 2021
Messages
1,105
Likes
1,565
Location
The Netherlands (Holland)
Maybe this is a great time for hifi tinkering again. This time not in cables, amps or speakers, but more on the streamer and dsp side, everything that relies on software.
 
OP
M

MarcosCh

Major Contributor
Joined
Apr 10, 2021
Messages
1,818
Likes
1,470
Maybe this is a great time for hifi tinkering again. This time not in cables, amps or speakers, but more on the streamer and dsp side, everything that relies on software.
Agree. And i wish i had the base knowledge to understand stuff faster and not to have to spend 2 hours dissecting a voltage divider or reading the datasheet of a transistor because the one in the tutorial is not available.... but i guess there is where part of the fun is...

It is truly amazing the kind of things you can make with a bit of reading, patience, and asking around. Next project: an automatic i2s/spdif source selector hat for raspberry pi. wish me good luck :D
 
Last edited:
OP
M

MarcosCh

Major Contributor
Joined
Apr 10, 2021
Messages
1,818
Likes
1,470
KiCAD gets pretty addictive, and i could not help but starting my second PCB project....

My audio system is built around a raspberry pi 4b running camilladsp. Nowadays i do the actual DSP in a minidsp 2x4HD running Dirac Live, but still use the pi as streamer/hub/volume/tone control etc. It looks more or less like this:

TV/HDMI extractor/other sources -> toslink switch -> minidsp 2x4HD -> raspberry pi -> DAC -> amp

Over time, i have been adding switches so that all the devices turn on and off pressing one remote control button, displays, etc, and even though everything is hidden in a cabinet, every time i open it, someone starts rising questions about "all those cables.... is this safe..." :rolleyes:...
So i have decided to bring all these additional circuits to one PCB together with the pi. And this is the result so far:

PCB project.jpg

PCB project 2.jpg


The pi is going to be upside down with the header plugged to a female header. I need to cut the PCB because the USB ports of the pi are taller and would not fit otherwise. There will be a duplicate of the 40 pin header so that i can test other stuff without needing to take it apart.

A raspberry pi pico W controls the on/off of the system shorting the necessary gpio pins of the pi to ground via optocoupler switches (on the contrary to the rest of the devices, the pico will be on 24/7).

bottom left there are mosfets that will power/unpower the external cards that have their own DC power (the minidsp and a motu ultralite mk5). There is a lot of space left besides that because i dont know yet if i am going to use the mosfet with the Motu. I want to make sure first with their customer support that i am not going to damage it.

To the top, besides the fan, is the most interesting part, and the only one that i have not tested yet: is is a small i2s to spdif plus spdif selector based on a wm8805 chip. With this, i will take the i2s audio from the streamer running in the pi, convert it to spdif and select between this and all the other spdif inputs. It can even be made so that it switches automatically when it detects a valid spdif signal and locks to it.
I am not sure if i will manage to make it work and i need to thank @phofman that is helping me a lot to understand the details of how these things work. thanks man!!

To the left there is a "i/o expansion pcb" with more spdif inputs and outputs. As of today i only need two toslink and one coax input and one toslink output, that are all in the main board. But the wm8805 has 8 spdif inputs. This expansion board is made to cut out and be placed on top of the main board and will have more spdif inputs and outputs. I have already placed some more coax and toslink and want to add AES/EBU as well just in case, but i dont know yet how to build an appropriate circuit for those.

The whole thing measures 16x18.5, that would be 13x18.5 without the i/o expansion board and 13x16 if i decide not to include the mosfet switch for the Motu.

I am pretty entertained with this and specially the wm8805 part is being very interesting.

What i have pending as well is to decide on exact size and size and position of the mounting holes to have a good variety of fitting boxes available. Wanted to make it Eurocard but it was not possible. Any suggestions or advice in this regard will be very much appreciated!
 
OP
M

MarcosCh

Major Contributor
Joined
Apr 10, 2021
Messages
1,818
Likes
1,470
and two months and a lot of datasheet reading later....
1682165065646.png


and populated....

1682165213476.png


1682165296980.png


to the left, IR receiver connector, DC connectors to power/upower the input and output cards (a minidsp DDRC2x4 as input and Motu ultralite as output/dac), power in. And to the right, spdif inputs and outputs and display connectors.

And most importantly, it works!!

1682165510253.png


all the system (including external cards) get powered on/off via ir remote, can switch spdif inputs also via remote and hopefully very soon it will auto switch upon detecting a signal input. This is actually being easier than i though, what i have not sorted out yet is how to make the wm8805 audio interface (is2 to spdif and spdif to i2s) work without driver.... that one might take some more time...

Ah, and printing an enclosure, of course!!
 
Last edited:
OP
M

MarcosCh

Major Contributor
Joined
Apr 10, 2021
Messages
1,818
Likes
1,470
and this is the overkill input expansion board that provides a lot more of spdif inputs as toslink, coax and AES/EBU and converters to all three formats of the output as well.
Unfortunately i dont have any AES/EBU source/receptor to test it...

1682165968320.png


I don't think i will ever have a use for them, but now I can confidently say "i have more spdif inputs than you" :p:


1682166116515.png
 
Last edited:
Top Bottom