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

J2
TP2
U1
TP1
J3
R1
Resistance
470Ω
R2
Resistance
10.11kΩ
J1
Project Specification
Project Overview
  • Status: Draft - functional blocks will be verified individually before integration.
  • Build a compact multifunction controller around an M5Stack Dial for a 2004 Toyota Tacoma.
  • Control a Joying JY-UZD80N8 Android head unit through its steering-wheel-control input and a Valvetronic exhaust controller through a hidden spare RF remote.
Intended Use
  • Permanently installed behind the dashboard and powered only while ignition/ACC is active.
  • Initial development uses a breadboard; final implementation will use compact perfboard or preferably a custom PCB with proper connectors.
  • The builder will validate each block using a multimeter before integration.
What the Device Should Do
  • Dial clockwise: radio volume up.
  • Dial counterclockwise: radio volume down.
  • Single press: radio mute/unmute.
  • Double press: toggle exhaust between OPEN and QUIET/CLOSED.
  • Normally show a Toyota/LS-themed idle display and time.
  • Temporarily show volume or exhaust status after an action.
  • Preserve spare GPIO capability for future garage-door, auxiliary-light, or gauge functions.
Main Features
  • M5Stack Dial ESP32-S3 user interface.
  • Joying KEY1/KEY2/SWC-compatible radio-control interface; exact resistor values and topology must be measured, not assumed.
  • Two galvanically isolated PC817 channels that imitate the Valvetronic remote's S1 and S2 button presses.
  • Protected automotive 12 V input and regulated 5 V supply for the M5Stack Dial.
  • Optional regulated approximately 3 V remote supply to be evaluated against retaining the CR2032.
  • Labeled connectors and short serviceable harnesses.
System Architecture

Diagram


"Truck switched node_12V" "Fuse and automotive input protection" "12V to regulated node_5V" "M5Stack Dial ESP32-S3" "Radio control interface" "Joying KEY1 KEY2 SWC input" "OPEN GPIO and series resistor" "PC817 channel 1" "Remote S1 contacts" "QUIET GPIO and series resistor" "PC817 channel 2" "Remote S2 contacts" "Hidden Valvetronic RF remote" "RF link" "Existing Valvetronic controller"
Hardware Subsystems
M5Stack Dial
  • Provides rotary input, press detection, display, timekeeping, GPIO control, and firmware behavior.
  • Exact accessible GPIO assignments will be confirmed from the M5Stack Dial documentation before schematic wiring.
Exhaust Remote Interface
  • PC817 pinout, top view with dot at pin 1: 1 anode, 2 cathode, 3 emitter, 4 collector.
  • Each LED is presently driven from a 3.3 V GPIO through 470 ohms to pin 1; pin 2 returns to M5Stack ground.
  • Isolated transistor connections:
    • S1: pin 4 collector to bottom/high-side contact; pin 3 emitter to top/low-side contact.
    • S2: pin 4 collector to right/high-side contact; pin 3 emitter to left/low-side contact.
  • Measured remote switch differential is approximately 3.27 V with each switch normally open and shorted while pressed.
  • The remote must remain galvanically isolated from the M5Stack side.
Radio Interface
  • Joying model: JY-UZD80N8.
  • Harness provides KEY1 and KEY2 wires.
  • Determine whether SWC ground is separate and measure the radio's recognition thresholds/resistor values using its learning interface.
  • Circuit must imitate steering-wheel buttons without modifying the audio signal.
Vehicle Power
  • Source is switched ACC/ignition automotive 12 V.
  • Design must tolerate relevant vehicle transients and include a fuse, reverse-polarity protection, surge/load-dump mitigation as appropriate, filtering, and a qualified 5 V regulator.
  • Do not connect raw vehicle 12 V directly to the M5Stack Dial.
Interfaces and Connections

Table


InterfacePreliminary definition
Vehicle inputSwitched 12 V and chassis ground through protected supply block
M5Stack supplyRegulated 5 V; connector and current rating TBD from documentation
Joying radioKEY1, KEY2, and SWC ground if present; exact electrical behavior TBD by measurement
Remote S1Isolated PC817 transistor across measured S1 contacts
Remote S2Isolated PC817 transistor across measured S2 contacts
ExpansionSpare GPIO connector with ground and an appropriate low-voltage rail
Power and Runtime Expectations
  • Operates only with ignition/ACC on; no parked-vehicle standby requirement.
  • The hidden RF remote may retain its CR2032 or use an isolated regulated approximately 3 V supply after its current demand and power topology are verified.
Power Tree and Power Budget
  • Current budget is pending M5Stack Dial measured/verified consumption and regulator selection.
  • Initial tree: switched 12 V -> fuse/protection/filter -> 5 V regulator -> M5Stack Dial and interface circuitry.
  • Any remote replacement supply must not defeat optocoupler isolation.
Manufacturing and Assembly Expectations
  • Validate on breadboard one block at a time.
  • Final board should fit behind the dashboard, use labeled locking/polarized connectors where practical, and avoid loose Dupont wiring.
  • Include accessible test points for 5 V, 3.3 V/GPIO drive, ground, and each optocoupler output during bring-up.
Firmware-Relevant Hardware Requirements
  • Detect dial direction, single press, and double press reliably.
  • Generate short simulated button presses rather than holding outputs indefinitely.
  • Interlock exhaust outputs so OPEN and QUIET cannot be asserted simultaneously.
  • Preserve configurable timing and spare GPIO for future expansion.
Physical Design Expectations
  • Compact enclosed installation behind the Tacoma dashboard.
  • Short harness to the Dial, Joying radio, vehicle power, and hidden RF remote.
  • Automotive-appropriate strain relief, insulation, and heat-shrink.
Important Design Decisions
  • Use the Joying SWC interface rather than altering audio signals.
  • Retain the existing Valvetronic controller and imitate the spare remote's buttons.
  • Use PC817 optocouplers for galvanic isolation of both exhaust channels.
  • Verify and simulate one PC817 channel before duplicating it.
  • Do not finalize radio or power circuitry until required measurements and datasheet data are available.
Assumptions
  • KEY1 and KEY2 are accessible at the Joying harness; SWC ground availability remains to be confirmed.
  • The measured remote switch polarity is correct, but the spare remote will be paired before wires are soldered.
  • The remote switch current is low enough for an optocoupler transistor; this must be confirmed through test/simulation and, if possible, current measurement.
Change Notes
  • Initial specification created from the user's detailed design brief.
  • First engineering task is a single-channel PC817 calculation and simulation using 3.3 V GPIO drive and a 470 ohm resistor.
  • Project Overview

  • Intended Use

  • What the Device Should Do

  • Main Features

  • System Architecture

  • Hardware Subsystems

  • M5Stack Dial

  • Exhaust Remote Interface

  • Radio Interface

  • Vehicle Power

  • Interfaces and Connections

  • Power and Runtime Expectations

  • Power Tree and Power Budget

  • Manufacturing and Assembly Expectations

  • Firmware-Relevant Hardware Requirements

  • Physical Design Expectations

  • Important Design Decisions

  • Assumptions

  • Change Notes