Here are the build notes for my ESP32 WROOM Educational Modular Synth Thing PCB.
Warning! I strongly recommend using old or second hand equipment for your experiments. I am not responsible for any damage to expensive instruments!
If you are new to microcontrollers, see the Getting Started pages.
Bill of Materials
- ESP32 WROOM Educational Modular Synth Thing PCB (GitHub link below).
- 24-pin DIP adaptor PCB (in same repository - see note on footprint error below).
- ESP32 WROOM DevKit.
- NB: Check and double check the pinout (see below). This is a common third-party DevKit pinout, but is different to the official Espressif ESP32 DevKit.
- 1 x CD4067B 24-pin DIP 16-way analog multiplexer (see note below on footprint error!).
- 1x H11L1 6-pin DIP opto-isolator.
- 1x TDA7052A 8-pin DIP BTL audio amplifier with DC volume control.
- NB: Must be the 7052A variant. The original TDA7052 does not have the DC volume control.
- 1x L7805 TO-220 5V voltage regulator.
- Resistors:
- 1 x 220Ω
- 11 x 470Ω
- 5 x 1K
- 4 x 10K
- 5 x 100K
- 3 x 680K
- 6 x 1M
- 1 x 2M
- Variable Resistors:
- 13 x 10K linear (PCB Mount: RK09 footprint)
- 1 x 100K linear (PCB Mount: RK09 footprint)
- 4 x 2N3904 NPN transistors
- 1 x BC557 PNP transistor
- 5 x 1N4148 signal diodes
- 6 x BAT43 Schottky diode
- 1 x 3mm LED
- Ceramic Capacitors:
- Electrolytic Capacitors:
- 2 x 1uF
- 2 x 10uF
- 1 x 100uF
- 15 x 2-way pin header sockets.
- 2 x 4-way pin header sockets.
- Jumper header pins.
- 2 x 15-way pin header sockets.
- Optional: 24-pin DIP socket (see note below on footprint error!).
- Optional: 8-pin DIP socket.
- Optional: 6-pin DIP socket.
External connections as required:
- MIDI: e.g. DIN or TRS socket.
- Power: e.g. barrel jack or 9V battery connector.
- Power switch.
- Line out jack: e.g. mono or stereo 3.5mm or standard jack socket.
ESP32 WROOM DevKit
Here is a photo of the ESP32 WROOM DevKit I'm using. Note how the pins nearest the USB-C socket are VIN/GND on one side and 3V3/GND on the other.
24-pin DIP Footprint Converter
The CD4067 (or HC/HCT variants) generally come in a wide DIP format, but the PCB includes the footprint for a narrow DIP format device. Consequently an adaptor PCB is required. Alternatively some creativity in fitting a wide DIP into a small DIP footprint is required.
Build Steps
Taking a typical "low to high" soldering approach, this is the suggested order of assembly:
- All resistors and diodes.
- DIP sockets (if used).
- Disc capacitors.
- Transistors.
- Pin header sockets
- Electrolytic capacitors.
- Potentiometers.
- LED.
Then on the rear:
- 24-pin DIP converter.
- ESP32 headers.
- 7805.
- Any remaining pin headers.
There are several choices to be made about how any external connections are to be linked to the PCB. In this prototype version, that I'm using to develop the code some more, I've used pin headers on the underside of the board.
When fitting the electrolytic capacitors it is recommended that they are soldered horizontally where possible. Three have space on the board for this; two do not, so you'll have to get creative... one of these two could be fitted on the underside of the board if required.
Here are some build photos.
Resistors and diodes first, taking particular care for the orientation of the diodes of course.
DIP sockets then ceramic capacitors next.
Note: If DIP sockets are used, then slightly higher stand-offs will be required for the panel and the two-pin header socket connectors won't quite sit flush with the panel. For a flush finish, DIP sockets can't be used.
Transistors then the electrolytic capacitors.
It may be easier to fix the header sockets before the electrolytic capacitors (see next step). Also it is worth noting that the electrolytics are best mounted bent over but that isn't possible with the two power supply capacitors. However, then can be mounted bent over if one is mounted on the underside of the board as follows (I went back and did this after I'd finished the build):
Of course, hopefully it goes without saying but be sure to get the electrolytics the right way round, especially when one is mounted underneath.
Warning: the footprint for the 2N3904 transistors has the pads very close together, so care is needed to ensure that the centre pin particularly does not short across to the others. Visual inspection with a magnifying glass then checking for (lack of) continuity is strongly recommended.
To fix in the 2-way and 4-way header sockets, I temporarily mounted the panel using some 2.5 x 6mm standoffs. This allows for better alignment of the sockets whilst soldering as they can be pushed through the panel and kept in place and upright by tape.
The last stage for this side of the board is the potentiometers. Be sure to get the single 100K pot in the right place, as the line out volume control.
It may be simpler to solder on the ESP32 headers on the underside of the board before fixing the pots rather than have a soldering iron reaching around the pots.
Unfortunately this can't be done for the 24-pin DIP converter as that will end up sitting over some of the pins for the pots.
Now the ESP32 headers and DIP converter can be fixed. Note the orientation of the DIP converter - the narrow footprint on the converter should match the orientation of the narrow footprint on the top side of the main PCB.
As this will overhang some of the solder joints already made it is worth just manually visually double checking those joints with a magnifying glass before soldering on the converter.
Warning: Make sure the DIP converter is sitting high enough off the main PCB so as not to short or connect to the solder joints from the pots.
The last step is to complete any external links required and to solder on the 7805 regulator. I've used pin headers on the underside of the PCB for this version of the board.
The 7805 should be mounted as shown below.
Here is the final result.
Testing
I recommend performing the general tests described here: PCBs.
Then a number of specific tests should be performed once the basic electrical operation has been confirmed.
Note: The ESP32 will have to be removed for programming purposes, but once plugged in the serial output will still work as long as nothing is connected to the VCO 2 triangle output on GPIO 1 (TX).
Analog Potentiometer Test
The first test will verify that the pots connected to the multiplexer are all working and connected to the appropriate pin as described in Educational DIY Synth Thing – Part 2.
The output will go to the serial monitor via the USB connection.
GitHub link to AnalogMuxPotTest.
Analog Input Test
A potentiometer can be connected up to 3V3 and GND and the input used to check VCO 1 and 2 CV and VCO 1 amplitude inputs.
Note: when left floating, the pulldown in the circuit doesn't work properly, so expect indeterminate results.
The output will go to the serial monitor via the USB connection.
GitHub link to AnalogInputTest.
PWM Output Test
The 10 PWM outputs (four for each VCO and two for the LFO) can be tested using the code from ESP32 and PWM – Part 3 just providing the appropriate pins. I've created a simplified version with no analog control, although adding the reading of the MUX to set the frequency wouldn't be a major change. But it isn't necessary just to test the circuit and outputs.
The output can be checked with an oscilloscope for each of the 10 PWM signal outputs.
GitHub link to PWMOutputTest.
VCA Test
Whilst the PWMOutputTest code is running, this is a good time to check the operation of the VCA.
Connect a potentiometer between 3V3, GND, and the VCA EG input and then patch one of the PWM outputs to the VCA input. Both the potentiometer and the line out volume control should be able to set the volume of the output.
The output can be checked at the line out pins with an oscilloscope.
DAC Output Test
The two DAC outputs are used for the envelope generator, so the following code outputs an envelope type shape on each channel. The parameters used for the envelope are fixed, but slightly different for each channel.
The two EG outputs can be checked with an oscilloscope using a slow time-base.
GitHub link to DACOutputTest.
Gate and Trigger Test
The following code will print out the state of the two gate and trigger inputs. The various states can be checked by connecting each input to 3V3 to activate them. Note that the default, inactive, state is HIGH and the active state will read LOW.
The output will go to the serial monitor via the USB connection.
GitHub link to DigIOReadTest.
MIDI Input Test
Connect a 5-pin DIN socket to the MIDI header, taking care to connect pin 4 and 5 correctly (details here).
This code will light up the DevKit's on board LED when a NoteOn message is received and turn it off for NoteOff.
GitHub link to MIDIInputTest.
Workarounds and Patches
If the board is used "as is" then there are some workarounds to note.
- The three CV inputs for the two VCOs should be connected to 3V3 or GND when not in use. This gets around the weak pulldown issue from the use of Strapping pins for the inputs.
- VCO 2 CV has a reduced range, from 0 to around 3500 in software, due to the voltage drop from the connection to the onboard LED. This should be compensated for in software.
There are some untested hardware workarounds that MIGHT work:
- For the second issue, it MIGHT be possible to remove the onboard surface mount LED (or its associated resistor). But note that the onboard LED is used for the MIDI test.
- For the weak pulldown issue, it MIGHT be possible to replace the three 680K pulldown resistors with stronger pulldowns to compete against the built-in 45K pulling resistors.
- It MIGHT be possible to cut tracks on the PCB and re-route the analog inputs to three non-strapping pins instead. This has not been explored further at this stage.
But note: I've not tried these, I'm just hypothesizing this may be possible.
PCB Errata
There are the following issues with this PCB:
- The 24-pin DIP footprint is incorrect and requires an adaptor board.
- There is no board space to allow the two power supply electrolytics to bend over the PCB.
- The footprint for the 2N3904 transistors is too small for easy soldering.
- Using GPIO 2, 4, 15 as analog input values was a mistake and they should be swapped with outputs that require minimal additional circuitry.
Enhancements:
- Do something better with the 7805 regulator.
- Consider providing headers for one of those common 4067 modules rather than using the chip direct, as they seem more widely available. If not, at least fix the footprint!
- Include a better amplification stage for direct connection to a speaker.
- Allow the volume pot to control the speaker output too.
- Additional GND points to aid using an oscilloscope for the signals would be useful too.
- Additional GND points for use with external inputs to the system, especially the CV and gate/trigger inputs
- It is slightly confusing that most of the two-pin header sockets are duplicate connections, but the LFO output is not.
Mechanical Assembly
The simplest assembly requires four sets of stand-offs, one for each corner, to act as "feet" for the PCB and to connect to the front panel:
- 4 x 2.5 x 16-20mm standoffs with nut fittings. 20mm recommended.
- 4 x 2.5 x 6-8mm standoffs with nut and screw fittings. 8mm recommended for use with DIP sockets.
- 4 x 2.5 screws.
Sample Applications
This board could probably be used with the following existing projects:
But really, it is designed for use with custom firmware to support the Educational DIY Synth Thing.
Closing Thoughts
The Strapping pin issue is one of those moments that causes a little sigh - yes, all the information is out there somewhere about this issue, but it isn't in any of the places I'd been reading before hand and there was nothing I'd found up to that point to suggest that some GPIO pins weren't able to be treated the same as all the rest.
But all the information is there if you want to read a 700 page datasheet from cover to cover...
But I think I have enough workarounds in place for my purposes for the time being. Now I can get on and finish the firmware and start some experiments and use. That will give me more information, alongside all the above, to feed into the design of a V2 board and panel.
Kevin