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

Logic Gates Puzzle 101

Logic Gates Puzzle 101

The message you got does not make any sense. Can you decypher it with the following logic puzzle? The circuit was not optimised for functionality but to create a challenging puzzle and gorgeous artwork. If ...
Read More
Candlelight Emulation – Complexity with Layering

Candlelight Emulation – Complexity with Layering

In this blog post I explain the microcontroller firmware that emulates candlelight in more detail. You can apply the explained techniques in similar situations to get organic effects on CPU and RAM-limited platforms. I will ...
Read More
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
Rail Grid Alternatives and More Interesting Updates

Rail Grid Alternatives and More Interesting Updates

I published another large update to the storage boxes project in the last two weeks. All buyers who subscribed to update emails already got a summary of the changes. If you read the email, you ...
Read More
Stronger 3D Printed Parts with Vertical Perimeter Linking

Stronger 3D Printed Parts with Vertical Perimeter Linking

One issue with fused filament fabrication is the weakness introduced into the parts at the layer boundaries. I had this simple idea of how especially straight sections of 3D prints could be improved on regular ...
Read More
Update to the Storage Boxes System

Update to the Storage Boxes System

Last week I sent all subscribers a small update to my storage boxes system. There are new split boxes for the tall boxes (LR2052-300C-S) and a new extensive PDF catalogue with a great overview, but ...
Read More

Leave a Reply Cancel reply

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

Stay Updated

Join me on Mastodon!

Top Posts & Pages

  • Storage Boxes System for 3D Print
  • Use Enum with More Class!
  • Simple Box with Lid for 3D-Print
  • Fan Controller
  • Shop
  • Real Time Counter and Integer Overflow
  • How and Why to use Namespaces
  • The Hinges and its Secrets for Perfect PETG Print
  • Extreme Integers – Doom from Below
  • Build a 3D Printer Enclosure

Latest Posts

  • 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
  • The 3D Printed Modular Lantern2023-01-17

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...