All Projects → buserror → rf_bridge

buserror / rf_bridge

Licence: other
RF (433Mhz) to MQTT Bridge - with hardware

Programming Languages

c
50402 projects - #5 most used programming language
Makefile
30231 projects
C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to rf bridge

3d printed keyboard
A fully 3D printed computer keyboard
Stars: ✭ 31 (-18.42%)
Mutual labels:  avr, firmware
Original-CR10-Marlin-Firmware-Source
This is the ORIGINAL Creality CR10 Firmware Source as Creality installs it.
Stars: ✭ 16 (-57.89%)
Mutual labels:  avr, firmware
0xCB-1337
Mechanical macropad with OLED running QMK
Stars: ✭ 33 (-13.16%)
Mutual labels:  firmware, kicad
Rtl 433
Program to decode radio transmissions from devices on the ISM bands (and other frequencies)
Stars: ✭ 3,379 (+8792.11%)
Mutual labels:  rf, 433mhz
Easyavr
Easy AVR USB Keyboard Firmware and Keymapper
Stars: ✭ 479 (+1160.53%)
Mutual labels:  avr, firmware
platform-atmelavr
Atmel AVR: development platform for PlatformIO
Stars: ✭ 97 (+155.26%)
Mutual labels:  avr, firmware
FASTUSBasp
This is the fast avr programmer for AVR MCUs based on cheap stm32f103c8t6 board with usb-to-serial support.
Stars: ✭ 78 (+105.26%)
Mutual labels:  avr, firmware
I2c Moisture Sensor
I2C based soil moisture sensor
Stars: ✭ 194 (+410.53%)
Mutual labels:  avr, kicad
Plantwateringalarm
A soil humidity level sensor based on ATTINY44. Uses capacitive sensing.
Stars: ✭ 264 (+594.74%)
Mutual labels:  avr, kicad
STM32-RFM95-PCB
STM32 and AVR128 Printed Circuit Board for creating IOT nodes with the RFM95 LORA chip
Stars: ✭ 14 (-63.16%)
Mutual labels:  avr, kicad
Marlin
Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. | Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
Stars: ✭ 12,217 (+32050%)
Mutual labels:  avr, firmware
rs485-moist-sensor
Digital (RS485 - based) soil moisture and temperature sensor
Stars: ✭ 51 (+34.21%)
Mutual labels:  avr, kicad
OTTO-hardware
No description or website provided.
Stars: ✭ 45 (+18.42%)
Mutual labels:  kicad
SONOFF-BASIC-firmware
Sonoff Basic firmware; config by browser, OTA, MQTT, DS18B20
Stars: ✭ 19 (-50%)
Mutual labels:  firmware
DoorsignEPD-pcb
ESP-WROOM-32 breakout board to connect it to a Waveshare E-Ink display
Stars: ✭ 16 (-57.89%)
Mutual labels:  kicad
hwmf
Demo for Arduino Mega (ATmega2560) and an LCD. Got 2nd place at Revision 2020 wild compo.
Stars: ✭ 19 (-50%)
Mutual labels:  avr
rustBoot
rustBoot is a standalone bootloader written entirely in `Rust`, designed to run on anything from a microcontroller to a system on chip. It can be used to boot into bare-metal firmware or Linux.
Stars: ✭ 99 (+160.53%)
Mutual labels:  firmware
CorePartition
Universal Cooperative Multithread Lib with real time Scheduler that was designed to work, virtually, into any modern micro controller or Microchip and, also, for user space applications for modern OS (Mac, Linux, Windows) or on FreeRTOS as well. Supports C and C++
Stars: ✭ 18 (-52.63%)
Mutual labels:  avr
HAGIWOs Module
eurorack modular synthesizers projects using Arduino.
Stars: ✭ 76 (+100%)
Mutual labels:  kicad
wrt-hisicam
OpenWrt based HiSilicon`s System-On-a-Chip ip camera firmware
Stars: ✭ 21 (-44.74%)
Mutual labels:  firmware

Home Automation: MQTT <-> RF 433Mhz Bridge for switches and sensors.

This project implements a RF bridge for 433Mhz devices. The idea is to have a small AVR do the mod/demod and send diggested messages on it's serial port to a linux box for processing; in this case bridging sensors and switches to a MQTT broker.

This was made to interface my cheap RF433 gizmoz (wall switches, outlets, temperature sensors etc) to the home automation, and ultimately the Amazon echo/Alexa.

The fact the AVR does all the sensitive bits means the linux program doesn't eat a lot of CPU and can concentrate on the applicative parts, which is the MQTT bridging.

Finished project

Finished Project (Minus case)

The AVR Bits

The firmware can run on anything with about 2KB of SRAM (currently uses <1300 bytes), and a clock of 16Mhz. The firmware 'samples' the RF signal from the 433 module at about 64khz and tries to detect edges, then regular pulses, then does some decoding until a 'long low pulse', and forwards it on.

The firmware can also transmit (altho this part isn't finished, only ASK is working for now) using the same message format. The code doesn't try to be too clever and has a 'raw' mode it can be switches into to forward raw pulses straight to the host for analysis.

The firmware is capable of decoding both Amplitude-Shift Keying (ASK) and manchester encoding. It's completely frequency/pattern independent and continuously search for signal in the noise before applying some filtering and hopefully forward the whole diggested message onward.

Also, I wanted to publish a firmware that looks marketedly different from the typical arduidiot[0] firmware that is all bloaty, synchronous and so on. This firmware uses coroutines, is completely asynchronous and allows the AVR to be in sleep mode most of the time. This is he way I do embedded; use a tick clock of any frequency (here, I use the sampling clock) and derivate everything else from it, and sleep in between ticks when you no longer need the CPU.

The only bit that is not synchronous to that tick mark is the UART, it's all interrupt driven, and it's nicely isolated using biggish FIFOs so it's unlikely to become blocking.

[0]: Arduidiot is my name for the well known boards. Since a few years back when they started suing each others for the name, I decided my version of the name was a lot more appropriate.

Message format

A Typical message will be sent to the host like this, for a dumb switch:

MA:40553300#19!3f*36

This is a message that already has been decoded as ASK encoding, has 0x19 bits, the clock duration was 0x2f timer clock cycle per bit, and the checksum was 0x36.

A more involved message would be:

MM:0028b4206b0b38c0#40!3f*ff

This one has 'M'anchester encoding, 0x40 bits with 0x3f/2 timer ticks per bits.

The reason the timer clock is returned is to be able to reply the message back. Currently you can 'replay' ASK messages by just sending them back to the serial port. They will be replayed 3 times.

The Linux Bits

The linux bit sits on the serial port, reads diggested messages and 'maps' them to MQTT messages. For dumb on/off switches it uses a file containing the mapping; but there is an extra decoder for the temperature/humidity sensor. The mapping is'nt terribly clever and use a flat file.

The linux process uses libmosquitto to connect to a MQTT broker. I might try to do away with the libmosquitto requirement, as I don't think I need all the features (and footprint) it brings. I just need a unsecured connection to a broker, and let the broker be 'clever' and do encryption bridging if needs be.

The linux bit also subscribes to the mapped messages, and when it received a MQTT notification that hasn't been sent by itself, it just passes it on to the AVR board for transmisssions. That means you can have a Dashboard with switches, or use Amazon Alexa etc to send the messages on the RF link. No need for a web interface etc, just use MQTT. I personally use Node-Red to do the Alexa Logic bits.

The program can run on pretty much anything, it uses very very little resources, so a Raspberi Pi or anything else will work just fine!

The Hardware Bits

Note: The hardware has it's own page.

For prototyping I used an Arduino Mega and a RF433 receiver + transmitter. I ended up using 2 antennas separated by about 20cm on the prototype, it works, even if the receiver is a bit overwelmed for a little while after I transmit anything. It otherwises requires no extra hardware. The only thing I did was add a 100R resistor in series with the receiver output, as I was seeing a lot of ringing on the oscilloscope.

The 'real' hardware will be an Arduino nano v3.0 with an Atmega 328p. Powered via the USB port. I've designed a board using Kicad already, and the PCBs are on the way. https://oshpark.com/shared_projects/ZqEOBR2t Hardware uses a NXP RF switch for sharing an antenna in half-duplex, and apart from a bit of filtering that's about it! More later.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].