Æthel Drive Hardware Design

Completed the Æthel Drive schematic instantiation and wiring.
  • Added and wired ESP32 DevKitC, L298N, MPU6050, SSD1306 OLED, ACS712-05B, LM2596 buck module, 12 V/E-stop connector, motor connector, I2C pull-ups, ADC dividers, decoupling/bulk capacitors, and L298N flyback diodes.
  • Shared I2C bus is on GPIO21/GPIO22 with 4.7 kΩ pull-ups to 3.3 V.
  • L298N channel A uses GPIO25 for PWM enable, GPIO26/GPIO27 for direction.
  • ACS712 output and 0–12 V motor voltage are scaled before ESP32 ADC GPIO34/GPIO35.
  • E-stop is wired as a hardware motor-rail cutoff path while keeping ESP32 logic powered.
  • ERC/review now reports no open errors or warnings for the checked schematic categories.
Important voltage-level notes:
  • I2C pull-ups are to 3.3 V, which is correct for ESP32.
  • ACS712 is a 5 V part; its analog output is divided down before GPIO34.
  • The OLED module is powered from 5 V but shares 3.3 V I2C pull-ups; this is acceptable only if the OLED module does not add onboard pull-ups to 5 V.
  • The L298N accepts ESP32 3.3 V logic as HIGH in typical use, but verify the exact module/IC threshold if using a clone board.
I also created:
Schematic is ready for your review before moving to layout.
Proceed to layout
Fix voltage risks
Add test points
Review power sizing
Add debug header
U1
U2
PS1
U3
R4
Resistance
10kΩ
J2
R2
Resistance
4.7kΩ
U4
D7
Manufacturer Part Number
1N5819
R1
Resistance
4.7kΩ
D5
Manufacturer Part Number
1N5819
J1
C4
Capacitance
100nF
D6
Manufacturer Part Number
1N5819
R3
Resistance
30kΩ
C2
Capacitance
470uF
D4
Manufacturer Part Number
1N5819
OLED1
C1
Capacitance
470uF
R6
Resistance
20kΩ
C3
Capacitance
100nF
R5
Resistance
10kΩ
C6
Capacitance
1nF
C5
Capacitance
100nF
C7
Capacitance
100nF

Refine this doc
Ask about this doc
Firmware Starter — Æthel Drive ESP32 DevKitC
Pin Mapping

Table


FunctionESP32 GPIONetNotes
I2C SDA21I2C_SDAMPU6050 + SSD1306, 4.7 kΩ pull-up to 3V3
I2C SCL22I2C_SCLMPU6050 + SSD1306, 4.7 kΩ pull-up to 3V3
L298N ENA PWM25MOTOR_PWM_ENALEDC PWM-capable
L298N IN126MOTOR_IN1Direction
L298N IN227MOTOR_IN2Direction
MPU6050 INT16MPU6050_INTOptional interrupt
Current ADC34ADC_MOTOR_CURRENTADC1 input-only
Voltage ADC35ADC_MOTOR_VOLTAGEADC1 input-only
platformio.ini

Ini


[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
lib_deps =
  adafruit/Adafruit MPU6050@^2.2.6
  adafruit/Adafruit SSD1306@^2.5.13
  adafruit/Adafruit GFX Library@^1.11.11
src/main.cpp

Cpp


#include <Arduino.h>
#include <Wire.h>
#include <WiFi.h>
#include <Adafruit_MPU6050.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_SSD1306.h>

#define I2C_SDA_PIN 21
#define I2C_SCL_PIN 22
#define MOTOR_PWM_ENA_PIN 25
#define MOTOR_IN1_PIN 26
#define MOTOR_IN2_PIN 27
#define MPU6050_INT_PIN 16
#define ADC_MOTOR_CURRENT_PIN 34
#define ADC_MOTOR_VOLTAGE_PIN 35

#define PWM_CHANNEL 0
#define PWM_FREQ_HZ 20000
#define PWM_RES_BITS 10
#define OLED_WIDTH 128
#define OLED_HEIGHT 64

Adafruit_MPU6050 mpu;
Adafruit_SSD1306 display(OLED_WIDTH, OLED_HEIGHT, &Wire, -1);

static unsigned long lastSampleMs = 0;

float readMotorVoltageV() {
  uint16_t raw = analogRead(ADC_MOTOR_VOLTAGE_PIN);
  float adcV = raw * 3.3f / 4095.0f;
  return adcV * 4.0f; // 30k/10k divider: ADC = VIN * 0.25
}

float readMotorCurrentA() {
  uint16_t raw = analogRead(ADC_MOTOR_CURRENT_PIN);
  float adcV = raw * 3.3f / 4095.0f;
  float acsV = adcV * 1.5f; // 10k/20k divider: ADC = ACS * 2/3
  return (acsV - 2.5f) / 0.185f; // ACS712-05B typ sensitivity
}

void setMotor(int duty0to1023, bool forward) {
  duty0to1023 = constrain(duty0to1023, 0, 1023);
  digitalWrite(MOTOR_IN1_PIN, forward ? HIGH : LOW);
  digitalWrite(MOTOR_IN2_PIN, forward ? LOW : HIGH);
  ledcWrite(PWM_CHANNEL, duty0to1023);
}

void setup() {
  Serial.begin(115200);
  Wire.begin(I2C_SDA_PIN, I2C_SCL_PIN);

  pinMode(MOTOR_IN1_PIN, OUTPUT);
  pinMode(MOTOR_IN2_PIN, OUTPUT);
  pinMode(MPU6050_INT_PIN, INPUT);
  ledcSetup(PWM_CHANNEL, PWM_FREQ_HZ, PWM_RES_BITS);
  ledcAttachPin(MOTOR_PWM_ENA_PIN, PWM_CHANNEL);
  setMotor(0, true);

  analogReadResolution(12);
  analogSetPinAttenuation(ADC_MOTOR_CURRENT_PIN, ADC_11db);
  analogSetPinAttenuation(ADC_MOTOR_VOLTAGE_PIN, ADC_11db);

  if (!mpu.begin(0x68, &Wire)) Serial.println("MPU6050 not found");
  if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) Serial.println("SSD1306 not found");
  display.clearDisplay();
  display.setTextColor(SSD1306_WHITE);
  display.setTextSize(1);
  display.setCursor(0, 0);
  display.println("Aethel Drive");
  display.display();
}

void loop() {
  if (millis() - lastSampleMs >= 500) {
    lastSampleMs = millis();
    sensors_event_t a, g, temp;
    mpu.getEvent(&a, &g, &temp);
    float vmotor = readMotorVoltageV();
    float imotor = readMotorCurrentA();

    Serial.printf("V=%.2f V I=%.2f A ax=%.2f ay=%.2f az=%.2f\n", vmotor, imotor, a.acceleration.x, a.acceleration.y, a.acceleration.z);
    display.clearDisplay();
    display.setCursor(0, 0);
    display.printf("Aethel Drive\nV: %.2f V\nI: %.2f A\nAx: %.2f\n", vmotor, imotor, a.acceleration.x);
    display.display();
  }
}
Build & Flash
  • Build: pio run
  • Upload: pio run -t upload
  • Monitor: pio device monitor
  • If upload fails, hold BOOT, tap EN, then release BOOT.
  • Pin Mapping

  • platformio.ini

  • src/main.cpp

  • Build & Flash

USB-C WiFi BLE T-RH Sensor thumbnail
USB-C powered low-power consumer environmental sensor node using a Wi‑Fi/BLE 5.x MCU module, digital temperature/humidity sensor, and protected 5 V USB-C input sized for 0.5–3 A sources.

Properties

Pricing & Availability

Distributor

Qty 1

Arrow

$8.41–$38.07

Digi-Key

$22.34–$49.91

HQonline

$3.51–$3.71

LCSC

$24.17–$27.04

Mouser

$13.05–$41.81

TME

$11.54–$12.35

Verical

$5.51–$12.97

Controls