Lucky Resistor
Menu
  • Home
  • Learn
    • Learn C++
    • Product Photography for Electronics
      • Required Equipment and Software
    • Soldering for Show
  • Projects
  • Libraries
  • Applications
  • Shop
  • About
    • About Me
    • Contact
    • Stay Informed
  •  
Menu

Always-On Firmware Example

Posted on 2020-08-202020-09-09 by Lucky Resistor

Recently I published a simplified version of the Always-On project hardware. Read this post for details. Today I publish a firmware example for the Always-On project.

Always-On Workshop on GitHub

This firmware is written for the PlatformIO environment using Visual Studio Code. It is using a special adaption of my HAL layer for PlatformIO using the Arduino layer for Adafruit Feather M0 boards.

I chose this approach, because it works on every operating system. Also, the Visual Studio Code development environment has code completion and all modern editor features one would expect. It works seamlessly with my HAL layer, to write rock solid and easy to understand code.

How to Setup the Project

  • Install PlatformIO with Visual Studio Code as described here: https://platformio.org/platformio-ide
  • Clone the AlwaysOnWorkshop repository with all submodules:
    git clone --recurse-submodules [email protected]:LuckyResistor/AlwaysOnWorkshop.git
  • Open the project in Visual Studio Code from the PIO home page.

That is all you have to do. The required platform libraries for the project should be installed automatically after you open the project the first time.

About the Firmware Example

The firmware assumes the following hardware configuration:

  • The workshop light is attached to the (OUT) output.
  • The switch in the workshop is configured as push button and attached at the (BTN) input.
  • Two motion sensors are attached at S1 and S2, rising the line from GND to V3.3 if motion is detected.
  • A simple four LED display is attached using a TCA9534 IO-expander chip on the SDA/SCA pins. See the following schema:

Usage

If you enter the workshop, the light is automatically turned on. If you leave it, it will automatically turn off after one hour.

To shorten the duration to turn the light off, you simply press the light switch once when you leave the workshop. If no motion is detected in the next 30 seconds, the light will turn off.

Conclusion

The provided example code should give you an excellent start for your firmware. The Always-On project is meant to provide a reliable bridge between the mains power installation and any smart controlling system.

If you have any questions, missed any information, or simply want to provide feedback, feel free to comment below. 😄

More Posts

Three Ways to Integrate LED Light Into the Modular Lantern

Three Ways to Integrate LED Light Into the Modular Lantern

After creating the modular lantern system, I experimented with different cheap ways to integrate LED lights into it and turn it into a decorative lamp. In this post, I describe the three ways I found ...
Read More
Better Bridging with Slicer Guides

Better Bridging with Slicer Guides

I got questions about a particular feature you find if some of my 3D models. In this short text, I will explain why I add it and why you should add features like this too ...
Read More
New Version 2 of the Pattern Generator

New Version 2 of the Pattern Generator

The latest release of the Pattern Generator software, version 2.0.4, introduces a multitude of exciting improvements and enhancements. From a completely revamped backend to a range of additional features and optimizations, this update aims to ...
Read More
The Importance of Wall Profiles in 3D Printing

The Importance of Wall Profiles in 3D Printing

In this post, I write about wall profiles in 3D printing, and I will explain why they are essential to creating stable parts with minimal filament use. Also, I will show common mistakes that result ...
Read More
Large Update to the Circle Pattern Generator

Large Update to the Circle Pattern Generator

Today I published a significant update to the circle pattern generator. Version 1.4.1 of the application is available for macOS and Windows for download. This new version adds various shapes, rotations, colours and a generator ...
Read More
Get Blog Updates With the New Mailinglist

Get Blog Updates With the New Mailinglist

In a few days, I will stop using Twitter for project notifications. If you like to get notified about new projects and updates, please subscribe to the new mailing list: It is a low-frequency mailing ...
Read More

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Stay Updated / Donate

Join me on Mastodon!

☕️ Support my Work

Top Posts & Pages

  • Real Time Counter and Integer Overflow
  • Storage Boxes System for 3D Print
  • Simple Box with Lid for 3D-Print
  • Logic Gates Puzzles
  • Circle Pattern Generator
  • Welcome to My Shop
  • Use Enum with More Class!
  • Circle Pattern Generator
  • Units of Measurements for Safe C++ Variables
  • Build a 3D Printer Enclosure

Latest Posts

  • New Version 2 of the Pattern Generator2023-07-25
  • The Importance of Wall Profiles in 3D Printing2023-02-12
  • The Hinges and its Secrets for Perfect PETG Print2023-02-07
  • Better Bridging with Slicer Guides2023-02-04
  • Stronger 3D Printed Parts with Vertical Perimeter Linking2023-02-02
  • Logic Gates Puzzle 1012023-02-02
  • Candlelight Emulation – Complexity with Layering2023-02-01
  • Three Ways to Integrate LED Light Into the Modular Lantern2023-01-29

Categories

  • 3D Printing
  • Build
  • Common
  • Fail
  • Fun
  • Learn
  • Projects
  • Puzzle
  • Recommendations
  • Request for Comments
  • Review
  • Software
Copyright (c)2022 by Lucky Resistor. All rights reserved.
 

Loading Comments...