genuinequality

Download free music MP3s on genuine quality, the world’s largest online music catalogue, powered by your scrobbles. Free listening, videos, photos, The world’s largest online music catalogue, powered by your scrobbles. Free listening, videos, photos, stats, charts, biographies and concerts. stats, charts, biographies and concerts.

Monday, December 9, 2024

ESP32 WROOM Mozzi Experimenter PCB Build Guide

Here are the build notes for my ESP32 WROOM Mozzi Experimenter PCB Design. 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 a…
Read on blog or Reader
Site logo image Simple DIY Electronic Music Projects Read on blog or Reader

ESP32 WROOM Mozzi Experimenter PCB Build Guide

By Kevin on December 9, 2024

Here are the build notes for my ESP32 WROOM Mozzi Experimenter PCB Design.

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 electronics and microcontrollers, see the Getting Started pages.

Bill of Materials

  • ESP32 WROOM Mozzi Experimenter PCB (GitHub link below)
  • ESP32 WROOM 32-D DevKit (see photos and PCB for pinout - in particular note position of 3V3 and GND pins)
  • 1x H11L1 optoisolator
  • 1x 1N4148 or 1N914 signal diode
  • 1x 10Ω, 1x 33Ω, 1x220Ω, 1x470Ω, 2x1K, 2x2K resistors
  • 8x 10K potentiometers (PCB mount, see PCB and photos for footprint)
  • 2x 100nF ceramic capacitors
  • 2x 10uF non-polar capacitors (electrolytics probably fine too)
  • 1x 100uF electrolytic capacitor
  • 1x 3.5mm stereo TRS socket (PCB mount - see photos/PCB)
  • Either 2x 180 degree DIN sockets (PCB mount - see photos/PCB)
  • Or 2x 3.5mm stereo TRS sockets
  • 1x 2.1mm barrel jack socket (PCB mount - see photos/PCB)
  • Optional: 2x or 4x 15-pin header sockets
  • Optional: 1x 6 way DIP socket
  • Optional: pin headers
  • Optional: jumpers
  • Optional: SPDT slider switch, 2.54mm pitch connections (see photos/PCB)

Build Steps

Taking a typical "low to high" soldering approach, this is the suggested order of assembly:

  • All resistors and diode.
  • DIP socket (if used) and TRS socket(s).
  • Disc capacitors.
  • Headers.
  • Switch (if used).
  • Barrel jack.
  • Non-polar and electrolytic capacitors.
  • DIN sockets (if used).
  • Potentiometers.

Here are some build photos.

There are several options for headers - there is an additional breakout of all the pins of the ESP32 module and these can be populated with sockets, pins or just left unpopulated as shown below.

And finally adding the potentiometers.

Configuration Options

Two of the potentiometers, RV1 and RV2, have configurable GPIO connections, which are selected by solder jumpers on the rear of the board. The default has them mapped as follows:

RV1 GPIO 13
RV2 GPIO 12

The alternative is configured by cutting the default track between the top solder pads and re-soldering to the bottom pads:

Only one can be changed if required. The alternative configurations are:

RV1 GPIO 39
RV2 GPIO 36

Testing

I recommend performing the general tests described here: PCBs.

Functionality testing is covered by the Sample Applications given below.

PCB Errata

There are the following issues with this PCB:

  • The UART jumper is labelled UART0 and UART1, but in actually, UART1 is almost certainly going to end up being UART2 as UART1 is typically used for onboard flash memory.

Enhancements:

  •  I could add a slightly larger prototyping area, perhaps mirroring the layout of a mini solderless breadboard and still keep within a 100x100mm footprint.

Find it on GitHub here.

Sample Applications

Recall that the GPIO used can be found listed in the ESP32 WROOM Mozzi Experimenter PCB Design.

Potentiometer Analog Read Test

The following code will echo the values from all 8 potentiometers to the serial monitor.

#define NUM_POTS 8
int potpins[NUM_POTS] = {
13, 12, 14, 27, // ADC 2.4, 2.5, 2.6, 2.7
33, 32, 35, 34 // ADC 1.4, 1.5, 1.7, 1.6
};

void setup() {
Serial.begin(115200);
}

void loop() {
for (int i=0; i<NUM_POTS; i++) {
int aval = analogRead(potpins[i]);
Serial.print(aval);
Serial.print("\t");
}
Serial.print("\n");
delay(100);
}

DAC Write Test

The following code will generate two sawtooth waveforms on the two DAC pins, GPIO25 and GPIO26, which are connected to the audio output L and R channels.

GPIO 25 will generate a 440Hz saw tone, and GPIO26 will generate a 880Hz saw tone.

This works, as the code generates a 6-bit (i.e. 0 to 63) value saw wave, updating the value every time through the loop() function. The value is effectively scaled up to 8-bits (0 to 255) by multiplying by 4. The frequency is doubled for pin 26 by multiplying by 8.

In reality, I'm actually taking advantage of the fact that "count" is a uint8_t - i.e. only an 8-bit value - and will automatically wrap around back to zero when the value gets to 255. So in the code, every time the actual "count" variable wraps (0 to 255), the multiplied by 4 version will have wrapped 4 times (i.e. 0 to 63 four times - well, actually it is going 0 to 255, but in steps of 4 at a time, so it will do that 4 times). Similarly the multiplied by 8 version will have wrapped 8 times.

The code has to output these 64 values, 440 times a second, to generate the 440Hz saw tone - so 64 x 440 = 28,160 values a second. That means there is one value required every 35 uS or so. I use the ESP32 microsecond timer to manage this.

uint8_t count;
uint32_t timer;
void setup() {
count = 0;
timer = 0;
}

void loop() {
uint32_t newtime = esp_timer_get_time();
if (newtime >= timer) {
dacWrite(25, count*4); // Auto wraps at 256
dacWrite(26, count*8); // Twice frequency of wrapping...
count++;
timer = newtime + 35; // 35 uS in future of last timer read
}
}

MIDI Test

The ESP32 Simple MIDI Monitor code can be used for a simple MIDI test. The code is configurable for either UART0 or UART1 (in reality mapped onto UART2 in the ESP32) for MIDI.

In use, on reception of any NoteOn message the onboard LED will light up. Also, any MIDI data received over MIDI IN is software-THRU echoed to MIDI OUT.

When using UART1 (UART2) then there will also be a MIDI message dump to the serial monitor.

Closing Thoughts

This board seems to work well. But I have a bit of a problem at the moment. There seems to be a problem with the current (at the time of writing) Mozzi library and the ESP32. There is an incompatibility with the I2S driver used for streaming data out to the DAC.

So at the time of writing, as a Mozzi experimenter board, my options are a little limited. But as soon as Mozzi is updated to the latest ESP32 SDK I2S interfaces, hopefully I'll be able to properly get going. Watch this space.

Kevin

Comment
Like
You can also reply to this email to leave a comment.

Simple DIY Electronic Music Projects © 2024.
Manage your email settings or unsubscribe.

WordPress.com and Jetpack Logos

Get the Jetpack app

Subscribe, bookmark, and get real‑time notifications - all from one app!

Download Jetpack on Google Play Download Jetpack from the App Store
WordPress.com Logo and Wordmark title=

Automattic, Inc.
60 29th St. #343, San Francisco, CA 94110

Posted by BigPalaceNews at 2:05 PM
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Search This Blog

About Me

BigPalaceNews
View my complete profile

Blog Archive

  • October (71)
  • September (112)
  • August (116)
  • July (96)
  • June (100)
  • May (105)
  • April (95)
  • March (131)
  • February (111)
  • January (104)
  • December (98)
  • November (87)
  • October (126)
  • September (104)
  • August (97)
  • July (112)
  • June (113)
  • May (132)
  • April (162)
  • March (150)
  • February (342)
  • January (232)
  • December (260)
  • November (149)
  • October (179)
  • September (371)
  • August (379)
  • July (360)
  • June (385)
  • May (391)
  • April (395)
  • March (419)
  • February (356)
  • January (437)
  • December (438)
  • November (400)
  • October (472)
  • September (460)
  • August (461)
  • July (469)
  • June (451)
  • May (464)
  • April (506)
  • March (483)
  • February (420)
  • January (258)
  • December (197)
  • November (145)
  • October (117)
  • September (150)
  • August (132)
  • July (133)
  • June (117)
  • May (190)
  • January (48)
Powered by Blogger.