DEV Community

Adam Crockett
Adam Crockett

Posted on

A UI for your room

You are probably in a room right now? If so maybe I can interest you in yet another idea which could be a good one..

I propose you replace your existing light switch with a home assistant UI mounted in its place with a screen which will better serve you.

Light switches are actually positioned in places are more likely to find useful such as by the front door or on the move in your house.

Also a screen is easy to clean rather then a switch gathering germs.

So maybe the idea is overkill or maybe not?

Should I ask for help to build a prototype, form a team?

Discussion (5)

Collapse
ssimontis profile image
Scott Simontis

I don't have my entire collection of microcontrollers at hand (need to go to storage unit soon), but I'd be interested. I started out my career writing software for traffic and transportation hardware (primarily digital signs, but also Conflict Monitor Units for traffic light controllers, data collection and control systems for snowplows, emergency dispatch in-cab units for DoT vehicles), and I miss playing around with gadgets. I can recommend some good microcontroller packages which will fit your needs with minimal fuss.

Ready to write some archaic C code?

Collapse
adam_cyclones profile image
Adam Crockett Author

Absolutely :) I'm not sure where to start but please do show me the ropes. How do I even drive a UI and can I get a touchscreen the size of a standard light switch? Lots of questions 😜

Collapse
ssimontis profile image
Scott Simontis

Also, there are far easier paths than I am suggesting to do this, but I love microcontrollers because you can learn your way from the ground up. You get to surf through every level of abstraction out there and I find that beautiful. Choose whichever method brings you the most enjoyment :)

Collapse
ssimontis profile image
Scott Simontis

I would check out these ESP32 modules. Very tiny screen, Arduino-compatible, but nothing stopping you from getting the ESP-IDF SDK and twiddling all the bits yourself. I have heard complaints of poor documentation on these modules however. I have a 5% coupon for their website I am not going to use if you decide to go that route, just let me know. ESP32s are some of the cheapest microcontrollers you can find and they generally have wi-fi and Bluetooth built in.

My other recommendation would be going with a STM32 microcontroller, if you get a F469I-DISCO evaluation board, it has the touch-screen attached to the developer board. STM32 devices use ARM Cortex M processors, which pretty much dominate the embedded industry. You can find Arduino libraries for them, or they have a SDK that they have improved a lot from its previous rendition.

Start small. It's hard because you realize you can do so many cool things with the device, but it's a lot of new knowledge. You're going to need to learn the basics of electricity so you can safely connect your microcontroller to peripherals without damage. You're learning a new machine architecture and memory-mapped I/O to control different devices.

The datasheet is your friend. It is incredibly intimidating and at least 1,000 pages, but literally everything you need to know about every single component on the board is within it. There's lots of Application Notes (at least from ST Microelectronics) that are much shorter and capture small, practical aspects of the system.

Adafruit is a maker-focused site for parts, the main distributors in America for electronic components are Arrow, Digikey, Mouser and Newark. I like Arrow and Digikey just because I have used them for years. Their sites are intimidating because there is so much stuff listed, but it is a lot safer than Amazon or generic sites because there is a huge counterfeit industry with microcontrollers.

Blinking an LED is normally step 1, and from there you can try to get more complicated. Stop the blinking at the press of a button. Write the number of times it blinks to Flash memory. Keep building up step by step.

Collapse
reinhart1010 profile image
Reinhart Previano K.

I can say that WebThings (formerly Mozilla IoT or Mozilla Things) Gateway has one of these great UIs where users can assign connected devices to their house plans like this:

Floor plan

I believe it's easier to control devices this way, instead of finding them in a list of all devices, which is common in many smart home mobile apps.