2009 Tacoma Build

a8ksh4
Posts: 26
Joined: Thu Oct 23, 2025 6:08 pm

2009 Tacoma Build

Post by a8ksh4 »

I'm far enough along on this one to share some photos - this build is using a Pi 5 and a Pi official touch screen 2 and going into a double din dash kit. Years ago I had cut the dash piece down and had a nexus 7 tablet glued into it. This time around, I made a bezel that fits into the double din opening and screw-clamps in the pi touch screen. It's a nearly perfect fit for the double din opening:
disp_front.jpg
disp_front.jpg (158.89 KiB) Viewed 1666 times
disp_back.jpg
disp_back.jpg (129.41 KiB) Viewed 1666 times
sbs.jpg
sbs.jpg (180.6 KiB) Viewed 1666 times
I need to re-print it in petg once I get a roll in the mail. Then I can glue it into the dash piece.

Next Steps:
* Power - 5v buck converter - I have a couple options to try. I want to leave the pi powered if I can, and use the pins for the power button to switch it on and shutdown if I can. It would be really nice if I could turn the display off and only shut the pi down if I park for more than a few minutes.
* Control Automation - toggle a pin for the amp enable/disable, brightness sensor for screen dim/bright (I think there's a factory stereo wire to read for this)
* Little macro pad by the stick shift somewhere that gives me physical buttons for stuff.
* Need to figure out which dac to use... I kind of want 2.1 channel audio so I can do the x-over between doors and sub in software, but maybe I don't need to. I want to drop anything under 30hz and could just use the amp low/high pass filters. TBD. I mostly want clean sound w/o static or anything. I figure I'll run a usb cable from the dash to down under my seat where the amp will sit.
* Wiring - power, speakers, usb, pw switch, brightness pin, amp enable. Basic setup is pretty simple?
a8ksh4
Posts: 26
Joined: Thu Oct 23, 2025 6:08 pm

Re: 2009 Tacoma Build

Post by a8ksh4 »

Progress!
PXL_20251104_172152710.MP.jpg
PXL_20251104_172152710.MP.jpg (4.02 MiB) Viewed 1633 times
PXL_20251104_172138013.jpg
PXL_20251104_172138013.jpg (1.93 MiB) Viewed 1633 times
PXL_20251104_172128061.jpg
PXL_20251104_172128061.jpg (1.83 MiB) Viewed 1633 times
a8ksh4
Posts: 26
Joined: Thu Oct 23, 2025 6:08 pm

Re: 2009 Tacoma Build

Post by a8ksh4 »

I ordered one of these to adapt the rtl sdr to the factory antenna: https://www.aliexpress.us/item/3256805023694169.html

I had a 5v buck converter rated for 20a that I got from dfrobot a while back. https://www.dfrobot.com/product-2662.html
I'm hopeful that'll work without any issues. If it's stable I can change the boot.cfg settings to let it use a full 5a.

And finally got a spool of petg in the mail today so I can make some little tweaks to the fit in the dash kit and reprint one-more time. The black ptg will look better with the screen.

Standoffs will be added for a piece of perfboard that'll have a pi pico to handle some physical button presses and convert them to key-presses as a usb keyboard. It'll also grok the voltages from the steering wheel buttons for volume and back/next.

I've been thinking about screen brightness and want to have a script that runs at boot to set initial brightness based on time of day and day of year, and then further adjustments will be triggered by buttons.
a8ksh4
Posts: 26
Joined: Thu Oct 23, 2025 6:08 pm

Re: 2009 Tacoma Build

Post by a8ksh4 »

Pretty big update today
* I reprinted everything in black petg
* just did first test with the gpio functionality I need:
* * Toggle relay to switch 12v signal to turn the amp on. I need to find something solid state for this, but it works. click click click.
* * Sense 12v from the red ignition wire so I can tell when the car is on. Works great.
* Soldered pins to the shutdown button breakout and crimped some wires. Touching them controls power on/off.
* Display backlight enable/disable works. Shutdown service turns backlight off when system is shut down but still powered.
* I found out that the Axxess adapter I already had for reading the steering wheel buttons has a usb port and presents an HID device, presumably that sends keyboard presses when you press the buttons. I need to test this in the car still.
* Crimped a dozen wires for gpio and power stutff. I think I'm using too-big wire... the little dupont connectors are a pain to put together.
* I added a second nic so I could stay on wifi while hudiy starts a hotspot on the other. I have yet to get hudiy to start the hotspot. So need to troubleshoot this still.
* Pulled out my old deck and ran all the wires in the car - usb to the amp (direct connect to dac), speaker wires and power from amp to dash.

Power plan - lemme know what you think...
* Press button to turn it on or fully shut it down.
* When ignition is switched on: turn on the display (backlight), allow amp to turn on.
* When ignition is switched off: turn off the display, disable amp, send pause signal to any playing media.

Am I over-complicating stuff vs just hard power off when the car is turned off? I'm not really concerned about running the battery down for daily driver stuff, so it would be nice to have instant on. Could use a shutdown timer to power off if left for >24hrs.

Few next steps:
* Remove the pi pico pcb since I don't need that to handle steering wheel buttons.
* Re-arrange the components to tidy up a little.
* Figure out a clean way to punch some buttons through the front of the dash kit. I'd like physical buttons for power, screen brightness, volume.
* Rig up a service that updates screen brightness based on time of day and day of year. The dimmer line in the dash indicates if the headlights are on... but I'm not sure how useful that'd actually be. Maybe I'll read it for just in case.
* Hudiy tweaks for handling button presses for volume, etc.

We start these projects not because they are easy, but because we thought they would be easy! lol.
testing_gpio.jpg
testing_gpio.jpg (217.82 KiB) Viewed 1585 times
gwynethh
Posts: 29
Joined: Sat Aug 09, 2025 4:53 pm

Re: 2009 Tacoma Build

Post by gwynethh »

Nice.
a8ksh4
Posts: 26
Joined: Thu Oct 23, 2025 6:08 pm

Re: 2009 Tacoma Build

Post by a8ksh4 »

Today was a pretty good day. The Mrs was hanging out with a buddy all day so I got to do lots of project time. Buttons!

I 3d printed a template for each side of the screen for drill guides so I could put the holes all in a row...
0_drill_template.jpg
0_drill_template.jpg (132.75 KiB) Viewed 1497 times
Drilling holes...
1_holes_wip.jpg
1_holes_wip.jpg (120.6 KiB) Viewed 1497 times
All of the grounds were wired together and plugged into a ground pin on the pi. The other wire for each button each got a wire to a separate gpio pin...
2_gpio_wiring.jpg
2_gpio_wiring.jpg (177.38 KiB) Viewed 1497 times
a8ksh4
Posts: 26
Joined: Thu Oct 23, 2025 6:08 pm

Re: 2009 Tacoma Build

Post by a8ksh4 »

Only get 3 attachments per post, so one more post for the 4th image. Front view. Top left black button is wired to the pi power pins for hard shutdown/power on. Yellow buttons are intended for screen brightness, blue for volume, green for play/pause, and white/red who knows. Mute and something?
3_buttons_working.jpg
3_buttons_working.jpg (169.17 KiB) Viewed 1497 times
Here's my initial test code for reading the buttons. Things changed a little between bookworm and trixie, but its pretty simple to turn button presses into keyboard keypresses using uinput. If you use this, you'll need to apt install python3-uinput; modprobe uinput; chmod 666 /dev/uinput

Code: Select all

#!/usr/bin/env python3

import uinput
from gpiozero import Button
from signal import pause

BUTTONS_PINS = [16, 26, 21, 20, 19, 13, 6]
BUTTONS = [Button(p, pull_up=True, bounce_time=0.05) for p in BUTTONS_PINS]
NAMES = ['vl_up', 'vl_dn', 'br_dn', 'br_up', 'mute', 'esc', 'play']
KEYS = [uinput.KEY_VOLUMEUP,
        uinput.KEY_VOLUMEDOWN,
        uinput.KEY_BRIGHTNESSDOWN,
        uinput.KEY_BRIGHTNESSUP,
        uinput.KEY_MUTE,
        uinput.KEY_H,  # uinput.KEY_ESC,
        uinput.KEY_B]  # uinput.KEY_PLAYPAUSE]
DEVICE = uinput.Device(KEYS)

def get_press_func(pin, name, key):
    def on_press():
        print("pressed:", pin, name)
        DEVICE.emit(key, 1)

    return on_press


def get_release_func(pin, name, key):
    def on_release():
        print("released:", pin, name)
        DEVICE.emit(key, 0)

    return on_release


for PIN, BUTT, NAME, KEY in zip(BUTTONS_PINS, BUTTONS, NAMES, KEYS):
    BUTT.when_pressed = get_press_func(PIN, NAME, KEY)
    BUTT.when_released = get_release_func(PIN, NAME, KEY)

print("Waiting for buton presses...")
pause()


I'm just starting out figuring out how do trigger actions, map buttons, etc in hudiy. The "h" key mapping in this example is confirmed to return hudiy to the home screen when I press the button.
a8ksh4
Posts: 26
Joined: Thu Oct 23, 2025 6:08 pm

Re: 2009 Tacoma Build

Post by a8ksh4 »

Kind of in parallel, I'm working on a few related things:
* I discovered tailscale last week and have proceeded to add all of my machines to a tailnet. It makes it massively easy to ssh into all of my systems no matter where they are, what network they're connected to, etc. So this is great for this head unit build. I can remote in easily to configure stuff.
* I set up syncthing so I can drop music into a dir on my laptop and it'll sync to the HU automatically any time it's powered up and on wifi.
* I'm exploring how to use two of the apple usb dac adapters in parallel, one for door speakers, and one for the sub channel. My hope is that I can configure pipewire with highpass, lowpass, subsonic filters for the respective channels so I don't need to dork with the knobs on my amp. I haven't figured out how to do this successfully, but have gotten as far as determining that chatgpt does not have sufficient training data to tell me how to do it. lol. I'll start with a single audio adapter and start using two if I can get this stuff working.
* I was having trouble with one of my doors dropping the audio (using a headphone bluetooth adapter in the car for now) and took the amp apart to see if I had a bad rca connector or something. I couldn't see an issue, re-flowed the solder joints for the connectors, and ended up just moving the door speakers to the other two channels on the amp. It's a 4.1 channel amp, so only need 2.1 for the truck. I think one of the rca jacks is broken inside, so I'm thankful can just ignore it.
* I'm also trying to use a secondary wifi adapter to ensure I can use wireless android auto and still be on home wifi. I've tried setting the hardware addr in the hudiy config file but it seems to never start the android auto hotspot. low priority since usb seems to work fine.
* I finished a ported sub box build for my old 8" sub a couple of weeks ago and finally ran a signal generator on my phone to test it (aside from just playing music and stuff). By ear it rolls off right below 32hz. Which is what I was going for spec-ing it out in WinISD. I'm really happy to see results matching up with design. O_O I'm not sure quite how to do the highpass/lowpass stuff on the amp. I think it sounds better setting the door speaker for ~60hz hi pass and sub for ~80hz low pass. That's where it's at now per the dials. Maybe I'll run the signal generator and alternate turning off the doors/sub and running a freq sweep to hear where the cutoffs are actually at.

If you have any advice on the pipewire stuff, or anything, feel free to share. :)
a8ksh4
Posts: 26
Joined: Thu Oct 23, 2025 6:08 pm

Re: 2009 Tacoma Build

Post by a8ksh4 »

Finally made some more progess today. I've had a really hard time understanding the api examples, but found the code from the land rover build here and was able to strip that down to a basic working script to pass commands to hudiy. Also got a more raw-packet type example working, and script that reads gpio button pressses and adjusts brightness or passes commands to hudiy depending on the buttons:

Basic api test script:
https://github.com/a8ksh4/taco_hu/blob/ ... _client.py

Raw socket test script:
https://github.com/a8ksh4/taco_hu/blob/ ... _socket.py

And the GPIO -> hudiy and system brightness script:
https://github.com/a8ksh4/taco_hu/blob/ ... _client.py

Last really critical things I need to do to be able to put this in the care are:
* Wiring tidy up
* Set up proper services for the buttons and stuff.
* Finish up power control service for car on/off.

And less critical stuff on the to do list:
* Get wireless android auto working with the extra wifi adapter plugged in
* Figure out how to turn off android auto when the car is off so my phone doesn't stay connected.
* Steering wheel buttons! I almost forgot about this.
* More fancy gpio buttons, e.g. enable hold behaviors in addition to tap behaviors, enable chording behaviors, and maybe sort out if I want to always perform multiple actions for buttons so I have some kind of functionality in the desktop mode as well as when hudiy is running.
a8ksh4
Posts: 26
Joined: Thu Oct 23, 2025 6:08 pm

Re: 2009 Tacoma Build

Post by a8ksh4 »

Alright, the wiring is pretty much done. I got a 4-pin connector to take care of ground, power, switched ignition power, and the blue switched amp wire. The thing's a little messy, but works. I've been putting hot glue on everything I don't want to worry about rattling loose in the dash.
hu_wiring.jpg
hu_wiring.jpg (324.29 KiB) Viewed 1177 times
And Rev0 of my power mgmt & button software is done. https://github.com/a8ksh4/taco_hu/blob/ ... o_truck.py
It installs as a system service, waits for hudiy to start, and then starts a client with it. Stuff it does:
* screen brightness buttons
* other buttons -> hudiy commands. Current have buttons for play pause, volume, bring up equalizer, and return to andriod auto.
* Senses car power - on power off, it turns off the display, pauses audio, and switches the amp off. On power on, it does the reverse. If it's off and I press a button, it will wake back up. And after (configurable) 15 minutes idle, it shuts down.

I'll put it in the car soon. Still need to test the steering wheel button stuff, line in (headphone port in the dash), microphone, but that can happen in the car.

I tested power draw on a 15v supply (close enough to car) and am using 0.7a when running, 1.0a with the phone plugged in, and 0.2a when powered off. Good enough for now... If I'm gonna park for a long time, maybe I'll pull the fuse.
Post Reply