Coder Social home page Coder Social logo

newam / loadcelloccupany Goto Github PK

View Code? Open in Web Editor NEW
129.0 14.0 13.0 628 KB

Home automation occupancy sensor using load cells

License: MIT License

C++ 68.86% OpenSCAD 31.14%
ethernet occupancy-sensor mqtt arduino home-automation ieee-802-3af home-assistant

loadcelloccupany's Introduction

Load Cell Occupancy Sensor

What is it?

This project is a occupancy sensor that uses a load cell for couches and beds, transmitting data to my Home Assistant server via MQTT over Ethernet.

Why?

Other bed occupancy sensors that I have used in my home automation setup trigger false negatives when rolling around at night. I use bed occupancy to turn on my lights if I get up at night, and I wanted a faster, more accurate solution.

Why PoE?

Wireless home automation devices often make sense only when they are battery powered, if a power cable needs to be run to the device it can carry data too. Designing a low power wireless device is far more complicated than designing a wired device and running an Ethernet cable.

Overview

Load cells → HX711 (ADC) → ATMega328P (MCU) → W5100 (Ethernet) → MQTT Broker → Home Assistant

This sensor takes input from 4 load cells, each supporting one leg of a bed or couch. The load cells are sampled with a ATMega328P (Arduino) using an HX711 load cell ADC. These samples are then transmitted to an MQTT broker via the Wiznet W5100 (same as Arduino Ethernet shield).

Project Contents

  • LoadCell_ArduinoCode - firmware for the ATMega328P
  • LoadCell_Case - 3D printable case designed in OpenSCAD
  • LoadCell_Holder - 3D printable holder for the load cells designed in OpenSCAD
  • LoadCell_HomeAssistant - example Home Assistant configuration
  • LoadCell_KiCAD - schematic and PCB

Media

Home Assistant Card

Front Circuit View

Software Used

Arduino Libraries used

Forks

loadcelloccupany's People

Contributors

ferdymercury avatar newam avatar riemers avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

loadcelloccupany's Issues

I made a ESP8266 fork which include OTA updates

Thanks @newAM for publishing your work. I wouldn't be able to do this project otherwise. Especially the 3D printed case.


In case someone build it's own version with a ESP8266 you might be interested in my fork. It connects via WiFi (obv) and support Over The Air updates.

It also saves the 'tare'/offset to the EEPROM and doesn't reset on restart/power off. And it only sends MQTT updates if the load has changed. (reduce the load on MQTT broker)

https://github.com/Skaronator/ESP8266-Load-Cell

W5500 vs W5100

Just curious if you saw any technical reason that the Wiznet W5500 chip couldn't be used instead of the W5100 for this application. I'm thinking the 48-LQFP package of the W5500 would be significantly easier to solder than the 80-LQFP of the W5100. I'd have to redesign the board, but that may also reduce the number of caps needed as well.

W5500 on Digikey

Looking over the datasheets, it looks to me like there are pins on the W5500 that closely match the pins being used on the W5100, but admittedly this isn't my area of expertise. Thoughts?

Strange fluctuations in weight

Hi mate,

For some reason I'm getting some pretty huge random fluctuations in weight & can't really work out why, it seems to work pretty well (other than needing to calibrate it so it's actually accurate).

Have a look at the attached image, what does your homeassistant sensor graph look like?

image

Compile Error

I'm running into an issue on line 34 when I try to compile the code.

exit status 1
no matching function to call to 'HX711::HX711(int, int)'

I'm using bodge's library here: https://github.com/bogde/HX711

Is there a different library I should be using instead?

As an aside, thanks for publishing this project. I've been hoping to do something similar for quite a while and I've learned a ton of new things by working on it.

Load cell cable length

How did you extend the length of the wires of the load cells, the ones I found have about 30cm of very thin cable, is it an issue to solder some more wire on an extend this or even better somehow replace it with a thicker cable thats a bit more protected?

few questions

The image of the final product looks different from the boards you mention as the hardware. I would like to have the input jacks and PoE but where do i purchase that specific board?

If my bed has 6 legs will that interfere? I have a purple mattress and it is very very heavy so there are 6 large cylinders for the legs. Can i use 6 load cell sensors just to have it all balanced properly?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.