This week is focused on Output Devices. The goals were to measure the power consumption of an output device and program a microcontroller board to control an output device to display information or actuate physical components. I integrated a 128x64 I2C OLED display (SSD1306) to serve as my Go-Kart's telemetry dashboard, wired it to the ESP32-C3 board, wrote display driver scripts to display speed and throttle levels, and measured output currents.
The group assignment was to measure the power consumption of different output devices (motors, displays, LEDs) under idle and active load configurations. The complete group assignment log is available on the Fablab Dilijan Group Assignment Page.
3.3 V:
15 μA.8.5 mA.18.2 mA. This demonstrates that using a dark UI theme with minimal pixels turned on preserves power.9.4 mA at 3.3V with a 330 ohm resistor.To provide live telemetry to the go-kart driver, I interfaced a 0.96" I2C SSD1306 OLED Screen. The screen outputs real-time speed, throttle pedal percentage, and battery voltage.
This script initializes the OLED via the Adafruit SSD1306 library and updates the telemetry layout based on throttle analog inputs.
// Output Device Test Code - OLED I2C Telemetry Screen
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_RESET -1
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
const int SENSOR_PIN = 2; // GPIO2 Potentiometer Input
void setup() {
Wire.begin(4, 5); // Initialize I2C on SDA=GPIO4, SCL=GPIO5
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // I2C address 0x3C
for(;;); // Freeze if screen not detected
}
display.clearDisplay();
display.setTextColor(SSD1306_WHITE);
analogReadResolution(12);
}
void drawDashboard(int throttleVal) {
display.clearDisplay();
// Title
display.setTextSize(1);
display.setCursor(0, 0);
display.print("GOKART TELEMETRY");
// Speed display (dummy math based on throttle)
int speed = map(throttleVal, 0, 4095, 0, 45); // Max 45 km/h
display.setTextSize(2);
display.setCursor(0, 16);
display.print(speed);
display.setTextSize(1);
display.print(" km/h");
// Draw Throttle Bar Graph
int barWidth = map(throttleVal, 0, 4095, 0, 120);
display.drawRect(0, 40, 120, 8, SSD1306_WHITE); // Outer border
display.fillRect(0, 40, barWidth, 8, SSD1306_WHITE); // Filled bar
// Battery status indicator (dummy)
display.setCursor(0, 52);
display.print("BATTERY: 42.1V");
display.display();
}
void loop() {
int sensorRead = analogRead(SENSOR_PIN);
drawDashboard(sensorRead);
delay(100);
}
Download the Arduino source code file for the OLED dashboard telemetry program:
| File Name | Format | Description | Download Link |
|---|---|---|---|
| oled_telemetry.ino | Arduino Code (.ino) | Arduino C++ display driver layout script for SSD1306 OLED screen. | 📥 Download INO |
This week focused on driving display modules and power analysis. Here is a summary of the accomplishments:
Measured active current spikes of output drivers and OLED modules, optimizing UI designs for battery conservation.
Configured SSD1306 driver registers over I2C lines to control pixels dynamically on the 128x64 display panel.
Wired pull-up resistors on the shared SDA/SCL bus to isolate communication lines from noise and voltage drops.
Wrote C++ scripts displaying numeric telemetry text and bar graph progress meters to represent kart speed.