This
| Parts List |
|---|
| Samsung Galaxy Tab A8 or Similar |
| JVC KS-DR1004D Amplifier |
| 3.5mm Right Angle to RCA |
| Right Angle Type-C USB Cable |
| 12VDC PD Fast Charger |
| ESP32 |
| RCA Female x2 to RCA Male |
Working and Tested
- Microphone (built-in)
- GPS (built-in)
- Screen Brightness (build-in)
- Remote Controls (steering wheel vol up, vol down, next track, previous track, PUSH mute and MODE)
Not Working
- Hands Free
- No FM Tuner (I use internet radio instead)
- Reversing Camera
Gallery
Steering Wheel Controls
In this case we refer to the same setup as the previous article for the PI Head Unit, but instead we are using Arduino instead of ESPhome.
We are using the ESP32-BLE-Keyboard Library and will send the commands to the tablet via Bluetooth., Here we will flash the ESP32 with the below using Arduino IDE, Download the ESP32-BLE-Keyboard and place it in your Arduino Libraries folder before flashing.
Modify the ADC values to fit your cars output in the highlighted section below.
/*
* ESP32 BLE Media Remote For Steering Wheel Controls
* ---------------------------------------
*/
#include <BleKeyboard.h>
constexpr gpio_num_t ADC_PIN = GPIO_NUM_34;
constexpr gpio_num_t MODE_PIN = GPIO_NUM_33;
constexpr float VREF = 3.30f; // adjust if your 3V3 is slightly off
constexpr uint16_t ADC_MAX = 4095; // 12‑bit ADC
constexpr uint16_t POLL_MS = 300; // sample interval
constexpr uint16_t DEBOUNCE_MS = 250; // min gap between key events
BleKeyboard bleKeyboard("Wheel Remote", "CAN‑PI", 100);
enum Button {NONE, NEXT, PREV, VOL_UP, VOL_DOWN, MODE};
Button lastButton = NONE;
unsigned long lastSent = 0;
void sendKey(Button b) {
switch (b) {
case NEXT: bleKeyboard.write(KEY_MEDIA_NEXT_TRACK); break;
case PREV: bleKeyboard.write(KEY_MEDIA_PREVIOUS_TRACK); break;
case VOL_UP: bleKeyboard.write(KEY_MEDIA_VOLUME_UP); break;
case VOL_DOWN: bleKeyboard.write(KEY_MEDIA_VOLUME_DOWN); break;
case MODE: bleKeyboard.write(KEY_ESC); break;
default: break;
}
}
Button decodeButton(float v) {
if (v < 1.0f) return NEXT; // <1 V
else if (v >= 1.0f && v < 2.5f) return PREV; // 1–2.5 V
else if (v >= 2.5f && v < 4.0f) return VOL_UP; // 2.5–4 V
else if (v >= 4.0f && v < 5.5f) return VOL_DOWN; // 4–5.5 V
else return NONE;
}
void setup() {
Serial.begin(115200);
analogSetAttenuation(ADC_11db);
analogReadResolution(12);
pinMode(MODE_PIN, INPUT_PULLUP);
bleKeyboard.begin();
Serial.println("\n--- Wheel Remote DEBUG build ---");
}
void loop() {
static unsigned long lastPoll = 0;
if (millis() - lastPoll < POLL_MS) return;
lastPoll = millis();
if (!bleKeyboard.isConnected()) return;
if (digitalRead(MODE_PIN) == LOW) {
if (lastButton != MODE && millis() - lastSent >= DEBOUNCE_MS) {
sendKey(MODE);
lastButton = MODE;
lastSent = millis();
Serial.println("MODE -> KEY_ESC");
}
return;
}
uint16_t raw = analogRead(ADC_PIN);
float v = (raw * VREF) / ADC_MAX;
/* print every reading for calibration */
Serial.printf("ADC %4u | %.3f V\n", raw, v);
Button b = decodeButton(v);
if (b != NONE && b != lastButton && millis() - lastSent >= DEBOUNCE_MS) {
sendKey(b);
lastSent = millis();
lastButton = b;
Serial.printf("SENT %-8s at %.3f V\n",
(b==NEXT?"NEXT":b==PREV?"PREV":b==VOL_UP?"VOL_UP":"VOL_DN"), v);
}
if (b == NONE) lastButton = NONE;
}
One done, you can go ahead and pair the device with your tablet.
If you have issues with the On-Screen Keyboard no longer working, head to
General Management > Physical Keyboard and enable Show on-screen keyboard.
This will show the on-screen keyboard regardless of any connected devices.
Resources
T-vK/ESP32-BLE-Keyboard: Bluetooth LE Keyboard library for the ESP32 (Arduino IDE compatible)
wheel_remote.ino



