PCB Design Basics


So was I supposed to delete everything in Tacoma_dial_exhaust_test.INO and replace it with the new one sent
Yes. Replace everything in Tacoma_Dial_Exhaust_Test.ino with the new artwork-based firmware.
  1. Open the .ino tab.
  2. Press Ctrl+A, then Delete.
  3. Copy the complete revised .ino code from Firmware Starter.
  4. Paste it into the empty .ino tab.
  5. Add a second tab using the small dropdown/three-dot menu near the sketch tabs.
  6. Name the second tab exactly:

Text


ui_assets.h
  1. Copy the complete asset-header code from the document into that tab.
  2. Confirm the .ino begins with:

Cpp


#include <Arduino.h>
#include <M5Dial.h>
#include "ui_assets.h"
  1. Click Verify, then Upload.
Do not paste the new code below the old code—it must completely replace it.
Replace file contents
Check asset tab
Use embedded art

Breadboard Wiring Layout
Beginner PC817 breadboard preview

Image

Use the image as an orientation preview and the hole-by-hole tables below as the authoritative wiring instructions. Verify each connection before applying power.
Purpose
This is the physical breadboard layout for one PC817 test channel only. The Valvetronic remote stays disconnected during this test.
Breadboard Orientation
  • Put the breadboard lengthwise with the center trench running vertically.
  • Row letters A-E are on the left of the center trench; F-J are on the right.
  • Place the PC817 across the center trench.
  • Look at the PC817 from above with its dot/notch toward the top of the breadboard.
Exact PC817 Placement

Table


PC817 pinFunctionBreadboard hole
Pin 1LED anodeE20
Pin 2LED cathodeE21
Pin 4CollectorF20
Pin 3EmitterF21
Top-view orientation:

Text


             TOP OF BREADBOARD

             dot / notch
                  v
       left side       center gap       right side

       E20  Pin 1      |       |        Pin 4  F20
       E21  Pin 2      |       |        Pin 3  F21

             BOTTOM OF BREADBOARD
Important: DIP pin numbering runs counterclockwise. With the dot/notch at the top, pin 1 is upper-left, pin 2 lower-left, pin 3 lower-right, and pin 4 upper-right.
Control Side - Left Half Only
Use the M5Stack/control-side source or a separate regulated 3.3 V bench source.
  1. Put one lead of the 470 ohm resistor into A20. This shares a row with PC817 pin 1 at E20.
  2. Put the other resistor lead into any unused row, suggested A15.
  3. Connect the 3.3 V control wire to the resistor lead at row 15.
  4. Connect control ground to A21. This shares a row with PC817 pin 2 at E21.
Control path:

Text


3.3V GPIO/source -> 470 ohm resistor -> PC817 pin 1
control ground ----------------------> PC817 pin 2
Suggested wire colors:
  • Blue: GPIO/control signal.
  • Black: M5/control ground.
Isolated Test Side - Right Half Only
Use the CR2032 or another isolated approximately 3.0 to 3.3 V source. Do not connect this source's negative terminal to M5/control ground.
  1. Put one lead of the measured 10.11 kohm resistor into J20. This shares a row with PC817 pin 4 at F20.
  2. Put the other resistor lead into an unused row, suggested J15.
  3. Connect remote/test supply positive to the resistor lead at row 15.
  4. Connect remote/test supply negative to J21. This shares a row with PC817 pin 3 at F21.
Isolated output path:

Text


remote battery positive -> 10.11 kohm -> PC817 pin 4
remote battery negative ----------------> PC817 pin 3
Suggested wire colors:
  • Red or orange: isolated remote/test positive.
  • White or green: SW_HIGH collector test node at row 20.
  • Black on the right side only: isolated remote/test negative.
Complete Hole-by-Hole Table

Table


ConnectionFromTo
PC817 input LEDU1 pin 1E20
PC817 input returnU1 pin 2E21
PC817 emitterU1 pin 3F21
PC817 collectorU1 pin 4F20
470 ohm resistorA15A20
GPIO/control signalsource outputB15
M5/control groundsource groundA21
10.11 kohm resistorJ15J20
Remote/test positivebattery positiveI15
Remote/test negativebattery negativeJ21
Meter red probe for output testmeter redany open hole G20-J20
Meter black probe for output testmeter blackany open hole G21-J21
Rows 15 are arbitrary tie points. Any unused rows may replace them as long as each resistor still remains in series and does not accidentally short across a connected row.
Simplified Visual Map

Text


LEFT: M5 / CONTROL DOMAIN          RIGHT: ISOLATED REMOTE TEST DOMAIN

3.3V ----[470 ohm]---- row 20 ---- pin 1   pin 4 ---- row 20 ----[10.11k]---- +3.27V
GND ------------------ row 21 ---- pin 2   pin 3 ---- row 21 ---------------- 0V

                                      PC817
                               across center trench
There must be no jumper between the left and right ground rails. The only coupling between the two sides is light inside the PC817.
Multimeter Check Before Power
Set the meter to resistance or continuity mode and remove both power sources.
  1. Check between M5/control ground and remote/test negative. It should read open circuit/no beep.
  2. Check row E20 to PC817 pin 1 and E21 to pin 2. Each should have continuity through the breadboard row.
  3. Check row F20 to pin 4 and F21 to pin 3. Each should have continuity.
  4. Ensure the 470 ohm resistor measures close to 470 ohms and the pull-up measures close to 10.11 kohms when removed from the board or isolated from parallel paths.
Powered Measurements
Set the meter to DC volts.
GPIO/Input OFF
  • Red probe: PC817 pin 4 row, such as J20.
  • Black probe: PC817 pin 3 row, such as J21.
  • Expected result: approximately the isolated battery voltage.
GPIO/Input ON at 3.3 V
  • LED test: red probe on E20, black probe on E21. Expect roughly 1.0 to 1.3 V.
  • Input-resistor test: red probe at row 15 GPIO side, black probe at row 20 pin-1 side. Expect roughly 2.0 to 2.3 V.
  • Output test: red probe on J20, black probe on J21. Expect typically below approximately 0.3 V with the 10.11 kohm pull-up.
What Not to Connect Yet
  • Do not solder or connect the Valvetronic remote S1/S2 contacts yet.
  • Do not connect truck 12 V anywhere on this breadboard.
  • Do not connect Joying KEY1 or KEY2.
  • Do not join the two ground domains.
Matching Flux Schematic
The project schematic uses:
  • J1: GPIO_3V3 and M5_GND.
  • R1: 470 ohm input resistor.
  • U1: PC817C DIP-4.
  • J2: REMOTE_3V27 and REMOTE_GND.
  • R2: 10.11 kohm test pull-up.
  • J3/TP2: SW_HIGH output measurement.
The schematic and this layout describe the same circuit; the schematic shows electrical intent, while this file specifies physical breadboard holes.
  • Purpose

  • Breadboard Orientation

  • Exact PC817 Placement

  • Control Side - Left Half Only

  • Isolated Test Side - Right Half Only

  • Complete Hole-by-Hole Table

  • Simplified Visual Map

  • Multimeter Check Before Power

  • Powered Measurements

  • GPIO/Input OFF

  • GPIO/Input ON at 3.3 V

  • What Not to Connect Yet

  • Matching Flux Schematic