in this project, we are going to make a digital bicycle horn with customizable sounds, we can produce up to 4 different sounds, and each track is saved on a micro-SD card in .mp3/wav format, we have 4 button inputs for playing sounds, each button is assigned to each track in the micro-SD card. also, it has a rechargeable battery, you can charge the battery with USB C, I also include a battery recharge indicator LED on the back side, and there is a small switch for ON/OFF. it is made from readily available components and completely 3d printable body parts.

Supplies

Supplies

components

Tools

  • Soldering iron
  • Allen key set
  • Nose plier
  • Glue gun
  • Wire cutter/wire stripper
  • Heat shrink tube
  • Multimeter
  • Zip Ties (black)
  • 3d printer ( 3d printing service )

3d Printing

3d PrintingI 3D printed all of this in PLA+ from Numakers . I used black and orange filament. which is a great combination. 0.2mm layer height and 100% infill, if you don't have a 3d printer you can find online 3d printing services 

 Voltage Setting on MT3608

Before assembling we need to preset the voltage on MT3608, if you buy a new module you need to turn the potentiometer around 20 times or more in a counterclockwise position and then once you get the regulated voltage at the output you can use the module. Connect your battery to VIN+ and VIN- and set the voltage to 5v. measure it from the OUT+ and OUT- using a multimeter after that remove the battery input

Removing Header Pins From MP3-TF-16P

MP3-TF-16P always comes with a header pin pre-soldered but we need to remove it for this project, it is not easy if you don't have the right tools, I used a combination of desoldering pump and plier for removing the header pins. Try not to damage related components from the PCB. This tutorial helps me a lot

Uploading Code to XIAO

I always like to upload the code to the microcontroller before assembly. Here we are using a tiny Xiao SAMD21 from the Seeed studio, It carries the powerful ATSAMD21G18A-MU which is a low-power microcontroller.

Use full tutorials

After adding Xiao board to IDE we need to install the library for MP3-TF16P, a useful tutorial for installing the library link

Here is the code for our project. upload it to Xiao

#include "Arduino.h"
#include "SoftwareSerial.h"
#include "DFRobotDFPlayerMini.h"


#define RX D6 // RX pin of DFPlayer Mini connected to  digital pin 6
#define TX D7 // TX pin of DFPlayer Mini connected to  digital pin 7


#define BUTTON_1 D0 // Digital pin for button 1
#define BUTTON_2 D1 // Digital pin for button 2
#define BUTTON_3 D2 // Digital pin for button 3
#define BUTTON_4 D3// Digital pin for button 4


SoftwareSerial mySoftwareSerial(RX, TX); // Create a SoftwareSerial object
DFRobotDFPlayerMini myDFPlayer; // Create a DFPlayerMini object


void setup() {
  mySoftwareSerial.begin(9600); // Start the software serial communication
  Serial.begin(9600); // Start the serial monitor for debugging


  if (!myDFPlayer.begin(mySoftwareSerial))...
Read more »