Giter Club home page Giter Club logo

door-sensor-with-433mhz-and-attiny13's Introduction

Door-sensor-with-433MHz-and-ATTINY13

Door and Window sensor sends open and close code to home automation system

Function

This is a little device with a reed switch one one side of the door/window and a magnet on the other side. When the door/window opens a code will be sent through the 433MHz transciever (I use a Wireless Transmitter Module H34B). When the door/window closes another code will be sent. There is also an optional tampering switch possible. Additionally every 10 minutes a third code is sent. Hence you know when the battery is dead when no more such codes are received. The sensors work together with https://github.com/mrohner/433MHz-MQTT-Bridge-with-Wemos-D1 in order to relay the door/window status to MQTT and eventually to Domoticz.

Design

I used an ATTINY13A and attached a reed switch as well as a 433MHz transciever. All runs off a 3V CR2032 battery. Of course the ATTINY is asleep most of the time. I attach an Eagle Cad file FYI. The protocol used is understandable by most receivers, see also https://github.com/sui77/rc-switch and https://github.com/sweetpi/attiny-433mhz-sender

/* Format for protocol definitions:
 * {pulselength, Sync bit, "0" bit, "1" bit}
 * 
 * pulselength: pulse length in microseconds, e.g. 350
 * Sync bit: {1, 31} means 1 high pulse and 31 low pulses
 *     (perceived as a 31*pulselength long pulse, total length of sync bit is
 *     32*pulselength microseconds), i.e:
 *      _
 *     | |_______________________________ (don't count the vertical bars)
 * "0" bit: waveform for a data bit of value "0", {1, 3} means 1 high pulse
 *     and 3 low pulses, total length (1+3)*pulselength, i.e:
 *      _
 *     | |___
 * "1" bit: waveform for a data bit of value "1", e.g. {3,1}:
 *      ___
 *     |   |_
 *
 * These are combined to form Tri-State bits when sending or receiving codes.
 */

Library used

You will need this library: https://github.com/NicoHood/PinChangeInterrupt

Parts used

  • PCB board
  • ATTINY13A microcontroller SOP-8
  • Reed Switch
  • 10K Ohm resistor SMD 0805
  • Battery holder SMD for CR2032
  • Battery CR2032 3V
  • 433Mhz transmitter module H34B
  • Little housing
  • Magnet (I use a furniture door closing magnet)

door-sensor-with-433mhz-and-attiny13's People

Contributors

mrohner avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

door-sensor-with-433mhz-and-attiny13's Issues

circuit diagram needed

I am trying to make it. Just wondering how the attiny-13 pins are connected to reed switch and resistance. It will be nice if you can draw a diagram and share.

I looked at brd file and photoes but couldn't understand circuit. I will be handsoldering it on a perforrated board.

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.