Close
0%
0%

Cheap Ethernet IO extension board for smarthome

Cheap low power smarthome extension board with Ethernet/Modbus/1-wire/DMX512/Wifi connection

Similar projects worth following
At the moment I am renovating my house. This is the time to change my home electric system to a smarthome system. I like the Loxone (www.loxone.com), but it uses KNX. This is a nice home automation system, but VERY expensive. A single KNX switch costs about 60-70 euros. I want to make an extension board for the Loxone with network connection (ethernet and an ESP8266 if ethernet isn't a possibility for you). I also want to add a Mod bus interface and a KNX interface. There is just one problem. I am a hardware design engineer, but not a software engineer. I need someone to make the firmware for the Cortex-M0 controller. I think the MCU will be an ATSAMD21 to make it arduino compatible. The ethernet interface will be an ENC28j60 board from Aliexpress. The PCB will have 64 IO's. I will not use relays on the board. The digital outputs can be connected to a solid state relais (search aliexpress for 5 chan

On 22 March 2017 I went to the High Tech Campus in Eindhoven to attend a seminar about 'smarthomes' (presented by tweakers.net). I am renovating my bungalow from 1967 and was curious about the current state of technology for smarthomes. I decided to turn my home into a smarthome. It's already disconnected from the gas supply line and it will be a house with a heat pump and solar panels. So besides the water the house will be a 100% sustainable home.

Now I am looking for a smart solution for my smarthome. The Loxone Miniserver is a very nice device, but additional KNX devices that you need for the system are very expensive. Let's make a cheaper and more flexible solution to expand the inputs & outputs. A device that can be connected to the network and send the active button signal to the Loxone by ethernet. There will be the following interfaces available: I2C, 1-wire, DMX, Modbus, Wifi/BLE, Ethernet. So this PCB can also be a network gateway to those interfaces. This project can also be used by someone that doesn't use a Loxone. With a webpage on the ATSAMD21 you can have a realtime insight in the digital inputs and set the digital outputs. But the device can also generate TCP request when an input changes. You can also connect some PIR sensors on the digital inputs (with a AC to DC level adapter in between) and generate an alarm when you're from home (send a notification by the internet to your phone).

These are the specs of the final hardware:

* 64 digital Inputs/Outputs. can be configured separately as inputs and outputs. Changing inputs will be processed immediately because this will raise an interrupt. Outputs can be connected to mechanical relay or SSR (https://www.aliexpress.com/item/10DA-Din-rail-SSR-quintuplicate-five-5-input-3-32VDC-output-24-380VAC-single-phase-DC/1581576845.html)

* controller is the ATSAMD21. This controller is Arduino M0 compatible (with the right firmware inside)
* The PCB can also be used as a standalone product (with webpage, etc.), but also as an IO extension for an existing home automation system.

* USB device. The ATSAMD21 will on be a USB device. The 'old' standard USB connections are robust. This USB port will be used to update the controller.

* Ethernet connection. The PCB has a place for the ENC28j60 device (SPI to ethernet).

* Wifi or BLE module will provide additional communication options.

* 1-wire interface. Connected with a DS2484R+T to the ATSAMD21

* Modbus interface. Connected with a MAX485/SP485/ST485 to the ATSAMD21

* DMX interface. Connected with a MAX485/SP485/ST485 to the ATSAMD21

* Small LCD to give insight into the working PCB

* High efficiency step down power converter. The 24VDC will be converted to 3v3 and 5v for powering the MCU and peripherals.

* Cheap solution. This doesn't mean that the PCB is no good quality. I won't compromise the quality to get a cheaper PCB. The PCB has ESD protection diodes and resettable fuses.

* This PCB will probably spark some other ideas. Modifying sensors and suggestions for sensing the smart home.

The ethernet connection is the main communication possibility of the PCB. There are a lot of Arduino libraries available or the Modbus/1-wire/LCD/BLE, etc. I am a hardware engineer and not specialized in developing software. Please joint me in the open hardware/software project to make it a good PCB. I will use this board for my Loxone, but you can also use it for other home automation systems. It can also support MQTT. But If you want 'just' a PCB that is able to control your house from a remote location (TCPIP IO with a webpage), this is the PCB to make it all come true. The possibilities are limitless. You can also make your PCB custom made. Leave things off the PCB if you don't need them. To all the software engineers....Please joint the project or send me a message.

Ps. the picture is of an existing modbus board that has 16 inputs and 14 output relays

  • 1 × ATSAMD21G18A-AUT Atmel ® | SMART ™ SAM D21 is a series of low-power microcontrollers using the 32-bit ARM ® Cortex ® -M0+ processor, and ranging from 32- to 64-pins with up to 256KB Flash and 32KB of SRAM.
  • 4 × PCAL6416APW,118 Interface and IO ICs / I2C, SMBus
  • 2 × ST1480ACDR RS485 interface IC
  • 1 × DS2484R+T I2C to 1-wire
  • 1 × NC3FAAH2 Electronic Components / Misc. Electronic Components

View all 11 components

  • The PCB works. Now the software....

    markbng10/03/2017 at 14:41 0 comments

    I have assembled the hardware. It really looks nice and the step down converters work perfectly (5v & 3,3V). I have tested the M0 bootloader and the PCB enumerates :). The PCB is compatible with the other Arduino M0 boards. I need someone that helps me with modifying the variant.cpp, pins_arduino.h, variant.h, etc. You will receive a board from me to adapt the arduino software.

  • PCB is ready for assembly

    markbng08/10/2017 at 10:12 0 comments

    I received the PCB yesterday. I don't have the time now to assemble it right now, but here are pictures of the bare board. It's still possible to receive a free PCB to develop the Arduino framework for this Arduino M0 variant. I will be on holiday until 22 august, so no update until then.

  • Thinking about extensions for this board.

    markbng08/02/2017 at 09:28 0 comments

    I was thinking about extensions for this board:

    • SSR relay board that can be directly connected to the boxed header IO's. The IO header is already compatible with a relay board on aliexpress (10 USD for 16 channel relay board, https://www.aliexpress.com/item/DC-5V-12V-16-Channel-Relay-Module-Interface-Board-For-Arduino-PIC-ARM-DSP-PLC-With/32501824575.html). But I like SSR relays, so I will replace the normal relay board with the SSR board later. The SSR board will cost more. That's the downside. 10USD for a 16 channel relay board with free shipping is cheap. Optocouplers are on the relay board, so it can be connected directly with a ribbon cable.
    • Input board with opto couplers and/or DC filters
    • Analog inputs (with external I2C). I bought some cheap PIR sensors at HornBach. I will modify them with a separate PIR (logic output) and separate ambient light output (analog). Analog signals are not good in probably a noisy environment and/or with long cables. A good way to measure this over a distance would be to convert the ambient light sensor voltage to a current with an opamp. On the other side is a low pass (DC) filter with a precision resistor. This resistor will convert the current to the voltage again and this (ambient light) voltage can be measured with a x channel I2C ADC. The PIR output can be directly coupled to an IO (maybe a small DC filter). The PIR modification will be another project. Modification is necessary to use the same PIR as an alarm sensor when you are away (also during the day, so separate light and PIR!) and you can use the same sensor at night to switch on the lights when you are at home.

    Leave a comment for requests and/or suggestions

  • PCB is finished!!

    markbng08/01/2017 at 15:57 0 comments

    Good news. The PCB is finished. I will submit the data tonight at Eurocircuits. I will first make a few prototypes. Please contact me to experiment with me on the board. I am not that good in software, but the hardware is most of the times good the first time. Let's hope this is also good ;) There is a lot of hidden work when you see the design (assigning SerComs, making it almost compatible with the Arduino M0, fitting it in a housing, etc.). So sorry for the delay, but here it is....

    A small line of solder mask is missing on the edges of the PCB. This is for ESD reasons. I will receive the PCBs around 10 August. I will make a few pcs right away. I ordered 5PCBs. So if you want a PCB, you can ask me. In return I ask you to make changes to the Arduino M0 sercom configuration, adapt the ENC28J60 library, adapt the SSD1306 source for this board, make certain IOs available in Arduino. So the main thing is to adapt the functions to the pinning of this board (reconfigure IO). Libraries for Ethernet, WiFi, BLE, USB, LCD, etc are available (maybe not working due to pinning).

    The PCB data will be published here if the prototype PCB is good. You can make the PCB for personal use (gerbers will be included), but not for commercial use.

  • PCB so far

    markbng07/31/2017 at 19:59 0 comments

    I have ordered a housing on Aliexpress. The PCB will fit into this housing: https://www.aliexpress.com/item/6-pieces-a-lot-plastic-box-electronics-88-59-107mm-3-5-2-3-4-2inch/1625472251.html

    These are some pictures of the current PCB. Schematic have also changed a little bit (made it possible to have 3v3 and/or 5v IO ports). The size of the PCB will be 105mmx85mm. (4134mil x 3346mil). I did the most important job already. Placed the components in a logical way for easy routing. The Modbus and DMX512 will be a differential pair with a 120 Ohm impedance. The USB 90 Ohm of course. I will also tune the SPI (ethernet) and I2C.

    I made also an very important update in the schematic to enable the SAM-BA bootloader. JTAG-SWD is also available on the PCB, but this is only for the experts. Normal users will reset the PCB with the bootloader button pressed and the will just have to program the Arduino bootloader into the board. Then you can program the board in Arduino. Is the board fails, you are able to restore the Arduino bootloader with the procedure mentioned before. You will always be able to restore the board software yourself.

    The ethernet PCB will be mounted in a good way. The outside of the HanRun connector will be soldered onto the mainboard (see copper tracks around the word Ethermet). This will be a very solid construction. The green socket header below is : PWR, 1-wire, ModBus and external I2C. You can use the external I2C for external ADC readings, temperature sensors, light sensors, etc. After the board is finished I will give some suggestions to get you going.

    I also will make a SSR board and opto coupler board (since the IO's are not protected well). This is not possible due to the flexible design. You can make each IO an input or output. The IO's will not be able to handle 24VDC, but with an external board you can use 24VDC logic levels. Now the IO's can handle 3v3 and 5vdc as mentioned before. I will make the LCD and LEDs on the top side of the housing. You can connect wires between the on board LEDs and LCD connection. LCD and LEDs are optional. Just what you want....

  • Final schematic sheets

    markbng07/26/2017 at 16:22 0 comments

    I was a little bit sick last week, so that's why I couldn't work on this project. These are the final schematic sheets for the project. I will finish the PCB asap. The PCB below is just an import of the components. Thinks I have to do right now: check aliexpress for a cheap and nice DIN housing. Make it possible to fit the PCB in this housing.

    I will make prototypes of the board when the PCB is ready. I will make 3 or 4 boards. I need someone that is good in configuring the board in Arduino and can rewrite some parts of the software for this board (most software is already available in Arduino libraries). If you are interested in the board and you can help me with writing the code for Arduino, please leave me a message and you will get this board (almost) for free.

  • DC-DC converter power supply for the PCB

    markbng07/17/2017 at 23:25 0 comments

    This week I will start with the board. Today I made the power supply for the unit. I wanted a synchronous DC-DC converter with a high efficiency. The voltage difference between 24VDC and 3V3 is a lot. It's a waste to burn the 20,7V up in heat. That's why I want a DC-DC converter with a high efficiency. So the DC-DC converter must also be able to handle the 24VDC input voltage. I want to generate 3.3V and 5V. The ethernet device ENC28J60 uses a lot of power and also the ESP-12 that is on the board. I will also make it possible to have the ENC28J60 and BLE on the board. But you have to choose: WiFi or BLE (due to the restrictions of number of SERCOMs. a shared sercom for both devices). I will use the Ethernet mainly, so maybe I will go for the BLE option. The BLE module is the JDY-10 (it is $1.38 on aliexpress with shipping).

    But back to the task of today. The power supply of the PCB. To be safe I calculated the DC-DC to be able to handle a 500mA output current.

  • Loxone 2017 ;) with SSR outputs

    markbng07/02/2017 at 14:35 0 comments

    The Loxone is an amazing peace of hardware. It works good and I am very satisfied with it. But the output relay (click clack) are not from this century anymore, so I decided to change the outputs of my Loxone. I bought some cheap SSR relays on aliexpress (https://www.aliexpress.com/item/FREE-SHIPPING-S216S02-S216S02F-S216-TO3P-4-5PCS/32802165635.html ). They work fantastic. Do you also want SSR relay on your board. These are the steps how to do it:

    * open your Loxone. Carefully put a small flat screwdriver between the plastic tabs and pop it open.

    * Look for the white relay. Carefully put some leaded tin on the bottom side of the PCB where the relay is soldered. Desolder it by using soldering wick, an desolder station or carefully heat up the whole footprint of the relay with a SMD hot air gun (please be careful with the last option, because it's a double sided board and you don't want to desolder other parts. This option is not recommended for beginners).

    * When the relay is gone, now you need 3 part for each relay output: The solid state relay itself. A 1W 1500R resistor and a varistor. I use the S216S02 SSR, the 1k5 1W from farnell, ERZE08A511 - TVS Varistor Surge Absorber for each output. The 1k5 resistor limits the current (16mA for the LED input of the SSR) and the TVS protects the SSR against high voltages on the output (inductive load). The SSR outputs will be connected with the terminal block and the connections of the relay coil will be replaced by the 1k5 resisor in series with the SSR LED. So connect the + of the coil to one side of the 1k5 and the other side of the 1k5 will be connected to the + of the LED of the SSR. The - of the SSR LED will be connected to the other connection of the relay coil. Tuesday I will provide pictures. Put a varistor in parallel to the connections of the terminal block. This will protect the SSR. You can also add a resettable fuse if you want a 'perfect' ouput.

    * Tuesday I will post my solder work and further instructions ;). The SSR will stay cool, so I probably don't need any heatsinks. The is 1 downside to the solid state relay... You can only use it for switching AC voltage and not little analog voltages or DC voltages. For debugging it is annoying that you lost your click signal to check if the relay in turning on or off. But this is why I want it in my house. No click sounds. The SSR is a semiconductor, so it should last much longer (if you use the varistor against high voltages). The SSR that I use here can also handle more current (16A max). To maximize the current up to 16A you have to put wires in parallel with the PCB connections from the SSR to the terminal block. The PCB lines are not that thick and can probably not handle 16A.

    This is my test with the SSR. And yes, I know, the blue wire from the mains must be isolated with tape ;)

    Disclaimer: Please only do this when you know what you are doing. I can not be held responsible for any damage caused by modifying the Loxone. You probably risk that you don't have any warranty on the product anymore. Making the wrong connections can harm the PCB and also yourself (output of the AC voltage of the SSR connected to the low voltage part of the Loxone).

    See my other project page just for this modification of the Loxone.

  • Modbus and RGBW drivers

    markbng06/23/2017 at 23:43 0 comments

    It has been while since my last log. But this doesn't mean that there is no progress. I ordered some parts on aliexpress and I played with a room thermostat that has a modbus connection. This thermostat can measure the room temperature and can switch on the valves to heat the room. But this isn't why I want this thermostat. I just want it as a input device/terminal for user input. So the Loxone can read out the room temperature and see what temperature is desired by the user in that room. The Loxone will decide what action has to be taken with the given values. It's not really a high tech device though. It measures the temperature with an inaccurate NTC resistor. I also noticed that the time on the device is not very accurate. But the last thing isn't a problem, since the time will be regularly updated by the NTP time from the Loxone. The positive things about the device....it looks nice and does exactly what I wanted (being able to set and read values from the outside by connecting it to a Modbus master).

    I also bought DMX RGBW LEDStrip PWM dimmers. I haven't tested the units yet (I don't have the RGBWW LEDstrip yet), but I also have found a cheap alternative. The PCA9685 from NXP. It's a 16 channel 12bit PWM device with I2C connection. I will not place this device on my board, but I will make the I2C bus available to expand this PCB with a PCA9685 device. It is really simple to make a RGBW dimmer (4ch PWM LED dimmer). Just connect the I2C to the PCA9685. Connect FETs to the LED outputs of the PCA9685 (with probably a FET driver eg PMD3001D) and you are ready to go. The FET will be able to switch the 12VDC on and off. The FET driver will prevent the FET from becoming too hot. It's the time between the on- and off- state when the FET heats up the most (relative high voltage and high current). The FET driver will shorten the switching time and will prevent excessive heat losses. You don't have to use a FET driver when you just switch 2 times a minute, but since it's a PWM signal, the switching frequency is high.

    Below you see a picture of the thermostat. Yeah, I know, it was pretty hot that day....

  • The first draft of the schematic diagrams

    markbng05/31/2017 at 23:29 0 comments

    I have been busy lately with the renovation of my home. The floor isolation is applied and the floor heating tubes and the upper cement layer is also applied in my home. The electrical connections are plenty and I still have to complete many connections (all connected to a central point in my house)

    But now I have also worked on my project. I have made a first draft to show you my ideas. Any requests and/or comments are more than welcome. Now is the time, because I will make a PCB on a short notice. I still have to connect the I2C buses and the SPI bus (of the ENC28J60) to the main controller. As a hardware engineer I know how to connect the sercoms, but maybe you can give me some advise which pins to use from a software perspective (easy Arduino implementation). Or does it not matter which sercoms/pins I will use?

    I have also added an I2C LCD to the project. This makes it easier to debug the device and see what is going on with the IO's. Please notice the costs of the components that I use. It will be a very cheap solution (as promised ;) ). LCD is $2.40. ESP-12F is $1.63. The ENC28J60 board is $2.16.

View all 16 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates