week9

assignment - output device

add an output device to a microcontroller board you've designed, and program it to do something

for this week's assignment, i decided to test an OLED I2C Display (GME12864-12) and a speaker (PSR-45N08A-AQ) on the XIAO SAMD21

14

14

14

i chose the SAMD21 instead of the XIAO RP2040 because the SAMD21 has DAC, SCL, and SDA pins, which allow it to communicate with both the OLED and the speaker, it supports both 3.3v and 5v power supply

14

14

below is my PCB board design created in KiCad, where i connected both of them to 5V power

14

14

i first tested the OLED on a breadboard, and it worked well

14

14

next, i added the speaker, connecting it to D0 and ground, i first had trouble making both of them play at the same time, later TA Leo helped me look at my code and solved the problem, thanks Leo

14

then i tried to make the PCB, however the 1/32 bit was broken at REEF and the broken bit ruined the mill job, i will return to the PCB making later

14

one day later, i return to REEF to make the new PCB, this time i modify the board design by adding the NTC Thermistor which i tested last week, i added the NTC Thermistor to D1 because D0 sends out DAC data so i kept it connecting to the speaker. The Thermistor connects to XIAO through a resistor, below is the design, i am happy i am starting to understand some basics of PCB design

14

a big thank you to TA Leo who wrote the https://leomcelroy.com/bitrunner which simplifies the milling process significantly

14

14

14

however,the board is not working, after reviewing, i realized i connected the speaker to D0 and 5V, no GND

therefore, i redesigned the board, this time i did:

1. allowing jump connections, which i should learn how to do through flip mill

2. leave space for the speaker and OLED

therefore, i redesigned the board, this time i did:

14

14

14

with the code from GPT, the board started working, the Thermistor reads the temp, displaying on the OLED while the speaker plays a melody, but i need to check the code with TA again