****************** Using Gateway GPIO ****************** .. DANGER:: Using Gateway GPIO may seriously damage your product or boiler. Be careful. Soldering or modifying the Gateway board will void the warranty. The Gateway board is directly connected to the EMS bus of your expensive boiler/heat pump. Adding your own electronics to the Gateway board is dangerous. The Gateway board was not designed for this purpose. Some electronics will add noise or disturbances on the bus or if you do it wrong you could apply f.i. mains voltage to the board which WILL destroy your boiler circuit board. The new 'Sensors' feature in EMS-ESP allows you to connect external sensors and relays. On this page some guidelines. .. Note:: Although the EMS-ESP firmware has a feature to add external sensors and relays, BBQKees Gateways are not designed for this purpose. This page gives some guidelines on how to use GPIO more safely because some will still try to do it, but this is not to be considered a permission or approval to modify the Gateway in any way. General considerations ====================== GPIO are hidden inside ---------------------- The GPIO pins are only available from inside the Gateway, and that's for a reason. You can make use of them but I do not give any support on it and in no way I'm responsible if you damage the product or the boiler. Only use them if you you have enough knowledge on the ESP32 and electronics in general. Safety measures --------------- NEVER EVER connect a relay or any other device directly to the Gateway. Use an optocoupler or other safety/isolation measures. If you don't know what you are doing here you can easily damage your boiler/system beyond repair. So be careful! Don't f.i. hookup an Aliexpress relay board without knowing how it works or how it is isolated from mains voltage. Be careful not to introduce any noise or voltage/current spikes into the system. It is not designed to handle these external noise sources. Do not feed any external voltage into these GPIO pins. As am example below an extremely dangerous relay for the Wemos D1 Mini: .. image:: ../images/hardware/dangerous-wemos-relay.jpg :alt: dangerous Wemos relay It's dangerous for three reasons: * There is almost no clearance between low voltage and mains voltage traces. You are one voltage arc away from destroying everything that is connected to it. * Mains voltage pins of the relay are exposed on the bottom edge. If you f.i. unplug the relay board there is a chance you touch these pins. * These boards have no optocoupler between the relay and the GPIO of the ESP module. Voltages -------- Most relays need at least 5V to operate. The older S32 has 5V available internally, but the S3, S3-LR, E32 and the newer S32 only have 3,3V inside. So you need an external power supply to make use of it. Current draw ------------ Never draw more than 100mA from the 5V or 3V3 power line when you are using the service jack. When an external 12V power supply is connected to the Gateway 200mA current draw is permitted. GPIO can only source/sink about 10mA. Available GPIO pins =================== Gateway S3 and S3-LR -------------------- The Gateway model S3 and S3-LR have one header H1 with GPIO. H1 pinout from top to bottom: 3V3-GPIO45-GPIO14-GND. This board does not have 5V available, it runs completely on 3V3. Gateway S32 ----------- Gateway model S32 revision V2.0 has multiple headers with GPIO; H1, H2 and CN4. H1 pinout from left to right: GND-GPIO18-GPIO19-3V3 H2 pinount from left to right: GND-RX-TX-3V3 CN4 pinout from top to bottom: GND-GPIO26-GPIO25-3V3 This board does not have 5V available, it runs completely on 3V3. Gateway model S32 revision V1.1 had two headers with GPIO; J20 and J29. J20 pinout from left to right: 3V3-GND-GPIO22 J29 pinout from left to right: GND-GPIO36-GPIO39-GPIO25-5V. This board has both 3V3 and 5V available. Gateway E32 ----------- Gateway model E32 (all revisions) has one header with GPIO. Its J20 on the top of the board. Pinout from left to right: 3V3-GND-GPIO32. This board does not have 5V available, it runs completely on 3V3.