Overview:
This project designs a horn board for a car, utilizing the esp32 microcontroller to output sounds through a physical speaker. It needs to be able to switch between two power sources (CAN and AUX), prioritizing the AUX power but having the option to manually decide.
Features:
Compute:
Esp32 wroom 1 microcontroller (utilizing the OTA feature)
Stores audio files
Power:
Buck converter (convert the 18v/ 12v/5v to 3.3v
Actuation:
Speaker (DAC and Amplifier IC)
LEDs (mainly for debugging, turns on when specific parts of the board works)
Schematic
Layout
BOM: total cost is $74
Issues:
Layout wise ( underestimated the details)
Can connector, transceiver, and diode needs to be close to esp32 (top right would be good) for better signal integrity
Check track widths (made track widths for power thicker but didn’t consider actual calculations)
Used wrong footprint for buck converter (hence the hot glue) and some other parts
Did not need UART (esp32 has the functionality)
Mechanical constraint (considering how it actually fits in the car)
TVS Diode is super tiny! (probably use actual zener diodes as replacement to make it easier to solder)
Schematic wise
Enable pin is always in run mode (connected to power)
Needs to connect to ground in order to flash code (should have added a switch)
Master clock has to connect to GPIO0 to get data from esp32 to DAC)
Pins from data line for esp32 are connected to the amplifier IC (currently we have resistors shorting them so that connection is gone —> once OTA works, can unshort)
Specifying which side is on/off for switch
boot/reset buttons (boot helps flash firmware, reset -> turn it on/off)
Keepout zone for esp32 has to be off the board for better signal
Things that do work:
Esp32 does get power from the USB-C (data lines working)
Buck converter works (converts 5v from laptop to 3.3v for esp32)
Green LED lights up to indicate that
18V battery does power the board and all wires connected to it gives power to the appropriate components
LED lights also light up to indicate that
Physical switches work! (toggling it turns power off/on)
Speaker?? → amplifier works when given a frequency
CAN?? TBD
Next steps:
If we want esp32 on our current board to actually work, need to cut off connection from enable pin and power pin (currently shorted)
Speaker??? → need to correct esp32 to give signal to DAC → Amplifier -> speaker
Learnings:
To not underestimate the importance of layout
It’s much more than just connecting wires
Spend more time on layout (placement matters)
Shorter wire connections
Double check pin connections to esp32
Order at least 2 of each parts (we only ordered one of each and had issues and delays)
Speaker?? (works but need to test it with our actual board and signal from esp32)
Bringup: