Debouncing Buttons in MicroPython

Ever introduce a pushbutton into your electronics project but have trouble getting a stable reading? Have you read about “debouncing” a button and want to learn how to easily accomplish this in software? This article goes over the background of switch and button debouncing and walks through my MicroPython code to accomplish this. Background So … [Read more…]

DIY Smart Garage Door Opener

My wife and I use the garage every day to go in and out our house. Wouldn’t you like to automatically make sure your garage door is closed at night? Or know the status of it when you’re away from the house? Today I’m going to use some inexpensive electronics to turn your standard garage door into a “smart” garage door. This design still keeps all the original functionality of your garage door intact, you won’t have to use an app or website to open the garage door, it just brings the garage door into the digital world.

For this project, we’re going to hook up an ESP8266 to our garage door opener to control over Home Assistant using MQTT. Some hardware you’ll need for this project:

From a software perspective, you’re going to need Home Assistant running with an MQTT broker and an ESP8266 running MicroPython. Check out these blog posts for setting those up:

[Read more…]

Running MicroPython on ESP8266 NodeMCU

For some upcoming projects, I’m going to make some DIY sensors and switches using the ESP8266 NodeMCU. It’s a pretty cheap board that is based on the ESP8266 which has built-in WiFi. In this post today I’m going to be getting a brand new “ESP8266 NodeMCU” up and running with MicroPython. MicroPython allows you to write microcontroller code using Python instead of using C or the Arduino libraries.

To get started you’ll need:

There are lots of other ESP8266 boards floating around the internet so if you decide to go with a different board I would just ensure it comes with at least 1Mbyte of flash so you can run the full version of MicroPython.

[Read more…]