[{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/557/original/cover.png?1788416497","metadata":{}},{"element_type":"markdown","content":"\u003cp\u003e\u003cem\u003eThis article was originally posted on \u003ca href=\"https://extralongdivision.com/?utm_source=adafruit-playground\u0026amp;utm_medium=referral\u0026amp;utm_campaign=syndication\u0026amp;utm_id=1\u0026amp;utm_content=dbz-radar-devlog-1\"\u003eextralongdivision.com\u003c/a\u003e. Read the full content there. A shorter version with less pictures to keep Adafruit Playground happy is reproduced below.\u003c/em\u003e\u003c/p\u003e\n\n\u003ch2\u003eInspiration\u003c/h2\u003e\n\n\u003cp\u003eIf you want a real life \u003ca href=\"https://dragonball.fandom.com/wiki/Dragon_Radar\"\u003eDragon Radar\u003c/a\u003e, there are a small amount of toys to choose from.\u003c/p\u003e\n","metadata":{"markdown":"*This article was originally posted on [extralongdivision.com](https://extralongdivision.com/?utm_source=adafruit-playground\u0026amp;utm_medium=referral\u0026amp;utm_campaign=syndication\u0026amp;utm_id=1\u0026amp;utm_content=dbz-radar-devlog-1). Read the full content there. A shorter version with less pictures to keep Adafruit Playground happy is reproduced below.*\n\n## Inspiration\n\nIf you want a real life [Dragon Radar](https://dragonball.fandom.com/wiki/Dragon_Radar), there are a small amount of toys to choose from.\n"}},{"element_type":"markdown","content":"","metadata":{"markdown":"[^1]: developer\n\n[^2]: inter-integrated circuit sound\n\n[^3]: printed circuit board\n\n[^4]: through hole technology\n\n[^5]: input/output\n\n[^6]: light emitting diode\n\n[^7]: flat flex cable\n\n[^8]: red, blue, green 5 bit, 6 bit, 5 bit\n\n[^9]: Universal serial bus\n\n[^10]: voltage bus\n\n[^11]: do not populate\n\n[^12]: printed circuit board assembly\n\n[^13]: previously known as Institute of Printed Circuits, but known known as Global Electronics Association\n\n[^14]: surface mount technology\n\n[^15]: electrostatic discharge or \"static shock\"\n\n[^16]: lithium polymer battery\n\n[^17]: inter-integrated circuit\n\n[^18]: transistor-transistor logic\n\n[^19]: serial peripheral interface"}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/563/original/dbz-radar-toys.png?1788447909","metadata":{}},{"element_type":"markdown","content":"\u003cp\u003eNone of those can really function as the radar from the anime. The maker in me wanted to change that.\u003c/p\u003e\n\n\u003cp\u003eThere were some bumps along the way, but the first revision turned out alright. I'll disclose all those bumps, and the eventual working prototype, in this devlog.\u003c/p\u003e\n","metadata":{"markdown":"None of those can really function as the radar from the anime. The maker in me wanted to change that.\n\nThere were some bumps along the way, but the first revision turned out alright. I'll disclose all those bumps, and the eventual working prototype, in this devlog."}},{"element_type":"markdown","content":"","metadata":{"markdown":"[^1]: developer"}},{"element_type":"markdown","content":"\u003ch2\u003ePrototyping\u003c/h2\u003e\n\n\u003ch3\u003eCircutPython\u003c/h3\u003e\n\n\u003cp\u003eA Dragon Radar requires a circular screen. In recent years, these have become more available to the hobbyist maker. There are lots on Alibaba and Aliexpress, but Adafruit has 4\" and 2.8\" varieties that are not only well documented but have a complementary dev board: the ESP32-S3 Qualia.\u003c/p\u003e\n\n\u003cp\u003eThis is where I began prototyping and quickly hit an impasse. Adafruit prioritizes CircuitPython and I couldn’t get the \u003ccode class=\"inline\"\u003eCIRCUITPY\u003c/code\u003e drive to show up on my Linux machine. I bumbled around factory reset and bootloader repair documentation only for flashing to work first try after connecting the Qualia to a Windows machine. Not sure why.\u003c/p\u003e\n\n\u003cp\u003eOnce I flashed the newest CircuitPython onto the Qualia, it showed up on my Linux machine. Maybe it’s on old bug that’s hence been repaired.\u003c/p\u003e\n\n\u003ch3\u003eDisplay Driver\u003c/h3\u003e\n\n\u003cp\u003eOnce CircuitPython worked, driving the display was easy using Adafruit's provided example code.\u003c/p\u003e\n","metadata":{"markdown":"## Prototyping\n\n### CircutPython\n\nA Dragon Radar requires a circular screen. In recent years, these have become more available to the hobbyist maker. There are lots on Alibaba and Aliexpress, but Adafruit has 4\" and 2.8\" varieties that are not only well documented but have a complementary dev board: the ESP32-S3 Qualia.\n\nThis is where I began prototyping and quickly hit an impasse. Adafruit prioritizes CircuitPython and I couldn’t get the `CIRCUITPY` drive to show up on my Linux machine. I bumbled around factory reset and bootloader repair documentation only for flashing to work first try after connecting the Qualia to a Windows machine. Not sure why.\n\nOnce I flashed the newest CircuitPython onto the Qualia, it showed up on my Linux machine. Maybe it’s on old bug that’s hence been repaired.\n\n### Display Driver\n\nOnce CircuitPython worked, driving the display was easy using Adafruit's provided example code."}},{"element_type":"product","content":"https://www.adafruit.com/product/5800","metadata":{"quantity":"1","description":"","name":"","url":"","featured":"true"}},{"element_type":"code","content":"from displayio import release_displays\nrelease_displays()\n\nimport displayio\nimport busio\nimport board\nimport dotclockframebuffer\nfrom framebufferio import FramebufferDisplay\n\ninit_sequence_hd40015c40 = bytes((\n    ...\n    \"\"\"obnoxiously long init code, scroll to the end for the repo containing the full code\"\"\"\n    ...\n))\n\ntft_pins = dict(board.TFT_PINS)\n\ntft_timings = {\n    \"frequency\": 16000000,\n    \"width\": 720,\n    \"height\": 720,\n\n    \"hsync_pulse_width\": 2,\n    \"hsync_back_porch\": 44,\n    \"hsync_front_porch\": 46,\n    \"hsync_idle_low\": False,\n\n    \"vsync_pulse_width\": 16,\n    \"vsync_back_porch\": 16,\n    \"vsync_front_porch\": 50,\n    \"vsync_idle_low\": False,\n\n    \"pclk_active_high\": True,\n    \"pclk_idle_high\": False,\n    \"de_idle_high\": False,\n}\n\nboard.I2C().deinit()\ni2c = busio.I2C(board.SCL, board.SDA)\ntft_io_expander = dict(board.TFT_IO_EXPANDER)\n#tft_io_expander['i2c_address'] = 0x38 # uncomment for rev B\ndotclockframebuffer.ioexpander_send_init_sequence(i2c, init_sequence_hd40015c40, **tft_io_expander)\ni2c.deinit()\n\nbitmap = displayio.OnDiskBitmap(\"/round-display-ruler-720p.bmp\") # place this file in the root of CIRCUITPY\n\nfb = dotclockframebuffer.DotClockFramebuffer(**tft_pins, **tft_timings)\ndisplay = FramebufferDisplay(fb, auto_refresh=False)\n\n# Create a TileGrid to hold the bitmap\ntile_grid = displayio.TileGrid(bitmap, pixel_shader=bitmap.pixel_shader)\n\n# Center the image\ntile_grid.x -= (bitmap.width - display.width) // 2\ntile_grid.y -= (bitmap.height - display.height) // 2\n\n# Create a Group to hold the TileGrid\ngroup = displayio.Group()\n\n# Add the TileGrid to the Group\ngroup.append(tile_grid)\n\n# Add the Group to the Display\ndisplay.root_group = group\n\ndisplay.auto_refresh = True\n\n# Loop forever so you can enjoy your image\nwhile True:\n    pass","metadata":{"language":"python","filename":"","linenums":false}},{"element_type":"markdown","content":"\u003cp\u003eI should note that I ran into an error when trying to program the board.\u003c/p\u003e\n\u003ccode class=\"\"\u003e\u003cpre\u003eOSError: [Errno 5] Input/output error\n\u003c/pre\u003e\u003c/code\u003e\n\u003cp\u003eThis prevented me from updating the code.  Other people have had this problem too apparently. I still don’t know the root cause, but the work around I used on Linux was:\u003c/p\u003e\n\u003ccode class=\"\"\u003e\u003cpre\u003esudo cp code.py /media/\u0026lt;username\u0026gt;/CIRCUITPY/code.py\n\u003c/pre\u003e\u003c/code\u003e\n\u003ch3\u003eSound\u003c/h3\u003e\n\n\u003cp\u003eThis was the first hiccup. This demo of the Adafruit team playing Star Trek on the Qualia made me confident that the board could be the base for a Dragon Radar.\u003c/p\u003e\n","metadata":{"markdown":"I should note that I ran into an error when trying to program the board.\n\n```\nOSError: [Errno 5] Input/output error\n```\n\nThis prevented me from updating the code.  Other people have had this problem too apparently. I still don’t know the root cause, but the work around I used on Linux was:\n\n```\nsudo cp code.py /media/\u0026lt;username\u0026gt;/CIRCUITPY/code.py\n```\n\n### Sound\n\nThis was the first hiccup. This demo of the Adafruit team playing Star Trek on the Qualia made me confident that the board could be the base for a Dragon Radar."}},{"element_type":"embed","content":"https://www.youtube.com/watch?v=yKRatudQSsI"},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eUnfortunately, all I heard was a crackling sound from my prototype. I used, what I believe to be, the same speakers as the one Adafruit demoed as well as a 8 ohm variant, but that didn’t change anything. Modifying the gain or the stereo/L/R output of the amp didn’t fix the issue either.\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/574/original/sound-prototype.png?1788448169","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003e\u003cspan\u003eI doubt the code is suspect but here it is in case you can find something wrong with it.\u003c/span\u003e\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"code","content":"# SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries\n#\n# SPDX-License-Identifier: MIT\n\nimport audiocore\nimport board\nimport audiobusio\n\nwave_file = open(\"beep.wav\", \"rb\")  # must be CIRCUITPY filesystem\nwave = audiocore.WaveFile(wave_file)\n\n# For Feather M0 Express, ItsyBitsy M0 Express, Metro M0 Express\n# audio = audiobusio.I2SOut(board.D1, board.D0, board.D9)\n# For Feather M4 Express\n# audio = audiobusio.I2SOut(board.D1, board.D10, board.D11)\n# For Metro M4 Express\n# audio = audiobusio.I2SOut(board.D3, board.D9, board.D8)\ni2s_bit_pin = board.A1\ni2s_word_pin = board.A0\ni2s_data_pin = board.TX\naudio = audiobusio.I2SOut(i2s_bit_pin, i2s_word_pin, i2s_data_pin)\n\nwhile True:\n    audio.play(wave)\n    while audio.playing:\n        pass","metadata":{"language":"python","filename":"","linenums":false}},{"element_type":"markdown","content":"\u003cp\u003eI don't have a lot of familiarity with I2S or sound circuits in general. Since \u003cem\u003esomething\u003c/em\u003e played I suspect the haphazard wiring is the culprit. Hopefully a PCB[\u003csup\u003e3]\u003c/sup\u003e will fix the issue. So I pressed on to electrical-mechanical design.\u003c/p\u003e\n\n\u003ch2\u003eEnclosure Design\u003c/h2\u003e\n\n\u003ch3\u003eDisplay Mounting\u003c/h3\u003e\n\n\u003cp\u003eGiven the unique shape of the Dragon Radar, I started with designing a 3D model. In the anime, the it took on slightly different looks.\u003c/p\u003e\n","metadata":{"markdown":"I don't have a lot of familiarity with I2S or sound circuits in general. Since *something* played I suspect the haphazard wiring is the culprit. Hopefully a PCB[^3] will fix the issue. So I pressed on to electrical-mechanical design.\n\n## Enclosure Design\n\n### Display Mounting\n\nGiven the unique shape of the Dragon Radar, I started with designing a 3D model. In the anime, the it took on slightly different looks."}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/564/original/dragon-radars.png?1788447926","metadata":{}},{"element_type":"markdown","content":"\u003cp\u003eThere are two constraints mandatory to match the anime:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eThe display has to be at the center of the enclosure\u003c/li\u003e\n\u003cli\u003eThe activation button must be at the top of the enclosure, aligned with the vertical symmetrical axis\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eThese two constraints seem simple, but forced my hand during mechanical design.\u003c/p\u003e\n\n\u003cp\u003eI decided to use the 4\" display, HD40015C40, since I figured a display that was too big was better than one that was too small. I didn't have the display in hand yet when designing the enclosure so I had to go off its datasheet.\u003c/p\u003e\n","metadata":{"markdown":"There are two constraints mandatory to match the anime:\n\n1. The display has to be at the center of the enclosure\n2. The activation button must be at the top of the enclosure, aligned with the vertical symmetrical axis\n\nThese two constraints seem simple, but forced my hand during mechanical design.\n\nI decided to use the 4\" display, HD40015C40, since I figured a display that was too big was better than one that was too small. I didn't have the display in hand yet when designing the enclosure so I had to go off its datasheet."}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/566/original/HD40015C40-drawing.png?1788447960","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003e\u003cspan\u003eIt was in Chinglish and honestly frustrating to interpret. What I could figure, though, was the visible pixels on the screen are not centered in the display assembly. In fact, the center of the display assembly's bounding box and the center of the active pixel area are offset by 2.44 mm.\u003c/span\u003e\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/558/original/aa-offset.png?1788447737","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eI was able to reduce the offset to 1.5 mm in the opposite direction with the activation button’s placement. I used a THT switch for mechanical strength, which forced the PCB to be bigger than the display so the switch’s leads didn’t cause a collision.\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/559/original/aa-pcb-offset.png?1788447760","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eTo keep the screen centered in the end product, I had to put a sizable bevel around the enclosure’s edges.\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/561/original/bevel-length.png?1788447847","metadata":{}},{"element_type":"markdown","content":"\u003cp\u003eThis is close enough to the anime. Finishing the mechanical design for the user input changed things though.\u003c/p\u003e\n\n\u003ch3\u003eActivation Button\u003c/h3\u003e\n\n\u003cp\u003eThe button to turn the device on and off is actually an assembly of a shaft and cap. There's heat-set inserts in each part and they're assembled together with a set-screw.\u003c/p\u003e\n","metadata":{"markdown":"This is close enough to the anime. Finishing the mechanical design for the user input changed things though.\n\n### Activation Button\n\nThe button to turn the device on and off is actually an assembly of a shaft and cap. There's heat-set inserts in each part and they're assembled together with a set-screw."}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/560/original/actuator-xray.png?1788447789","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eThis is where the beveled edges on the enclosure became a problem. Bear with me because this dependency tree is a little convoluted. Because the switch is on the same PCB as the display, and switches are only available at certain heights, and the activation button must be on the same axis as the switch’s actuator: the shaft for the activation button can’t sit on the top of the enclosure like in the anime.\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/576/original/switch-actuator.png?1788448211","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/572/original/render-vs-anime.png?1788448077","metadata":{}},{"element_type":"markdown","content":"\u003cp\u003eThis is fine for this first revision. I'll probably 3D print a nonfunctional version that looks more like the anime then decide which is better.\u003c/p\u003e\n\n\u003ch3\u003ePower Cable Routing\u003c/h3\u003e\n\n\u003cp\u003eFor practical reasons, I wanted the radar to run off a rechargeable battery. The slot for the charger would be easiest to put into the enclosure's back, which would thus require a vertical connector. USB-C is the default nowadays, so I went with the USB4220 series from GCT. This ultimately resulted in some problems, but more on that in the bring up phase.\u003c/p\u003e\n\n\u003cp\u003eI'm doing a little time bending here because I placed the USB-C connector in the PCB layout before defining the charging port's location in the mechanical design. I did this because electrical constraints defined the connector's position more than mechanical ones.\u003c/p\u003e\n\n\u003cp\u003eAlso, at this point I knew there was a lot of empty space on the board, so I didn't leave a special mounting place for the battery. I'll attach it to the board with some double sided tape.\u003c/p\u003e\n\n\u003ch3\u003eMounting Points\u003c/h3\u003e\n\n\u003cp\u003eSnap-fits are the premiere way to assemble parts together. But I'm too lazy to iterate through a bunch of tolerances before everything assembles well. Instead, I used heat-set inserts to mount the PCB and assemble the enclosure together. To preserve \u003ca href=\"https://en.wikipedia.org/wiki/Poka-yoke\"\u003epoka-yoke\u003c/a\u003e, I used different threads for the PCB mounting and fastening the enclosure front and back together.\u003c/p\u003e\n\n\u003cp\u003eOne of the sizes was M1 which were surprisingly expensive to source from the usually suspects. I ultimately found some on Amazon.\u003c/p\u003e\n\n\u003ch3\u003eSpeaker\u003c/h3\u003e\n\n\u003cp\u003eThe speakers I'm using thankfully ship with adhesive foam. I cut a small nest about ~0.25 mm bigger than the speaker in the enclosure's back as a mounting location. Hopefully the adhesive is enough to keep it into place. Add some holes so the sound escapes and mechanical design is done!\u003c/p\u003e\n\n\u003ch2\u003eElectronics Design\u003c/h2\u003e\n\n\u003ch3\u003eSchematic Capture\u003c/h3\u003e\n\n\u003cp\u003eAdafruit did most of the work. \"My\" design is a mashup up of the Qualia board, MAX98357 breakout, and the charging circuit from the \u003ca href=\"https://learn.adafruit.com/assets/110822\"\u003eAdafruit Feather ESP32-S3\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003eThe few modifications I made were:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eRemove the \u003ccode class=\"inline\"\u003eDN\u003c/code\u003e and \u003ccode class=\"inline\"\u003eUP\u003c/code\u003e buttons and replaced them with the button chosen in the mechanical enclosure section\u003c/li\u003e\n\u003cli\u003eRemove the STEMMA QT/Qwiic connector\u003c/li\u003e\n\u003cli\u003eReplace the JST connector with 2.54\" spaced THTs and connected all unused IO to it\u003c/li\u003e\n\u003cli\u003eAdd a heartbeat LED\u003c/li\u003e\n\u003cli\u003eReplaced jumpers with 0 ohm resistors, depopulating the ones I don't want\u003c/li\u003e\n\u003cli\u003eVarious quality of life changes like adding more test points and egregious amount of 0 ohm resistors in series with interesting traces\u003c/li\u003e\n\u003c/ul\u003e\n","metadata":{"markdown":"This is fine for this first revision. I'll probably 3D print a nonfunctional version that looks more like the anime then decide which is better.\n\n### Power Cable Routing\n\nFor practical reasons, I wanted the radar to run off a rechargeable battery. The slot for the charger would be easiest to put into the enclosure's back, which would thus require a vertical connector. USB-C is the default nowadays, so I went with the USB4220 series from GCT. This ultimately resulted in some problems, but more on that in the bring up phase.\n\nI'm doing a little time bending here because I placed the USB-C connector in the PCB layout before defining the charging port's location in the mechanical design. I did this because electrical constraints defined the connector's position more than mechanical ones.\n\nAlso, at this point I knew there was a lot of empty space on the board, so I didn't leave a special mounting place for the battery. I'll attach it to the board with some double sided tape.\n\n### Mounting Points\n\nSnap-fits are the premiere way to assemble parts together. But I'm too lazy to iterate through a bunch of tolerances before everything assembles well. Instead, I used heat-set inserts to mount the PCB and assemble the enclosure together. To preserve [poka-yoke](https://en.wikipedia.org/wiki/Poka-yoke), I used different threads for the PCB mounting and fastening the enclosure front and back together.\n\nOne of the sizes was M1 which were surprisingly expensive to source from the usually suspects. I ultimately found some on Amazon.\n\n### Speaker\n\nThe speakers I'm using thankfully ship with adhesive foam. I cut a small nest about ~0.25 mm bigger than the speaker in the enclosure's back as a mounting location. Hopefully the adhesive is enough to keep it into place. Add some holes so the sound escapes and mechanical design is done!\n\n## Electronics Design\n\n### Schematic Capture\n\nAdafruit did most of the work. \"My\" design is a mashup up of the Qualia board, MAX98357 breakout, and the charging circuit from the [Adafruit Feather ESP32-S3](https://learn.adafruit.com/assets/110822).\n\nThe few modifications I made were:\n\n- Remove the `DN` and `UP` buttons and replaced them with the button chosen in the mechanical enclosure section\n- Remove the STEMMA QT/Qwiic connector\n- Replace the JST connector with 2.54\" spaced THTs and connected all unused IO to it\n- Add a heartbeat LED\n- Replaced jumpers with 0 ohm resistors, depopulating the ones I don't want\n- Various quality of life changes like adding more test points and egregious amount of 0 ohm resistors in series with interesting traces"}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/573/original/schematic.png?1788448136","metadata":{}},{"element_type":"markdown","content":"\u003ch3\u003ePCB Layout\u003c/h3\u003e\n\n\u003ch4\u003ePlacement\u003c/h4\u003e\n\n\u003cp\u003eThe mechanical design dictated the position of the mounting holes, activation button, and the FFC connector (\u003cem\u003etechnically I could physically rotate the display and rotate the image in software but I opted just to put the connector and activation button at the vertical symmetrical axis of the device\u003c/em\u003e).\u003c/p\u003e\n\n\u003cp\u003eThis choice forced me to rotate the ESP32 package 45 degrees to avoid a THT inside a keep-out zone. I put the ESP32 on the top right of the board to give the most amount of space to place other components.\u003c/p\u003e\n","metadata":{"markdown":"### PCB Layout\n\n#### Placement\n\nThe mechanical design dictated the position of the mounting holes, activation button, and the FFC connector (*technically I could physically rotate the display and rotate the image in software but I opted just to put the connector and activation button at the vertical symmetrical axis of the device*).\n\nThis choice forced me to rotate the ESP32 package 45 degrees to avoid a THT inside a keep-out zone. I put the ESP32 on the top right of the board to give the most amount of space to place other components."}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/570/original/pcb-render.png?1788448042","metadata":{}},{"element_type":"markdown","content":"\u003cp\u003eI'm actually still violating the layout rules provided by Espressif. They recommend the antenna hang off the board ideally or, if not possible, the end of the antenna be at least 15 mm away from a cutout and that the feed point be max 2 mm from a board edge.\u003c/p\u003e\n","metadata":{"markdown":"I'm actually still violating the layout rules provided by Espressif. They recommend the antenna hang off the board ideally or, if not possible, the end of the antenna be at least 15 mm away from a cutout and that the feed point be max 2 mm from a board edge."}},{"element_type":"markdown","content":"\u003cp\u003eIf I hung the antenna off the board it'd collide with the enclosure and I didn't want to make it any larger.\u003c/p\u003e\n","metadata":{"markdown":"If I hung the antenna off the board it'd collide with the enclosure and I didn't want to make it any larger."}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/565/original/esp32-placement-render.png?1788447944","metadata":{}},{"element_type":"markdown","content":"\u003cp\u003eTo make rework and hand-soldering easier, I used 0805 sized components wherever I could. This would make my life easier once the boards came back.\u003c/p\u003e\n\n\u003ch4\u003eStack-up\u003c/h4\u003e\n\n\u003cp\u003eI decided to do a 1.6 mm thick (foreshadowing), 4 layer stack-up of \u003ccode class=\"inline\"\u003esignal+ground/ground/ground/signal+ground\u003c/code\u003e. The RGB565 parallel signals were my greatest concern. The two inner ground layers would shield signals on layer 4 from the RGB. Layer 1 would have the USB 2.0 traces which technically should be fabricated to 90 ohm, but in practice I've never had problems omitting a controlled impedance. I still routed the signals differential though. The four layer stack-up also made it much easier to route 3.3 V power rail on layer 4.\u003c/p\u003e\n\n\u003ch4\u003eRouting\u003c/h4\u003e\n\n\u003cp\u003eThe most interesting part to route was the USB-C connector. It has a keep-out zone near the pads that make it almost impossible to connect the USB D+/D- pins and VBUS pins together.\u003c/p\u003e\n","metadata":{"markdown":"To make rework and hand-soldering easier, I used 0805 sized components wherever I could. This would make my life easier once the boards came back.\n\n#### Stack-up\n\nI decided to do a 1.6 mm thick (foreshadowing), 4 layer stack-up of `signal+ground/ground/ground/signal+ground`. The RGB565 parallel signals were my greatest concern. The two inner ground layers would shield signals on layer 4 from the RGB. Layer 1 would have the USB 2.0 traces which technically should be fabricated to 90 ohm, but in practice I've never had problems omitting a controlled impedance. I still routed the signals differential though. The four layer stack-up also made it much easier to route 3.3 V power rail on layer 4.\n\n#### Routing\n\nThe most interesting part to route was the USB-C connector. It has a keep-out zone near the pads that make it almost impossible to connect the USB D+/D- pins and VBUS pins together."}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/577/original/usbc-drawing.png?1788448239","metadata":{}},{"element_type":"markdown","content":"\u003cp\u003eI interpreted the keep-out zone as only for components and not for all copper. I'm justifying this conclusion with the metal flaps on the side of the connector (these will rear their ugly head once the board is made).\u003c/p\u003e\n","metadata":{"markdown":"I interpreted the keep-out zone as only for components and not for all copper. I'm justifying this conclusion with the metal flaps on the side of the connector (these will rear their ugly head once the board is made)."}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/581/original/usb-flap.png?1788448366","metadata":{}},{"element_type":"markdown","content":"\u003cp\u003eEverything else was fairly straight forward to route.\u003c/p\u003e\n\n\u003ch3\u003eOrdering\u003c/h3\u003e\n\n\u003cp\u003eWhile ordering the board, I realized that I assigned a 100 \u003cem\u003euF\u003c/em\u003e decoupling capacitor for the ESP32 instead of a 100 \u003cem\u003enF\u003c/em\u003e cap. If you hadn't caught on to the trend, I am lazy. I didn't want to regenerate the gerbers so I just DNP'd the cap.\u003c/p\u003e\n\n\u003cp\u003eThe USB-C connector was also out-of-stock. I already designed the mechanical enclosure around that connectors height and (re: lazy) DNP'd that part thinking I could hand solder it on once the boards arrive. That was not a safe assumption.\u003c/p\u003e\n\n\u003ch2\u003eBoard Bring-Up\u003c/h2\u003e\n\n\u003ch3\u003ePhysical Inspection\u003c/h3\u003e\n\n\u003cp\u003eOnce the boards came back, I realized just how large they are.\u003c/p\u003e\n","metadata":{"markdown":"Everything else was fairly straight forward to route.\n\n### Ordering\n\nWhile ordering the board, I realized that I assigned a 100 *uF* decoupling capacitor for the ESP32 instead of a 100 *nF* cap. If you hadn't caught on to the trend, I am lazy. I didn't want to regenerate the gerbers so I just DNP'd the cap.\n\nThe USB-C connector was also out-of-stock. I already designed the mechanical enclosure around that connectors height and (re: lazy) DNP'd that part thinking I could hand solder it on once the boards arrive. That was not a safe assumption.\n\n## Board Bring-Up\n\n### Physical Inspection\n\nOnce the boards came back, I realized just how large they are."}},{"element_type":"markdown","content":"\u003cp\u003eThe PCBAs are about as large as they can comfortably fit in my hand and that's before they're put in a larger assembly. I'll certainly have to use a wrist strap for the final build.\u003c/p\u003e\n\n\u003ch3\u003eSmoke Test\u003c/h3\u003e\n\n\u003cp\u003eI plugged in a battery into the board and… smoke. Quickly, I realized my mistake. I swapped the battery connector polarity. The Adafruit designed I based it on used a horizontal connector, while mine is vertical. This shouldn't matter, but the manufacturer flipped the location of pin 1 on the datasheet.\u003c/p\u003e\n","metadata":{"markdown":"The PCBAs are about as large as they can comfortably fit in my hand and that's before they're put in a larger assembly. I'll certainly have to use a wrist strap for the final build.\n\n### Smoke Test\n\nI plugged in a battery into the board and… smoke. Quickly, I realized my mistake. I swapped the battery connector polarity. The Adafruit designed I based it on used a horizontal connector, while mine is vertical. This shouldn't matter, but the manufacturer flipped the location of pin 1 on the datasheet."}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/568/original/jst-ph-footprint.png?1788448003","metadata":{}},{"element_type":"markdown","content":"\u003cp\u003eI should’ve caught this, but I will remind JST that pin 1 should be on the top left of a footprint to comply with an \u003ca href=\"https://www.protoexpress.com/blog/features-of-ipc-7351-standards-to-design-pcb-component-footprint/#zero-component-orientation\"\u003eIPC 7351\u003c/a\u003e . Thankfully Q1 and D7 act as reverse polarity protection for the rest of the circuitry.\u003c/p\u003e\n","metadata":{"markdown":"I should’ve caught this, but I will remind JST that pin 1 should be on the top left of a footprint to comply with an [IPC 7351](https://www.protoexpress.com/blog/features-of-ipc-7351-standards-to-design-pcb-component-footprint/#zero-component-orientation) . Thankfully Q1 and D7 act as reverse polarity protection for the rest of the circuitry."}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/571/original/q1-d7.png?1788448060","metadata":{}},{"element_type":"markdown","content":"\u003ch3\u003eUSB-C\u003c/h3\u003e\n\n\u003cp\u003eNow comes the most egregious mistake I made in the design that I so un-elegantly foreshadowed earlier. I couldn't connect a battery so next step was to solder on the USB-C connector.\u003c/p\u003e\n\n\u003cp\u003eWhile earlier I mentioned how surprisingly large the board was. The USB-C pads were surprisingly \u003cem\u003esmall\u003c/em\u003e.\u003c/p\u003e\n","metadata":{"markdown":"### USB-C\n\nNow comes the most egregious mistake I made in the design that I so un-elegantly foreshadowed earlier. I couldn't connect a battery so next step was to solder on the USB-C connector.\n\nWhile earlier I mentioned how surprisingly large the board was. The USB-C pads were surprisingly *small*."}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/578/original/usbc-pads.png?1788448297","metadata":{}},{"element_type":"markdown","content":"\u003cp\u003eI figured I had my work cutout for me, but then I placed the USB-C connector on the board and spotted another grievous error. The mounting pins for the connector were 1.2 mm long, but the board is 1.6 mm thick.\u003c/p\u003e\n","metadata":{"markdown":"I figured I had my work cutout for me, but then I placed the USB-C connector on the board and spotted another grievous error. The mounting pins for the connector were 1.2 mm long, but the board is 1.6 mm thick."}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/579/original/usbc-tht-length.png?1788448318","metadata":{}},{"element_type":"markdown","content":"\u003cp\u003eEven if it was in stock, no company on the planet could assemble the connector onto the board. The next revision will have to use a thinner PCB. If you scroll up to the \u003ca href=\"#routing\"\u003ePCB Routing section\u003c/a\u003e you'll notice the footprint has a 1.2 mm PCB thickness recommendation.\u003c/p\u003e\n\n\u003cp\u003eBut the mistakes didn't end there. With the connector on the board, the SMT[\u003csup\u003e14]\u003c/sup\u003e pads are inaccessible thanks to those aforementioned side flaps.\u003c/p\u003e\n","metadata":{"markdown":"Even if it was in stock, no company on the planet could assemble the connector onto the board. The next revision will have to use a thinner PCB. If you scroll up to the [PCB Routing section](#routing) you'll notice the footprint has a 1.2 mm PCB thickness recommendation.\n\nBut the mistakes didn't end there. With the connector on the board, the SMT[^14] pads are inaccessible thanks to those aforementioned side flaps."}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003e\u003cspan\u003eThankfully, the connector I chose was USB 2.0, not 3.0. With some bodge wires and a spare USB-A plug, I made a haphazard USB cable… which created a short across VBUS and ground. My second attempt worked though. I was able to flash the ESP32 with CircuitPython and upload code to it 😎.\u003c/span\u003e\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"markdown","content":"\u003cp\u003eAlso, the process to get CircuitPython on my board was slightly different than the Qualia. This is the tutorial I followed to do it: \"\u003ca href=\"https://learn.adafruit.com/circuitpython-with-esp32-quick-start/installing-circuitpython\"\u003ehttps://learn.adafruit.com/circuitpython-with-esp32-quick-start/installing-circuitpython\u003c/a\u003e\".\u003c/p\u003e\n","metadata":{"markdown":"Also, the process to get CircuitPython on my board was slightly different than the Qualia. This is the tutorial I followed to do it: \"https://learn.adafruit.com/circuitpython-with-esp32-quick-start/installing-circuitpython\"."}},{"element_type":"markdown","content":"\u003ch3\u003eBattery Charging/Monitoring\u003c/h3\u003e\n\n\u003cp\u003eI had some faith the battery charger, MCP73831, still functioned because its status LED blinked when the board was on with no battery connected. In the absence of a battery emulator, I connected a lipo[\u003csup\u003e16]\u003c/sup\u003e to the board with some hook-to-DuPont connectors, a 2-pin JST-PH pigtail cable, and the enduring will of the human spirit.\u003c/p\u003e\n","metadata":{"markdown":"### Battery Charging/Monitoring\n\nI had some faith the battery charger, MCP73831, still functioned because its status LED blinked when the board was on with no battery connected. In the absence of a battery emulator, I connected a lipo[^16] to the board with some hook-to-DuPont connectors, a 2-pin JST-PH pigtail cable, and the enduring will of the human spirit."}},{"element_type":"markdown","content":"\u003cp\u003eAccording to the datasheet, the status LED should be on during charging and off otherwise.\u003c/p\u003e\n","metadata":{"markdown":"According to the datasheet, the status LED should be on during charging and off otherwise."}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/562/original/charge-stat-table.png?1788447889","metadata":{}},{"element_type":"markdown","content":"\u003cp\u003eThis is exactly what happened. I found a some CircuitPython test code for the battery monitor and easily read the voltage.\u003c/p\u003e\n","metadata":{"markdown":"This is exactly what happened. I found a some CircuitPython test code for the battery monitor and easily read the voltage."}},{"element_type":"code","content":"# SPDX-FileCopyrightText: Copyright (c) 2022 ladyada for Adafruit Industries\n#\n# SPDX-License-Identifier: Unlicense\n\nimport time\nimport board\nimport adafruit_max1704x\n\ni2c = board.I2C()  # uses board.SCL and board.SDA\n# i2c = board.STEMMA_I2C()  # For using the built-in STEMMA QT connector on a microcontroller\nmax17 = adafruit_max1704x.MAX17048(i2c)\n\nprint(\n    \"Found MAX1704x with chip version\",\n    hex(max17.chip_version),\n    \"and id\",\n    hex(max17.chip_id),\n)\n\n# Quick starting allows an instant 'auto-calibration' of the battery. However, its a bad idea\n# to do this right when the battery is first plugged in or if there's a lot of load on the battery\n# so uncomment only if you're sure you want to 'reset' the chips charge calculator.\n# print(\"Quick starting\")\n# max17.quick_start = True\n\nwhile True:\n    print(f\"Battery voltage: {max17.cell_voltage:.2f} Volts\")\n    print(f\"Battery state  : {max17.cell_percent:.1f} %\")\n    print(\"\")\n    time.sleep(1)","metadata":{"language":"python","filename":"","linenums":false}},{"element_type":"markdown","content":"\u003cp\u003eI didn't bother testing how accurate the monitor was as the battery discharged since it'd be hard to track with the USB cable disconnected.\u003c/p\u003e\n\n\u003ch3\u003eDisplay\u003c/h3\u003e\n\n\u003cp\u003eI plugged in a known good 4\" display into my PCBA, programmed the board with example code, and… nothing. The display's back-light turned on which tells me that the pin-out for the connector was correct and that I2C works (only partially true, keep reading) since the I2C expander controls the LED driver.\u003c/p\u003e\n\n\u003cp\u003eI began to search TTL RGB routing guidelines to see if I violated any rules (you can view that in detail in this \u003ca href=\"https://forums.adafruit.com/viewtopic.php?t=224858\"\u003eforum post\u003c/a\u003e), but I didn't find anything specific. What ultimately led me to the cause was comparing the waveforms on my board vs the Qualia. All the RGB565 signals looked fine, but when the Qualia booted, its I2C expander (the PCA9554) sent SPI signals to the display. There were no SPI signals on my board. The ESP32 produced the expected I2C signals, but the PCA9554 didn't respond. I realized the problem after doing a port scan.\u003c/p\u003e\n\n\u003cp\u003eThe example code from Adafruit assumed the I2C address was \u003ccode class=\"inline\"\u003e0x63\u003c/code\u003ewhile my board configures it to \u003ccode class=\"inline\"\u003e0x27\u003c/code\u003e. I actually left a note about this confusion on my schematic.\u003c/p\u003e\n","metadata":{"markdown":"I didn't bother testing how accurate the monitor was as the battery discharged since it'd be hard to track with the USB cable disconnected.\n\n### Display\n\nI plugged in a known good 4\" display into my PCBA, programmed the board with example code, and… nothing. The display's back-light turned on which tells me that the pin-out for the connector was correct and that I2C works (only partially true, keep reading) since the I2C expander controls the LED driver.\n\nI began to search TTL RGB routing guidelines to see if I violated any rules (you can view that in detail in this [forum post](https://forums.adafruit.com/viewtopic.php?t=224858)), but I didn't find anything specific. What ultimately led me to the cause was comparing the waveforms on my board vs the Qualia. All the RGB565 signals looked fine, but when the Qualia booted, its I2C expander (the PCA9554) sent SPI signals to the display. There were no SPI signals on my board. The ESP32 produced the expected I2C signals, but the PCA9554 didn't respond. I realized the problem after doing a port scan.\n\nThe example code from Adafruit assumed the I2C address was `0x63`while my board configures it to `0x27`. I actually left a note about this confusion on my schematic."}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/567/original/io-expander-schematic.png?1788447975","metadata":{}},{"element_type":"markdown","content":"\u003cp\u003eSetting the proper I2C address made the display work properly.\u003c/p\u003e\n\n\u003ch3\u003eSound\u003c/h3\u003e\n\n\u003cp\u003eWhen I plugged in a speaker and loaded up example code… nothing. Not even the crackling sound I heard during the prototyping phase. I probed the pins of the I2S chip, the MAX98357, and quickly realized the pin assignment for the PCB and the breadboard prototype were different.\u003c/p\u003e\n\n\u003cp\u003eFor easier routing, I made the following changes from prototype to PCB:\u003c/p\u003e\n\n\u003ctable\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003cth\u003eMAX98357 Pin\u003c/th\u003e\n\u003cth\u003eQualia Pin Assignment\u003c/th\u003e\n\u003cth\u003eCustom Board Assignment\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003eBit Clock\u003c/td\u003e\n\u003ctd\u003eboard.A1\u003c/td\u003e\n\u003ctd\u003eboard.A0\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eLeft/Right Clock\u003c/td\u003e\n\u003ctd\u003eboard.A0\u003c/td\u003e\n\u003ctd\u003eboard.RX\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eData In\u003c/td\u003e\n\u003ctd\u003eboard.TX\u003c/td\u003e\n\u003ctd\u003eboard.A1\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003cp\u003eEverything worked after changing the pin assignments in firmware. The sound output was clean too. This makes me confident that the horrendous sound coming out of the prototype was due to bad wiring.\u003c/p\u003e\n\n\u003cp\u003eWhile I'm 99% sure the mismapped pinout was the only problem, before I discovered it, I replaced the pull up resistor on the \u003ccode class=\"inline\"\u003eSD_MODE\u003c/code\u003e pin with an 1M ohm one to match Adafruit's breakout board. I would swap back to the original 5.1k resistor, but I consider the board verified at this point.\u003c/p\u003e\n\n\u003ch2\u003eNext Steps\u003c/h2\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cp\u003eI have to swap the polarity of the battery connector. \u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eI have to make the board thinner.\u003c/p\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eThat's it. Not bad for a first revision. At this point, I could try to assemble the display and PCB into the enclosure, but it'd be inconvenient to have to disassemble the entire project just to charge the battery. I'll sort out mechanical assembly once the new PCB comes in.\u003c/p\u003e\n\n\u003cp\u003eThe repository for this project, though completely undocumented as of writing this, is hosted on \u003ca href=\"https://codeberg.org/extralongdivision/dbz-radar\"\u003eCodeberg\u003c/a\u003e. I'll post another write up here when it's ready. \u003ca href=\"https://cloud.umami.is/q/4vO3PdsPN\"\u003eSubscribe to my RSS feed\u003c/a\u003e to get the update as soon as it drops.\u003c/p\u003e\n","metadata":{"markdown":"Setting the proper I2C address made the display work properly.\n\n### Sound\n\nWhen I plugged in a speaker and loaded up example code… nothing. Not even the crackling sound I heard during the prototyping phase. I probed the pins of the I2S chip, the MAX98357, and quickly realized the pin assignment for the PCB and the breadboard prototype were different.\n\nFor easier routing, I made the following changes from prototype to PCB:\n\n| MAX98357 Pin     | Qualia Pin Assignment  | Custom Board Assignment |\n| ---------------- | ---------------------- | ----------------------- |\n| Bit Clock        | board.A1               | board.A0                |\n| Left/Right Clock | board.A0               | board.RX                |\n| Data In          | board.TX               | board.A1                |\n\nEverything worked after changing the pin assignments in firmware. The sound output was clean too. This makes me confident that the horrendous sound coming out of the prototype was due to bad wiring.\n\nWhile I'm 99% sure the mismapped pinout was the only problem, before I discovered it, I replaced the pull up resistor on the `SD_MODE` pin with an 1M ohm one to match Adafruit's breakout board. I would swap back to the original 5.1k resistor, but I consider the board verified at this point.\n\n## Next Steps\n\n- I have to swap the polarity of the battery connector. \n\n- I have to make the board thinner.\n\nThat's it. Not bad for a first revision. At this point, I could try to assemble the display and PCB into the enclosure, but it'd be inconvenient to have to disassemble the entire project just to charge the battery. I'll sort out mechanical assembly once the new PCB comes in.\n\nThe repository for this project, though completely undocumented as of writing this, is hosted on [Codeberg](https://codeberg.org/extralongdivision/dbz-radar). I'll post another write up here when it's ready. [Subscribe to my RSS feed](https://cloud.umami.is/q/4vO3PdsPN) to get the update as soon as it drops."}}]