Skip to the content
2 layers104.4 × 99.8 mmLORA Relay AC, the printed circuit board in 3D

AC powered relay control board using Lora radios. Turn on lights, heaters or whatever else you need at a distance. This repo is a mirror for:

Size
104.4 × 99.8 mm
Copper layers
2
Thickness
1.6 mm
Parts
45
Nets
54
Pads
155
Tracks, vias
280, 22
Pours
8
Routed
Yes
KiCad
KiCad 5 (file 20171130)
Created
14 Jan 2020
Updated
3 Jun 2020

Overview

LORA Relay AC is an open-source printed circuit board by motivemachine, from the motivemachine/LORA_remote_relays repository on GitHub, published under the Apache-2.0 licence. It is a 2-layer board of 104.4 × 99.8 mm with 45 parts on 54 nets, routed with 280 tracks and 22 vias.

It is built around the HLK-PM01, AMS1117-3.3 and MMBT3904. Its parts include 14 resistors, 4 capacitors, 4 diodes, 2 transistors and 2 switches. It belongs with the radio and wireless and home automation and IoT boards and the AVR (ATmega, ATtiny) boards of this library.

Main components

3

README

README.md

Lora Remote Relays

AC powered relay control board using Lora radios. Turn on lights, heaters or anything else you need at a distance. The first one has been installed and running smooth for several months now! Check it out here: https://asthemillturns.serveblog.net/lora-ac-relays.html

Notice about AC and relays!

Build at your own risk.

This devices runs on 110VAC, and controls other 110VAC devices. Do not make this if you don't know what you're doing! Power traces are very conservatively rated at 8 amp total (both relays combined), further changes and testing should increase this. There is no snubber circuity on the relays, so as-is should only be used with resistive loads (lights, heaters, etc.). Small fans should be fine. Running motors should have proper circuitry in place on the relay outputs to handle any noise or back-EMF from such devices.

Project status

Board design and code for v1.1 is completed and all is running well. Board v1.2 design is complete but code has not been written yet. Code for v1.1 should work almost as-is after changing the pin numbers. Primarily the difference between 1.1 and 1.2 is that 1.1 must poll the radio for new packets while the new version will use interrupts. Other changes are improved silkscreening and more IO breakouts for other projects.

Pinout description

Pinouts

I've broken out some extra arduino pins for integration in future projects. Starting from the upper left:

  • The first three pins from upper-left down are 5 volts, Analog 1, and ground. This was originally used for a TMP36 analog temperature sensor. This would also work with any of the Dallas One-wire digital temperature sensors.
  • Next we have a terminal block with Ground, analog 4 and analog 5. My purpose for these is to include some external on/off switches for the relays. Could be handy to turn the lights on manually when already standing next to them. The terminal block
  • Final four pins are ground, analog 6, analog 7, and 5 volts. These are just for future projects and could be used for more external sensors, switches, or status LEDs
  • To the lower right of the Nano the serial pins are exposed for future ideas.

Completed board

This is a photo of the complete v1.1 board. The schematics are up to date with v1.2, which adds some extra IO pins, adjusted silkscreen, and moved some parts to make them easier to work with (like moving the fuse holder farther away from the relays) Completed 1.1 board

Usage/code description

There are two PlatformIO project folders, one for the main program, one named 'circuit test'. The circuit test routing just verifies everything was connected correctly: blink leds, toggle relays, send a packet. Both programs are contained in the 'src/' folder and can be pulled from there if you wish to use the code with Arduino IDE.

Some of these software functions are in a state of change as I figure out how best to integrate these devices with my Lora home network, but the basic purpose remains the same:

  • Set local(self) and destination radio addresses (in the form of a byte in Hex format)
    • Destination address is read from the dip switches on startup. Simply make sure these are the same across all boards. In this case it is the address of the Lora radio on the Raspberry Pi that controls everything.
    • If the button is held on startup (or while the arduino nano reset button is pressed) blink the LEDs while in the 'set local address' function. Set the dip switches different on each board so each one can be uniquely addressed by whatever device you have turning the relays on and off. Press button again to write this new address to EEPROM.
  • Receive message on which relay to turn on or off
    • Currently this just listens for a message to the local address and a 2 index array of zeros and ones (i.e [1,0]). First element is what the first relay state should be, second is what the second relay state should be.
  • Reply with ACK after processing the previous message, or respond with current relay states when asked
    • This isn't quite complete yet but the plan is to implement a proper ack/nack response for more reliable operation.
    • The second thing is to reply to the message 'STAT' with the current status of both relays. The thinking is any one control device may turn the relays on and off, but it would be nice of other control devices could later know what their status is without toggling anything on or off. This also lets a controller know that a specific board is, in fact, online and reachable.

TODO

  • Create and upload a proper BOM
  • Finish and debug 'status' functions
  • Further testing of board temperature rise at high currents
  • Change from polling loop to pin-change interrupt
  • Clean up lots of old comments, debug info and test functions
  • Add watchdog timer for protection from random hangups.

Parts

45
QtyValueFootprintReferences
41kResistors_SMD:R_0805R7, R9, R11, R13
42kResistors_SMD:R_0805R8, R10, R12, R14
4MountingHoleMounting_Holes:MountingHole_2.5mmH1, H2, H3, H4
2100Resistors_SMD:R_0805R4, R15
210kResistors_SMD:R_0805R5, R16
23k3Resistors_SMD:R_0805R1, R2
24001Diodes_THT:D_A-405_P7.62mm_HorizontalD3, D4
2FuseFuse_Holders_and_Fuses:BladeFuse-MiniF1, F2
2LEDLEDs:LED_D5.0mmD1, D2
2MMBT3904TO_SOT_Packages_SMD:SOT-23Q2, Q3
1.1ufCapacitors_SMD:C_0805C3
1100ufCapacitors_SMD:CP_Elec_5x5.3C4
11ufCapacitors_SMD:C_0805_HandSolderingC1
122ufCapacitors_SMD:C_0805_HandSolderingC2
1ACinTerminalBlocks_Phoenix:TerminalBlock_Phoenix_MKDS1.5-3polN AC GND
1AMS1117-3.3TO_SOT_Packages_SMD:SOT-223-3_TabPin2U2
1ArduinoNanoMainWorking:ArduinoNanoATMEGA328p_nano
1HLK-PM01MainWorking:HLK-PM01HLK-PM01
1LOGO_MWM_medMainWorking:LOGO_MWM_medG***
1SW_DIP_x04Buttons_Switches_THT:SW_DIP_x4_W7.62mm_SlideSW2
1SW_PushButtons_Switches_THT:SW_PUSH_6mm_h4.3mmSW1
1Sx1278_LORA_ModuleMainWorking:LORA_SX1278_ModuleLORA_EE1
1external_SwTerminalBlocks_Phoenix:TerminalBlock_Phoenix_MKDS1.5-3polexternal [esw1, esw2, gnd]
1relay1TerminalBlocks_Phoenix:TerminalBlock_Phoenix_MKDS1.5-4polGnd Neut NO NC
1relay1Relays_THT:Relay_SPDT_SANYOU_SRD_Series_Form_CRelay1
1relay2TerminalBlocks_Phoenix:TerminalBlock_Phoenix_MKDS1.5-4polGnd Neut NO NC
1relay2Relays_THT:Relay_SPDT_SANYOU_SRD_Series_Form_CRelay2
1smaConnectors_Molex:Molex_Microcoaxial_RFipx
1tmp36TO_SOT_Packages_THT:TO-92_Inline_Widetmp36

Similar boards

  • 4 layers230 × 196.7 mmSteel form Dish washer, the printed circuit board in 3D

    Steel form Dish washer

    R-Mutura/DISHWASHER

    Contains hardware and Software implementation of a dishwasher product

    156 parts
  • 2 layers69.1 × 65.5 mmHeater actuator node, the printed circuit board in 3D

    Heater actuator node

    gnilsson2/YAPP_Box_KiCad_Generator

    Generate Openscad boxes from KiCad PCB files.

    263 partsMIT
  • 2 layers82 × 42 mmCct controller, the printed circuit board in 3D

    Cct controller

    controlol/led-driver-constant-current-esphome

    KiCad design for a constant current driver with Mean Well dimmable LED driver and ESPHome firmware

    42 parts
  • 2 layers99.9 × 70.5 mmPCB puerta, the printed circuit board in 3D

    PCB puerta

    yabo104/Electric_Door_With_ESP32_S3

    This proyeject contains a hardware/firmware development for an electric door controller.

    75 parts
  • 2 layers99.1 × 58.4 mmHEAT, the printed circuit board in 3D

    HEAT

    milar111/HEAT

    An open-source STM32 SMD assembly station for precision soldering. Uses a custom Smart Pulse & Coast algorithm to drive 400W mains heaters via SSR. Features OLED UI, NTC feedback, and safety cooling.

    57 parts9
  • 2 layers217 × 116 mmBoard nhiet, the printed circuit board in 3D

    Board nhiet

    NguyenThanhHuy-debug/PCB-Liquid-Dispensing-Cabinet

    PCB-Liquid-Dispensing-Cabinet — a software project built with modern tooling.

    191 parts4
  • 2 layers78.7 × 58.4 mm40Hz, the printed circuit board in 3D

    40Hz

    oponyx/40HzGen

    Advanced ESP based 40Hz Gamma brain stimulator

    34 parts4MIT
  • 2 layers88.3 × 68.8 mmHome automation, the printed circuit board in 3D

    Home automation

    Noraiz963/Home-Automation-by-using-esp32_WROOM32D-pcb-

    An ESP32-based home automation controller designed in KiCad combines an isolated AC-DC power supply, dual relay outputs, physical switch input, and UART programming header into a single board for controlling AC loads…

    36 parts2

Questions

How big is the LORA Relay AC PCB?

It measures 104.4 × 99.8 mm and has 2 copper layers, 1.6 mm thick.

What parts does the LORA Relay AC use?

45 parts, built around the HLK-PM01, AMS1117-3.3 and MMBT3904. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the LORA Relay AC KiCad files?

From the motivemachine/LORA_remote_relays repository on GitHub, at the commit this page was made from: the board is hardware/v1.1/LORA_Relay_AC.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the LORA Relay AC design in my own project?

Its repository publishes it under the Apache-2.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).