Melodic Chimes is an auto-tuning three string instrument playing MIDI files located on a SD card.
Source code and project files: https://github.com/reubenstr/MelodicChimes
Each string has a tuner, top bridge, plectrum, pickup, and a bottom bridge.
The chimes are controlled by a touch screen where the user selects the song, starts/stops the song, and configures/calibrates the chimes. The display provides feedback of the playback status, chime status, Wi-Fi connectivity, and local time. The Wi-Fi capability is for acquiring local time to allow for hourly chimes or alarm clock functionality.
The SD card is inserted into the SD card slot located on the side of the chimes. The SD card contains the MIDI files, Wi-Fi configuration, and chime configuration.
MIDI compositions were created in MuseScore 3.0 which is an open source musical composition software.
A Keystation Mini32 Mk3 MIDI keyboard assisted in the composing process. Stickers were added to various keys marking each chime’s range.
The nameplate is illuminated via a Neopixel (WS2812b) LED strip. When the chimes are idle the nameplate is a slow morphing rainbow and when the chimes are playing nameplate colors coincide with the timing and pitch of note.
The string’s pitch is controlled by increasing or decreasing the tension on the string by rotating the tuning peg. The tuning peg is the output shaft of a gearhead stepper that is covered by a 5mm to 6mm shaft adapter. The shaft adapter prevents the stepper motor’s D-shape shaft from causing dents in the string which could cause premature string breakage.
The plectrums are simple eight tooth gear like shapes designed to smoothly lift the string and quickly release the added tension. The height of the plectrums relative to the string is controlled by stepper motors which allow for plucking volume to be increased or decreased.
Each string has a dedicated single pickup coil custom constructed from an iron slug with a small neodymium magnet attached to the back end. There are ~14000 turns of 42AWG enameled copper wire that creates a strong enough signal to be processed by the electronics.
Custom coils were winded using the coil winder project.
The soundboard is somewhat mechanically insulated from the frame and contains several sound holes. The sound holes project the sound forward. Due to the metal frame, acrylic soundboard, and steel strings, the sound produced is more on the tinny side.
The bottom bridges are made from bone and mechanically connect the string to the soundboard thus transferring string vibrations into the soundboard creating more volume.
Underneath is the power plug jack and power switch. To the right is an opening to plug in a programming cable to the main microcontroller.
The top has two more openings (only one is shown) to connect programming cables to the chime controllers.
Viewing the back of the chimes reveal the stepper motors and electronics.
The main controller is at the lower left corner and the two chime controllers are at the upper left and upper right corners.
The ridged frame was constructed from 2020 aluminum extrusions cut to size using a Diablo D1080N non-ferrous metal & plastic cutting saw blade on a 10″ miter saw. The 2020 frame allows for a ridge frame with multiple mounting points for various brackets.
The soundboard backing is made from 3mm Baltic birch plywood cut on a C02 laser engraver.
The main controller is an Wi-Fi enabled ESP32 microcontroller. A custom PCB was fabricated to allow the ESP32 to easily interface with the SD card module, TFT LCD display, and chime controllers.
The TFT LCD display directly connects to the main controller PCB.
The main controller PCB was created in the non-profit version of DipTrace and fabricated by JLC PCB. The REG1 is a AMS1117 LDO voltage regulator and was found to be insufficient and providing enough power for the ESP32 and the Neopixel (ws2812b) LED strip. A small DC-DC voltage regulator was taped to the board under the ESP32 to supply the LED strip.
The main controller schematic shows a rather simple circuit.
The power supply is a Mean Well LRS-50-12 providing more than enough power to the electronics and stepper motors. The power supply mounting panel also acts as a TFT LCD display hold down.
The chime controller to the left controls chime 1 and chime 2 and the chime controller to the right controls chime 3. Each chime requires three stepper motors: tuning, volume, and picking.
The chime controllers are power by a Teensy 3.2 and were selected for their audio processing capability and out of the box library support for detecting single note frequencies (notefrequency example). More info about the Teensy microcontrollers can be found at the PJRC Teensy 3.2 webpage.
The chime controller PCB contains several test points to allow direct oscilloscope connections for testing/calibration of pickup signals and amplification.
The chime controller schematic reveals nothing unexpected.
The three single string pickups are mounted along a single mounting bracket. Although the nearby picking stepper motor’s EMI interferes with the pick up coils, the interference is minimal.
The pickup coil’s raw signal is amplified using a LM358 op-amp module. The signal is amplified to just below clipping magnitudes. The variable resistors next to the Teensy reduce the voltage to the Teensy’s 2.8v line in voltage.
The stepper drivers are TMC2208 and were primarily selected because they produce low motor noise. Motor current is manually selected via the onboard potentiometers. The chime controller disables the stepper drivers after one minute of chime inactivity.
The plectrums and plectrum stepper motors are mounted on square housings which are raised and lowered by a cam on the volume control stepper motors. Two springs located between the plectrum square housing and frame mounted housing help the shaft retain position. The volume stepper motors are ubiquitous 28byj geared stepper motors.
The tuning stepper motors are NEMA17, have a gear ratio of 5.18:1, and have a max torque of 283oz-in. These steppers were selected for a balance of torque, speed, resolution. Non-gearhead steppers did not provide enough angular resolution to allow for fine frequency adjustments and the pitch waiver became too great.
The corners of the acrylic frame have simple brackets to keep acrylic together and square.
A large mounting bracket was designed to hold the weight of the chimes and accepts the head of large screw (such as a course thread drywall screw).
The layout for the various parts such as the frame, stepper motors, pickup, display, etc. were drawn up in AutoCAD LT. Laser cut parts such as the faceplate, side walls, and electronics mounting plates, were also created in AutoCAD LT and saved as .dxf for the laser cutter.
3D printed parts were designed in Fusion 360 and printed on Voron 2.4 and Voron 0.1 3D printers using Hatchbox matte black PLA sliced in Cura.
- Add the LM358 op-amp circuitry directly to the chime controller PCB.
- Connect the TMC2208 stepper drivers via UART to the microcontroller for code controlled motor currents.
- Swap the AMS1117 LDO voltage regulator on the main controller board to a more capable voltage regulator or DC-DC convertor to power both ESP32 and Neopixel LED strip.
Below are prototyping experiences.
The first approach at creating a plectrum was using a guitar pick and a servo motor. Although this method performed as needed, the noise of the RC servo was loud even after greasing the gears; therefore, an alternative approach was necessary to reduce motor noise.
After observing how the human hand picks a guitar strings using a complicated movement of pushing the string in one direction and removing the blocking force (the pick) in another direction, a new approach was tested. The goal of the plectrum in the above image was to create a dual movement where the wheel pushes the string and the spring gives in the other direction. This approach failed. Success may of been found if the spring was tuned to precisely fit the break away force and/or the plectrum had sufficient flex to match the desired force to pick the string.
After reading a few research papers for college auto-picking guitars projects a round disk approach was tested with success. Although the plectrum itself worked as desired, the vibration and high-pitch noise caused by the gearhead motor was undesirable.
After testing tuning motor and plectrum motor configurations a ‘final’ design was established using stepper motors due to their high torque, precision, and low mechanical noise. The above image shows that Melodic Chimes originally was designed to have four strings. As development continued and test MIDI files were created, reducing the number of strings from four to three greatly reduced the complexity of the system by providing more physical space for better bracket mounting options and reducing the tediousness of composing MIDI scores.
A original goal was to have the ability to mute the string to reduce picking noise and to provide more composing options. The mute ability was scraped after testing revealed that muting caused the string to change pitch due to the mechanical nature of the mute process. And, because muting did not offer any benefit musically as the string vibration faded after picking quickly enough not to interfere with other notes.
Prior to sending the chime controller PCB to fabrication a breadboard version was created to test the various motor configurations and the general feasibility of the system. Only minor issues of noise on the pickups occurred requiring bypass capacitors and cleaner power supplies.
Snow fall! This project roughly took two years from conception to completion as hurdles blocked progress and other projects took priority. The picture is Winter early 2021.
Creating the soundboard is straightforward and epoxied together for maximum resonance.
The TFT LCD display and SD card was prototyped prior to creating the frame to ensure everything will work as expected.
After the ESP32 and TFT display was working as required, a quick PCB was created.
Prior to using gearhead stepper motors traditional guitar tuning pegs were used, as seen in a few above images. At first they worked well because of their gear ratio and worm gear locking ability. But after several weeks of prototyping tuning algorithms the tuning pegs started to lock up. Upon taking a tuning peg apart the pinion gear was discovered to be highly worn with large gouges.
That’s it, thanks for reading!