Close

Button inputs, Wayfire, autostart, and what's next

A project log for Raspberry Pi Wall Panel

A wall panel style case for a Raspberry Pi including presence sensing and touch input

tobiasTobias 10/18/2024 at 09:150 Comments

After leaving the front panel buttons unimplemented for a while, a really helpful comment from @ryan-worrell got me thinking about how they could be set up. The way I decided to go was to use the buttons to switch back and forth between a few different browser-based apps. In my case this was Homeassistant, and Klipper for my 3D printer. Here's what it looks like in action:

And while we're looking at animations, here's what it looks like when the presence sensor detects that I've walked away, and slowly turns of the screen backlight:

Instead of reading the touch sensor buttons in a Python script, it was easier to use a dti_overlay to tell the RPi to treat the GPIO input like a keyboard press - so that when the sensor is pressed, it is just like pressing the KEY_NEXTSONG key on a keyboard. The next step was configuring Wayfire to know that it should switch workspaces when this key is pressed.

Another really important feature I wanted is for all of my desired apps/browsers/windows to open automatically when the RPi boots up. Ideally this would also include the apps being set up in the right workspace, but so far that has proved challenging, and something I'm still working on.

So, how is all of this set up? I've added all of the steps to the README on the GitHub page, which you can find here: https://github.com/tsnoad/rpi_wall_case

So, what's next? To be honest, I'm really not happy with how the front panel looks when it's 3D printed, mainly because of the printer bed texture. At some point I want to redesign the 3D files, which could also include adding a ambient light sensor, but don't expect this soon. With the exception of getting the autostart script to put the windows where I want them, this project is pretty much complete.

Finally, @ryan-worrell asked how the presence and touch sensors are wired to the GPIO pins, and unfortunately this isn't really something I've documented yet. Here's a (not very useful) picture of the wiring, as well as a (hopefully more useful) table of the pin connections:

RPi 4 GPIO Pin #Pin DescConnected to
13.3VVCC pin of LD2410C-P presence sensor
3GPIO 2Not used
5GPIO 3Not used
7GPIO 4OUT pin of LD2410C-P presence sensor
9GNDGND pin of LD2410C-P presence sensor
11GPIO 17Not used
13GPIO 27Not used
15GPIO 22Not used
173.3VVCC pin of both TP223 touch sensors
19GPIO 10I/O pin of right TP223 touch sensor
21GPIO 9I/O pin of left TP223 touch sensor
23GPIO 11Not used
25GNDGND pin of both TP223 touch sensors

Discussions