For this project I took inspiration from an existing toy my kids played with in the past that triggered notes depending upon colors detected. That product was discontinued and since it requires an app to play the sounds the devices serve no purpose now so I wanted to make something similar for my kids to play with.
This project is fairly simple, I took a Xiao MIDI Synthesizer and programmed it to use a TCS34725 color detection sensor for color detection. When sounds are detected it plays tones. Additionally I reworked the logic to support some of the buttons on the device itself to use them for changing instruments and modifying the tone.
Github Link: https://github.com/Timo614/MusicFingers
SetupThe setup for this project involves just a few steps:
- 3D print the associated ring STL
- Affix the TCS34725 to the 3D print with two small m2 screws
- Add two longer headers to the MIDI Synthesizer to better access the pins
- Attach the TCS34725 board via i2c: 3v3, GND, SCL, and SDA on the Xiao ESP32C3 exposed pins
- Push the new firmware via platform.io to the MIDI Synthesizer
I suggest using longer wires to allow easier movement with the device.
See the photos below with captions for the setup process:
Given the simplicity of this project there isn't much to discuss in terms of the hardware connections but utilizing the MIDI Synthesizer schematic you can get better idea of how the existing logic functions inside the device. I'll attach some screenshots from that schematic here to illustrate some elements of the synthesizer.
First is the Xiao ESP32C3 that acts as the control board for the synthesizer. This is the same board you can buy from Seeed. It supports Espressif IDF and Arduino for development. You can see here the pins correspond to those in the Xiao ESP32C3 documentation with D4 acting as SDA and D5 acting as SCL for i2c communication. The 3V3 pin works it's just not connected to anything in the circuit for the MIDI synthesizer itself (I use it for I2C as the board has a 3V3 logic level).
D0 through D3 are all used for hardware buttons on the device.
You can see via this part of the schematic that each of these are associated with a hardware button. They are pulled up to 3V3 on the hardware side and the button brings them low to GND.
The only other pin taken by the device is the TX pin which is used for the MIDI communication. All others are available for use with projects which is nice. The schematic includes the other elements for MIDI play but given I was concerned for use of the microcontroller and these elements work well with the library I didn't dig in too heavily to that.
You can see though that it makes the device extensible as you can utilize the other pins to create interesting projects like this one.
PlayWith the device attached and firmware uploaded you can now play with color. Different colors will trigger sounds across a continuous range. Use the hardware first button on the MIDI Synthesizer to change the instrument used for additional fun.
Comments