Main - GoWired/GoWired-Project GitHub Wiki
The main wiki page contains all the information present in this wiki. Please refer to the home page to navigate it easily.
GoWired basics
GoWired is an open source (software + partially hardware) project providing an affordable and easy to use solution for WIRED home automation. GoWired utilizes RS485 communication standard and open source MySensors protocol to deliver a flexible, wired home automation solution for hobbyists and enthusiasts of DIY home automation. It supports both centralized and decentralized architecture in which modules are mounted in wall, below electrical switches.
Single GoWired module in a glimpse
Every GoWired module consists of an MCU board (with microcontroller and transceiver for wired communication) and a shield (which allows to expand MCU's functionality), as it is shown on a diagram below. MCU is responsible for communicating with the outside world (and other modules). It has interfaces to connect inputs and sensors (digital, analog, 1Wire, I2C, SPI). Connectors on Shields enable connecting to the bus (communication and power), outputs and sometimes also inputs (buttons and/or sensors).
How to wire a GoWired home automation system
Every GoWired installation needs to be properly wired. Everything what you need to know is shown on a picture below. On every installation at least one gateway should be present. It can handle several dozen in-wall or din rail mountable modules and needs a power adapter and a connection to an Ethernet switch.
GoWired features
This part covers information about GoWired modules and software functionalities.
FOTW
Firmware-Over-The-Wire is an advanced MySensors & GoWired functionality with allows user to send new firmware to a module through the RS485 bus without any need of taking it out of the wall or disconnecting. Compatible modules: GoWired MCU (v1 & v2), GoWired Touch MCU.
WDT
Enhanced Watchdog Timer (WDT) is a built-in AVR mechanism that forces a system reset in case of reaching a given time-out value. It means that if a module hangs or crashes, it will be almost instantly restarted by the WDT. The time-out period is configurable, but the default values are usually the best choice. By alternating them it is possible to disrupt module operation. All GoWired modules with AVR uCs use WDT (MCUs and gateways).
Home Assistant compatibility
GoWired Project uses Home Assistant (besides MYSController) as a reference controller. This means that new GoWired software is always tested to work with Home Assistant.
Home Assistant integration
To integrate GoWired installation with Home Assistant go to integrations menu and add MySensors integration. Currently available integration options are TCP and MQTT. TCP configuration
Field | Example Value | Description |
---|---|---|
MySensors Version | 2.3 | Version of MySensors used by your Ethernet Gateway software |
Configuration file | *.json | Give it a name or leave empty to have the name generated automatically |
IP Address | 192.168.1.10 | IP address of your Ethernet Gateway |
Port | 5003 | Port used by your Ethernet Gateway, default 5003 |
MQTT configuration
Field | Example Value | Description |
---|---|---|
MySensors Version | 2.3 | Version of MySensors used by your Ethernet Gateway software |
Configuration file | *.json | Give it a name or leave empty to have the name generated automatically |
Retain flag | Checked | By default the retain flag is checked |
topic_in_prefix | gwo | Output topic of your MQTT Gateway (default 'gwo') |
topic_out_prefix | gwi | Input topic of your MQTT Gateway (default 'gwi') |
All details and advanced integration options are described in Home Assistant documentation.
Built-in sensors
Most GoWired shields have built-in sensors which share some information with the user.
Temperature sensor
Some shields are equipped with a temperature sensor which is used for safety and diagnostic purposes. By default module temperature is read in every main loop and reported to the controller every ~5 minutes. Reporting interval can be adjusted by the user in Configuration.h file. This sensor also uses some other configurable parameters but they should not be changed by the user. Compatible modules: 2SSR Shield, RGBW Shield.
Current sensor
Some shields are also equipped with a current sensor. By default current flowing through the module is measured in every main loop and reported every time the measured change is significant in comparison to the previous value (software decides if the change is significant on the basis of the current 'current value' and the previous 'current value'). Current sensor uses some configurable parameters which should be adapted depending on the shield used. See paragraph Using Configuration.h file for details. Compatible modules: 2SSR Shield, RGBW Shield, 4RelayDin Shield (4 sensors), Touch 2Relay Shield, Touch RGBW Shield.
Software fuses
Software fuses work on the basis of built-in sensors. If a reading from the sensor exceeds a defined threshold, all module outputs will be turned off immediately and a message informing about this event will be sent to the controller. The thresholds are definable. While temperature threshold should not be raised, current threshold is different for every shield (see table below).
Shield | Current threshold maximum value [A] |
---|---|
2SSR | 3 |
RGBW | 10 |
4RelayDin | 16 |
Touch modules | 6 |
Inputs
Outputs
Dimmers features
Shutters handling
Gateway software
8RelayDin software
Heating Controller software
GoWired hardware
GoWired hardware has a modular architecture. Excluding gateways, there is always a shield coupled with a programmable board capable of communication, with is referred to as MCU module. Both shields and MCUs can have specific purpose, eg. in-wall installation, switchboard installation, touch buttons. Some of GoWired modules took part in a crowdfunding campaign and are still available to buy at Mouser.
GoWired MCUs
MCU boards features a uC unit, communication transceiver, EEPROM memory, connectors and some other peripherals such as power circuits or ESD protection elements. Their role is clear: to use peripherals available on-board (inputs) and on shields (sensors, inputs and outputs) and to communicate with the outside world.
GoWired MCU
A microcontroller and RS485 transceiver board, with Molex connectors for I/O, compatible with a variety of shields. Supports Firmware Over The Wire feature and supports various peripherals, such as buttons, digital & analog sensors. Technical Specification:
- ATMEGA328PB microcontroller with 8 MHz oscillator,
- ST3485EBDR RS485 transceiver working on hardware serial ports for greater speed and reliability,
- 64 kb external flash for FOTW updates,
- 12-pin interface for shields (2.0 mm pitch),
- 6 different connector interfaces (1.25 pitch) such as AVRSPI, 1Wire, I2C, Analog I/O pins, Digital I/O pins for buttons/binary sensors,
- 5 PWM available,
- 2x I2C on both pin interface and connector interface, 1Wire & SPI connectors,
- All I/Os are 15 kV ESD protected,
- Requires 3.3 V DC power input,
- Power consumption < 0.3 W,
- Very small size of 40x25 mm.
GoWired MCU v2
Second generation MCU module with better PCB design (4 layers), built-in LDO, and a lot of minor improvements.
GoWired MCU CAN
A spin-off project created by GoWired enthusiast. This MCU utilizes STM uC and CAN protocol, but is fully compatible with GoWired shields. Read more here. Unfortunately, available only in polish.
GoWired in-wall shields
In-wall shields, as the name indicates, are meant to be installed inside electrical boxes below switches. In-wall shields usually offer some kind of output (AC switches, DC dimming) and also some built-in sensors.
GoWired 2SSR Shield
2-channel AC controller shield cooperating with the MCU Module. Features solid state relays capable of sustained load up to 200 W per module. Perfect for lighting and roller shutters. Technical Specification:
- 2x triac, controlled by an opto-triac, for opto-insulation,
- Analog current and temperature sensors,
- 4 A SMD fuse for AC load,
- Protected against ESD, overcurrent, overvoltage, and reverse polarity,
- Reusable Positive Temperature Coefficient (PTC) fuse for bus power input,
- 8-pin interface for the MCU Module,
- 4x screw terminal for bus connection,
- 3x screw terminal for AC load connection,
- Power consumption (including MCU Module) under 0.5 W,
- Extremely compact: 40 mm x 28 mm,
GoWired RGBW Shield
4-channel 12-30 V DC dimmer to use with multi color lighting receivers. Technical Specification:
- 4x MOSFET transistor, controlled by phototransistor, for opto-insulation,
- Analog current and temperature sensors,
- Protected against ESD, overcurrent, overvoltage, and reverse polarity,
- Reusable PTC fuse for bus power input,
- 12-pin interface for the MCU Module,
- 11x screw terminals for load and bus connections,
- Power consumption (including MCU Module) is under 0.5 W,
- Extremely compact: 40 mm x 28 mm,
- 10 A maximum load.
GoWired DIN rail shields
DIN rail shields are intended to handle loads in a central point of your installation, a switchboard. They usually can work with greater loads or have more channels than in-wall gear.
GoWired 4RelayDin Shield
4x 16A / 230 V AC relays; independent current sensor on every channel
GoWired 8RelayDin Shield
8x 5 A / 230 V AC SPDT relays; 8x digital inputs.
GoWired Touch
GoWired Touch is our newest project which was developed in 2021. GoWired Touch modules combine together a touch wall switch with a wired home automation module. The architecture is analogous to our previous project, so every module consists of an MCU (this time with built-in touch sensors) and a shield. Every module can work as 1-pole or 2-pole with lighting, blinds/shutters or as a LED dimmer. This project also introduces our new approach to user experience β it will not need to be programmed by the user: all important configuration will be done by selecting options through dip switches. A possibility of reflashing the Touch MCUs will be still present though. To work as a regular switch, GoWired Touch will utilize a fingerprint resistant, mat glass panel provided by our partner in 2 color variants: black and white. Multi-modules glass panels (up to 4) will also be available, as well as panels combining switches and sockets.
GoWired Touch MCU
GoWired Touch 2Relay Shield
GoWired Touch RGBW Shield
GoWired Touch Raw
As a supplement to GoWired Touch comes the βRawβ series, to be used as stair switches which does not need bus communication. GoWired Touch Raw is a simple touch switch which can directly cooperate with GoWired Touch main unit.
GoWired Touch MCU Raw
GoWired Touch Power DC Shield
GoWired Gateways
Gateways are the pieces of hardware that connects modules networks with the outside world, that is usually a home automation controllers of some kind. They should be mounted on a DIN rail in a central point of the installation. Every gateway can handle a network of several dozen modules.
GoWired Ethernet Gateway
Ethernet Gateway is a bridge between GoWired modules and a home automation controller of your choosing. It should be mounted in an electrical switchboard and connects up to 63 modules to your home network. Technical Specification:
- Microchip ATMEGA328PB microcontroller with 8 MHz oscillator,
- ST3485EBDR RS485 transceiver working on hardware serial ports for greater speed and reliability,
- ENC28J60 Ethernet controller working on hardware SPI ports,
- Shielded RJ45 socket with LEDs,
- 10-pin IDC socket for programming,
- 10-pin IDC socket for interfacing with LEDs and Buttons,
- Highly efficient DC/DC converter provides exceptional energy efficiency,
- DC socket 5.5 / 2.5 mm power inlet, power source 12 VDC (6-14 V), 3 A,
- Compact: 85 mm x 56 mm (about the size of a Raspberry Pi),
- DIN mountable, 3D printable enclosure,
Software instructions
This part covers instructions about how to actually configure and upload software to GoWired modules.
Preparing IDE
Default IDE to use with GoWired modules is Arduino IDE. Before you will be able to start, it is important to make some preparations.
Installing IDE
Visit arduino website, download and install the latest version of Arduino IDE.
Adding necessary libraries
For GoWired software to compile, you need some libraries. Here is a complete list:
- MySensors
- UIPEthernet
- DHTlib - just download the Arduino library from here
- Arduino-SHT
- PCF8574/PCF8575
Adding boards
To flash firmware to GoWired modules we recommend to add MiniCore package to your Arduino IDE. Before flashing make sure the board setting in your IDE are as follows:
- Board: ATmega328
- Clock: 8 MHz external
- Compiler LTO: LTO enabled (especially important for GoWired Ethernet Gateway)
- Variant: 328PB
Setting up USBasp v2.0 programmer
If you are a Windows user, you will also have to install some additional software for the GoWired programmer. For both software and instructions, visit this website.
Important remark
Always make sure to use the latest versions of all the above mentioned software, unless specified otherwise.
Using Configuration.h file
General remarks
Configuration.h is meant to keep all the definitions in one place and therefore make the configuration process easier and faster. There are some more important definitions (which usually has to be defined) - they will be highlighted with bold.
Identification
These values are used by the module to present itself to the controller (Domoticz, Home Assistant, etc.).
MY_NODE_ID
(Node ID) β a unique number, extremely important to define, range 1-255 (every module on the same RS485 bus must have a unique Node ID number); ATTENTION! Newest development branch of MySensors support automatic ID assign for RS485. To use it replace a node ID number with AUTO keyword.SN
(Sketch Name) - keep it short and distinctiveSV
(Sketch Version) - technically, should be incremented with every change of the sketch
Transmission settings
MY_RS485
- enables RS485 transport layerMY_RS485_DE_PIN
- defines an ATmega pin responsible for enabling the RS485 transceiver (default 7)MY_RS485_BAUD_RATE
- sets RS485 transmission baud rate, must be the same on every module connected to the same gateway (default 57600)MY_RS485_HWSERIAL
- enables hardware serial (default Serial)MY_RS485_SOH_COUNT
- helps avoiding collisions (default 3)MY_OTA_FIRMWARE_FEATURE
- enables firmware-over-the-wire updates (defined by default)MY_TRANSPORT_WAIT_READY_MS
- defines a period of time to wait for gateway to respond at startup (default 60000)
Quick config
Output config - selecting output mode; only one mode can be defined at a time.
DOUBLE_RELAY
- use with 2SSR Shield; 2 independent relays controlled from buttons connected between D2, D3 and GND pinsROLLER_SHUTTER
- use with 2SSR Shield; roller shutter controller with autocalibration (see below); dedicated buttons D2, D3FOUR_RELAY
- use with 4RelayDin Shield; 4 independent relays with power consumption calculation for every channel; to use it disableINTERNAL_TEMP
DIMMER
- use with RGBW Shield; 1-channel LED dimmer (use with one colour LED tapes); dedicated buttons D2, D3RGB
- use with RGBW Shield; 3-channel LED dimmer (use with RGB LED tapes); dedicated buttons D2, D3RGBW
- use with RGBW Shield; 4-channel LED dimmer (use with RGBW LED tapes); dedicated buttons D2, D3 Input config - selecting inputs; 0-4 can be defined.INPUT_1
- input assigned by default to pin D4INPUT_2
- input assigned by default to pin A3; cannot be defined without INPUT_1INPUT_3
- input assigned by default to pin A1; cannot be defined without INPUT_2INPUT_4
- input assigned by default to pin A2; cannot be defined without INPUT_3 Onboard sensorsPOWER_SENSOR
- ACS712 analog current sensor; present on most GoWired Shields (2SSR, RGBW, 4RelayDin)INTERNAL_TEMP
- MCP9700 analog temperature sensor; present on 2SSR and RGBW shields; comment it out when using 4RelayDin Shield External sensorsEXTERNAL_TEMP
- external temperature/humidity sensor (DHT22 or SHT30)
MCU Pin Definitions
In this section it is possible to make changes to default MCU pin configuration, but it is not recommended.
Various Definitions
General - usually there is no need to change these values.
RELAY_ON
- defines what value to use when turning relays on (default HIGH)RELAY_OFF
- defines what value to use when turning relays off (default LOW)
Internal temperature sensor - usually there is no need to change these values.
MVPERC
- mV per degree celcius (default 10)ZEROVOLTAGE
- voltage output of temperature sensor for 0C in mV (default 500)MAX_TEMPERATURE
- maximum temperature the module can achieve before turning off the outputs and reporting error (default 85)
Power Sensor - change these values according to the shield being used.
MAX_CURRENT
- maximum current (A) the module can handle before turning off the outputs and reporting error (defaults: 2SSR - 3, RGBW - 10, 4RelayDin - 16)POWER_MEASURING_TIME
- period of time (ms) during which the power sensor measures current (deafult 20)MVPERAMP
- mV per 1A (defaults: 2SSR - 185, RGBW - 100, 4RelayDin - 73.3)RECEIVER_VOLTAGE
- voltage (V) of the receiver for power usage calculationsCOFSI
- value of cos(fi) for a given load: resistive load - 1, LED - 0.4-0.99 DimmerDIMMING_STEP
- size of dimming step; increase for faster, less smooth dimming (default 1)DIMMING_INTERVAL
- duration of dimming interval, increase for slower dimming (default 10)DIMMING_TOGGLE_STEP
- Value to increase dimming percentage when using wall switch (default 20)
Blinds or shutters
RS_AUTO_CALIBRATION
- enables autocalibration of roller shutter after the first launch; before powering up the module for the first time, make sure that the roller shutter is also connected to mains; after powering up the module roller shutter should go upwards; after the calibration is finished it should be openPS_OFFSET
- power sensor offset (A); values smaller than this value will be considered as 0 A (default 0.2)CALIBRATION_SAMPLES
- number of calibration samples for roller shutter calibration (default 2)UP_TIME
- upwards movement duration; works only when autocalibration is disabledDOWN_TIME
- downwards movement duration; works only when autocalibration is disabled
Heating system section thermometer
HEATING_SECTION_SENSOR
- every module on the same RS485 bus can report temperature values directly to a Heating Controller; define this to enable this featureMY_HEATING_CONTROLLER
- ifHEATING_SECTION_SENSOR
is defined, specify the Node ID number of the Heating Controller
Other
INTERVAL
- interval value (ms) for reporting readings of some sensors (right now onboard and external temperature sensors, default 300000)INIT_DELAY
- value (ms) used to calculate a wait time during the initialization process (default 200)LOOP_TIME
- main loop wait time (default 100)
Output config
In this section it is possible to configure some advanced output options. IDs - child IDs of output sensors should not be modified
RELAY_ID_1
-RELAY_ID_4
- child IDs of relays (2SSR and 4RelayDin shields)RS_ID
- child ID of roller shutter (2SSR Shield)DIMMER_ID
- child ID of all dimmers (1-channel, RGB, RGBW; RGBW Shield)
Pins
RELAY_1
-RELAY_4
- microcontroller pins assigned to those relaysBUTTON_1
,BUTTON_2
- microcontroller pins assigned to buttons related to the relaysLED_PIN_1
-LED_PIN_4
- microcontroller pins assigned to RGBW outputs
Other
NUMBER_OF_RELAYS
,NUMBER_OF_CHANNELS
- total number of outputs, should not be changedFIRST_INPUT_ID
- next 'free' child ID to be used when defining inputs
Input config
In this section it is possible to configure some advanced input options.
Digital inputs INPUT_1 - INPUT_4
INPUT_ID_1
-INPUT_ID_4
- child IDs of the inputs; should not be modifiedPIN_1
-PIN_4
- microcontroller pins assigned to the input; can be modified if necessaryPULLUP_1
-PULLUP_4
- define to enable built-in pull-up resistor for the corresponding input (necessary for door/window sensors and buttons, defined by default)NUMBER_OF_INPUTS
- total number of inputs, should not be changed
Special Button Special Button is a sensor which sends a message to the controller (logical 1) after a long press (holding a button pressed for more than 1s) performed on any relay related button (or dimmer related connected to D2). It is defined by default. Value sent to the controller could be used e.g. as a trigger in automations.
SPECIAL_BUTTON
- comment out to disable Special Button featureSPECIAL_BUTTON_ID
- Special Button child ID
Power sensor
PS_ID
- power sensor child ID; when using 4RelayDin Shield, there are 4 power sensors with 4 different IDsPS_PIN
- power sensor pin; 4 different pins when using 4RelayDin Shield
Built-in thermometer
IT_ID
- built-in thermometer child IDIT_PIN
- built-in thermometer pin (2SSR and RGBW shields use different pins forIT_PIN
)
External thermometer
ETT_ID
- child ID for temperature sensorETH_ID
- child ID for humidity sensorDHT22
- define to use DHT22 temp&hum sensor; to use it alsoET_PIN
should be definedSHT30
- define to use SHT30 temp&hum sensor
Error reporting
This section covers actually not only reporting errors to the controller, but also setting up some very important security procedures built in the software. It is strongly recommended not to change anything about ERROR_REPORTING
definition.
ES_ID
- child ID of 'Electrical Status' sensor, which turns off the outputs in case of measuring to big currentTS_ID
- child ID of 'Thermal Status' sensor, which turns off the outputs in case of measuring to high temperatureETS_ID
- child ID of 'External Thermometer Status' sensor, which informs controller about error codes from the DHT22 thermometer; can be disabled safely
RS485 debug
It is possible to send some debug prints through the RS485 bus. This feature could be useful for advanced users. The prints appear in the controller under the child ID DEBUG_ID
.
EEPROM
This section configures the EEPROM addresses used by the software. Should not be changed.
Configuring software for the Gateway
Before flashing firmware to the Gateway, it is necessary to configure these variables:
Human friendly name | Software definition | Description |
---|---|---|
IP Address | [MY_IP_ADDRESS] | adjust this value to fit your home network |
Port | [MY_PORT] | it can be left unaltered, default 5003 |
MAC address | [MY_MAC_ADDRESS] | make sure it is unique in your home network |
Installing GoWired
This section covers materials about physical installation of GoWired modules.
Preparing electrical installation
Decentralized architecture
GoWired recommends decentralized architecture, that is, installing GoWired modules in-wall all around a building. In this case only one additional cable is needed to be installed in addition to the traditional electrical infrastructure - no need of star topology in case of 230 (110) VAC cables.
RS485 Bus
Bus cable Though a standard twisted pair cat. 5e wire is capable of serving as GoWired Bus, we recommend using EIB/KNX data transmission 2x2x0.8 mm wire.
Bus requirements When using GoWired default baud rate of 57 600 bps, the bus can technically be as long as 1200 m. In practice though, this value is difficult to achieve since the existence of voltage drop. Though the voltage drop is not as high as it could be expected (thanks to the energy efficiency of GoWired modules), it is recommended to use various techniques to reduce it. This includes:
- planning one bus for every floor of the building to keep the buses short enough,
- installing both ends of the bus wire in the electrical switchboard, so it could be supplied from both sides,
There are also some build-in limitations in GoWired hardware:
- maximum number of modules on one bus - 63,
- maximum current (fused on Gateway) - 3 A.
Also, GoWired modules are 'voltage drop ready' and can work under 7-14 VDC.
Installing bus cable Bus cable in a decentralized installation has to be dragged from the electrical switchboard (central point of the system) through all electrical boxes. It is recommended to install both ends of bus wire in the switchboard. It is also important to keep a proper distance between signal wires (bus) and power wires (110/230 VAC), especially on long distances. It is recommended to use separate installation zones for the 2 kinds of wires.
Other electrical issues
Electrical equipment GoWired does not require any kind off special electrical equipment, but the best choice is to use normally open switches (bell switches).
Recommended bus power source GoWired should be able to be used with various power sources capable of supplying 12 VDC, 3A with no issues. Our recommendation though is Mean Well HDR series, with HDR-30-12 for smaller installations and HDR-60-12 for larger ones.