Silicon ChipHot Water System Solar Diverter, part two - July 2025 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Confusion between lithium battery types
  4. Feature: SpaceX by Dr David Maddison
  5. Project: Solar Charging via USB by Julian Edgar
  6. Project: The SmartProbe by Andrew Levido
  7. Feature: Precision Electronics, Part 9 - System Design by Andrew Levido
  8. Subscriptions
  9. Feature: Salvaging Parts by Julian Edgar
  10. Project: Hot Water System Solar Diverter, part two by Ray Berkelmans & John Clarke
  11. Feature: Low-cost electronic modules: 8×16 LED Matrix module by Tim Blythman
  12. Project: SSB Shortwave Receiver, part 2 by Charles Kosina, VK3BAR
  13. Serviceman's Log: Water woes a and hydration hindrances by Dave Thompson
  14. Vintage Radio: Eddystone EC10 Mk2 by Ian Batty
  15. PartShop
  16. Market Centre
  17. Advertising Index
  18. Notes & Errata: Vintage Radio – Emerson 888, May 2025; Power LCR Meter, March & April 2025; Mains Power-Up Sequencer, March & July 2024; Reciprocal Frequency Counter, July 2023
  19. Outer Back Cover

This is only a preview of the July 2025 issue of Silicon Chip.

You can view 37 of the 104 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Articles in this series:
  • SpaceX (July 2025)
  • SpaceX (July 2025)
Articles in this series:
  • Shed Alarm (March 2025)
  • Audio Mixing Cables (March 2025)
  • Shed Alarm (March 2025)
  • Audio Mixing Cables (March 2025)
  • Solar Charging via USB (July 2025)
  • Solar Charging via USB (July 2025)
Items relevant to "The SmartProbe":
  • SmartProbe PCB [P9054-04] (AUD $5.00)
  • SWD FFC Adaptor PCB [P9045-A] (AUD $2.50)
  • STM32L031F6P6 programmed for the SmartProbe [0411025A.HEX] (Programmed Microcontroller, AUD $15.00)
  • 0.96-inch 128×64-pixel white bare OLED screen (Component, AUD $10.00)
  • SmartProbe firmware (Software, Free)
  • SmartProbe PCB pattern (PDF download) [P9054-04] (Free)
  • SWD Programming Adaptor PCB pattern (PDF download) [P9045-A] (Free)
Articles in this series:
  • Precision Electronics, Part 1 (November 2024)
  • Precision Electronics, Part 1 (November 2024)
  • Precision Electronics, Part 2 (December 2024)
  • Precision Electronics, Part 2 (December 2024)
  • Precision Electronics, Part 3 (January 2025)
  • Precision Electronics, part one (January 2025)
  • Precision Electronics, part one (January 2025)
  • Precision Electronics, Part 3 (January 2025)
  • Precision Electronics, part two (February 2025)
  • Precision Electronics, Part 4 (February 2025)
  • Precision Electronics, Part 4 (February 2025)
  • Precision Electronics, part two (February 2025)
  • Precision Electronics, part three (March 2025)
  • Precision Electronics, part three (March 2025)
  • Precision Electronics, Part 5 (March 2025)
  • Precision Electronics, Part 5 (March 2025)
  • Precision Electronics, Part 6 (April 2025)
  • Precision Electronics, Part 6 (April 2025)
  • Precision Electronics, part four (April 2025)
  • Precision Electronics, part four (April 2025)
  • Precision Electronics, part five (May 2025)
  • Precision Electronics, part five (May 2025)
  • Precision Electronics, Part 7: ADCs (May 2025)
  • Precision Electronics, Part 7: ADCs (May 2025)
  • Precision Electronics, part six (June 2025)
  • Precision Electronics, part six (June 2025)
  • Precision Electronics, Part 8: Voltage References (June 2025)
  • Precision Electronics, Part 8: Voltage References (June 2025)
  • Precision Electronics, Part 9 - System Design (July 2025)
  • Precision Electronics, part seven (July 2025)
  • Precision Electronics, part seven (July 2025)
  • Precision Electronics, Part 9 - System Design (July 2025)
Items relevant to "Hot Water System Solar Diverter, part two":
  • HWS Solar Diverter main PCB [18110241] plus protective panels (AUD $20.00)
  • Hot Water System Solar Diverter software (Free)
  • Hot Water System Solar Diverter PCB pattern (PDF Download) [18110241] (Free)
  • Panel artwork for the Hot Water System Solar Diverter (Free)
Articles in this series:
  • Hot Water System Solar Diverter, part one (June 2025)
  • Hot Water System Solar Diverter, part one (June 2025)
  • Hot Water System Solar Diverter, part two (July 2025)
  • Hot Water System Solar Diverter, part two (July 2025)
Items relevant to "Low-cost electronic modules: 8×16 LED Matrix module":
  • 8x16 LED Matrix software (Free)
Articles in this series:
  • El Cheapo Modules From Asia - Part 1 (October 2016)
  • El Cheapo Modules From Asia - Part 1 (October 2016)
  • El Cheapo Modules From Asia - Part 2 (December 2016)
  • El Cheapo Modules From Asia - Part 2 (December 2016)
  • El Cheapo Modules From Asia - Part 3 (January 2017)
  • El Cheapo Modules From Asia - Part 3 (January 2017)
  • El Cheapo Modules from Asia - Part 4 (February 2017)
  • El Cheapo Modules from Asia - Part 4 (February 2017)
  • El Cheapo Modules, Part 5: LCD module with I²C (March 2017)
  • El Cheapo Modules, Part 5: LCD module with I²C (March 2017)
  • El Cheapo Modules, Part 6: Direct Digital Synthesiser (April 2017)
  • El Cheapo Modules, Part 6: Direct Digital Synthesiser (April 2017)
  • El Cheapo Modules, Part 7: LED Matrix displays (June 2017)
  • El Cheapo Modules, Part 7: LED Matrix displays (June 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 2018)
  • El Cheapo modules Part 19 – Arduino NFC Shield (September 2018)
  • El Cheapo modules Part 19 – Arduino NFC Shield (September 2018)
  • El cheapo modules, part 20: two tiny compass modules (November 2018)
  • El cheapo modules, part 20: two tiny compass modules (November 2018)
  • El cheapo modules, part 21: stamp-sized audio player (December 2018)
  • El cheapo modules, part 21: stamp-sized audio player (December 2018)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 2019)
  • Three I-O Expanders to give you more control! (November 2019)
  • Three I-O Expanders to give you more control! (November 2019)
  • El Cheapo modules: “Intelligent” 8x8 RGB LED Matrix (January 2020)
  • El Cheapo modules: “Intelligent” 8x8 RGB LED Matrix (January 2020)
  • El Cheapo modules: 8-channel USB Logic Analyser (February 2020)
  • El Cheapo modules: 8-channel USB Logic Analyser (February 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules (May 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules (May 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules, Part 2 (June 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules, Part 2 (June 2020)
  • El Cheapo Modules: Mini Digital Volt/Amp Panel Meters (December 2020)
  • El Cheapo Modules: Mini Digital Volt/Amp Panel Meters (December 2020)
  • El Cheapo Modules: Mini Digital AC Panel Meters (January 2021)
  • El Cheapo Modules: Mini Digital AC Panel Meters (January 2021)
  • El Cheapo Modules: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • A Gesture Recognition Module (March 2022)
  • A Gesture Recognition Module (March 2022)
  • Air Quality Sensors (May 2022)
  • Air Quality Sensors (May 2022)
  • MOS Air Quality Sensors (June 2022)
  • MOS Air Quality Sensors (June 2022)
  • PAS CO2 Air Quality Sensor (July 2022)
  • PAS CO2 Air Quality Sensor (July 2022)
  • Particulate Matter (PM) Sensors (November 2022)
  • Particulate Matter (PM) Sensors (November 2022)
  • Heart Rate Sensor Module (February 2023)
  • Heart Rate Sensor Module (February 2023)
  • UVM-30A UV Light Sensor (May 2023)
  • UVM-30A UV Light Sensor (May 2023)
  • VL6180X Rangefinding Module (July 2023)
  • VL6180X Rangefinding Module (July 2023)
  • pH Meter Module (September 2023)
  • pH Meter Module (September 2023)
  • 1.3in Monochrome OLED Display (October 2023)
  • 1.3in Monochrome OLED Display (October 2023)
  • 16-bit precision 4-input ADC (November 2023)
  • 16-bit precision 4-input ADC (November 2023)
  • 1-24V USB Power Supply (October 2024)
  • 1-24V USB Power Supply (October 2024)
  • 14-segment, 4-digit LED Display Modules (November 2024)
  • 14-segment, 4-digit LED Display Modules (November 2024)
  • 0.91-inch OLED Screen (November 2024)
  • 0.91-inch OLED Screen (November 2024)
  • The Quason VL6180X laser rangefinder module (January 2025)
  • The Quason VL6180X laser rangefinder module (January 2025)
  • TCS230 Colour Sensor (January 2025)
  • TCS230 Colour Sensor (January 2025)
  • Using Electronic Modules: 1-24V Adjustable USB Power Supply (February 2025)
  • Using Electronic Modules: 1-24V Adjustable USB Power Supply (February 2025)
  • Low-cost electronic modules: 8×16 LED Matrix module (July 2025)
  • Low-cost electronic modules: 8×16 LED Matrix module (July 2025)
Items relevant to "SSB Shortwave Receiver, part 2":
  • SSB Shortwave Receiver PCB set [CSE250202-3] (AUD $15.00)
  • SI5351A clock generator module (Component, AUD $7.50)
  • Micrometals Amidon T50-6 toroidal core (Component, AUD $5.00)
  • SMD transistor - BF998 12V 30mA dual-gate depletion-mode Mosfet (SOT-143) (Component, AUD $2.50)
  • 16x2 Alphanumeric module with blue backlight (Component, AUD $10.00)
  • SSB Shortwave Receiver front panel [CSE250204] (PCB, AUD $7.50)
  • SSB Shortwave Receiver firmware (CSE25020A) (Software, Free)
  • SSB Shortwave Receiver PCB patterns (PDF download) [CSE250202-3] (Free)
Articles in this series:
  • SSB Shortwave Receiver, part 1 (June 2025)
  • SSB Shortwave Receiver, part 1 (June 2025)
  • SSB Shortwave Receiver, part 2 (July 2025)
  • SSB Shortwave Receiver, part 2 (July 2025)

Purchase a printed copy of this issue for $13.00.

Hot Water System Solar Diverter Part 2 by Ray Berkelmans & John Clarke Solar-optimised hot water system (HWS) heating using power purely from excess solar generation Solar export data is obtained from the inverter and updated every five seconds Shows operational parameters on a 2.4inch OLED screen WiFi logging of operational parameters to a ThingSpeak database every five minutes Automatic override if the HWS temperature is still cold by the end of the solar day Night-time power-down Active heatsink cooling Email alert (one per day) if communication with the inverter is lost Over-the-air program updates via WiFi Manual override switch This HWS Solar Diverter, introduced last month, monitors the solar power available from a PV array and controls the hot water system to maximise the use of power that can’t be exported. It’s a lot less expensive to build than commercial equivalents. We’ll finish Background Image: construction, then get into setup and testing. unsplash.com/photos/sunset-view-5YWf-5hyZcw 62 Silicon Chip Australia's electronics magazine siliconchip.com.au T he first article last month explained how the Solar Diverter works and also provided the parts list and the majority of the PCB assembly instructions. At this stage, we have a mostly complete PCB, ready to install in the enclosure. There are still a few parts to fit, and some wiring to be done, before we can get to the testing and calibration stages. Enclosure cutouts Holes are required in the enclosure for the fan exhaust, air entry, PCB standoffs, one for the cable gland plus those for the conduit glands. Fig.4 shows the shapes of the fan cutout and mounting holes, plus the series of air entry holes required on the opposite end of the heatsink to allow air to enter and pass through the enclosure with fan assistance. The fan mounts unconventionally because the lid’s internal flange is thicker than the enclosure base. As a result, two of its mounting holes are on the lid and two are in the base. Thus, the circular cutout for the fan is made with the lid attached to the base, but without the Neoprene seal fitted. The hole can be made using a series of small (3mm) holes around the inside perimeter and then filed to shape. The difference in thickness is about that of an M3 nut and so the bottom screws for the fan simply pass through the lower mounting holes of the fan with a nut on each screw tightening to the inside base of the enclosure. They do not secure the fan but locate it in position. It is the top two screws that secure the fan to the lid once it is positioned on the base. To make this practical, the nuts need to be attached to the rear of the fan inline with the two top mounting holes. This can be done by gluing them to the back of the top two fan mounting holes using silicone sealant or epoxy resin. Alternatively, the nuts can be adhered by heating the nuts with a soldering iron sufficient to just melt the nuts into the fan plastic. It is not necessary to use a fan guard to protect against cutting fingers on the rotating fan blades, as the fan isn’t sufficiently powerful to cause injury. Heatsink temperature sensor Temperature sensor TS1 is held against the fin of the heatsink using a transistor mount clamp and secured with an M3 screw. You will need to drill a hole through the fins to gain access to the head of this screw. Make it large enough to allow a No.2 Phillips screwdriver to be inserted to tighten or loosen the securing screw. It is important that the heatsink is mounted so it is not too close to the leads of IC1 or the Triac. The minimum clearance is 6mm. The PCB screen printing shows the position for the heatsink, with a 45° diagonal cut at the lower right of the heatsink mounting flange. This may be required to provide clearance Fig.4: the cut-outs and holes required in the case. The rectangular cut-out in the lid is larger than the OLED screen but a bezel covers everything except the visible area. Note how the fan hole spans the lid and base; you need to clamp them together, without the waterproof sealing strip, before marking and cutting the hole. Warning: Mains Voltage This Solar Diverter operates directly from the 230V AC mains supply; contact with any live component is potentially lethal. Do not build it unless you are experienced working with mains voltages. A licenced electrician is also required to install the project. Do not power the PCB from AC mains while the serial cable is plugged into the PCB. Doing so is unsafe and could destroy the USB port on your computer, the computer and/or the Solar Diverter. siliconchip.com.au Australia's electronics magazine July 2025  63 between the heatsink & IC1’s current-­ carrying lead. The PCB screen printing also shows the positions for the heatsink’s lefthand mounting screws, the right-hand mounting screws (used in conjunction with IC1’s shield as described below), the Triac mounting hole and the heatsink Earth screw position. The top side of the heatsink surrounding the Earth hole needs to have the anodised coating scraped away to ensure the Earth lugs make good electrical contact with the heatsink. The Earth screw inserts from the underside of the PCB through the heatsink and is secured using a star washer and M4 nut. The Earth lugs mount over this and are secured with another star washer and another M4 nut. Insulating shields Three shields are used to cover exposed mains connections on the PCB, for OPTO1, IC1 and the mains input section. They are mounted on M3 tapped spacers. They could be made from fibreglass (eg, FR4) but we decided to use clear or translucent laser-cut acrylic as you can see through it. These laser-cut pieces, shown in Fig.5, will be available from our Online Shop, along with the PCB. The shield mounting for OPTO1 is straightforward, using 6.3mm spacers that are secured with 5mm-long M3 screws from the underside and similar screws plus washers on top. IC1’s shield is also pretty simple as it only has two mounting holes, both of which are held in place by the same screws used to attach the right-hand side of the heatsink to the PCB, with washers under the 15mm-long M3 screw heads and nuts between the shield and heatsink. Those screws are secured with two more M3 hex nuts on the underside of the PCB. The mains wiring shield is the largest one and uses 3mm-thick acrylic (the other two can be thinner, eg, 1.5mm or 2mm). We use 12mm-long screws from the underside to secure 6.3mm spacers to the PCB, then 12mm spacers are added onto the exposed screw threads. The shield is then held to the top of the 18.3mm (6.3mm + 12mm) spacers using M3 × 5mm machine screws through the top. Test-fit this, then remove it until the mains wiring is complete (see below). Low-voltage wiring The two DS18B20 temperature sensors need to be wired to connectors CON5 and CON6 for sensing the heatsink and water system temperatures, respectively. Both sensors are wired to plugs that plug into these two headers. The wiring lengths need to be sufficient to reach the heatsink (for TS1) and the water heater (for TS2) via the cable gland. Use heatshrink tubing around the DS18B20 leads to prevent them from shorting to anything. The LDR wiring also passes through the cable gland so the LDR itself is outside of the enclosure and thus can sense the ambient light level. Connections also need to be made for the fan power, to CON4. Make sure the fan’s red wire goes to the pin marked + on the PCB. The OLED screen also needs to be wired to a plug that fits into CON1. Take care with the pinout or you could damage the screen and note that some screens may have SCL and SDA swapped, or even VCC and GND! So Fig.5: the OLED bezel and shields. These will be available as a set, along with the PCB, pre-cut to the required shapes. The OLED bezel should be opaque (eg, black) while the others can be transparent or translucent. The mains wiring shield is made from thicker material as it is larger and thus needs to be stronger. 64 Silicon Chip Australia's electronics magazine you will need to check carefully and adjust the wiring to get the right signals to the right pins of the connector (they are labelled on the PCB). SCL is the clock signal for the OLED screen, while SDA is the data line. Display and bezel The display is mounted within a cutout in the enclosure’s lid, as per Fig.4. But note that this is to suit the particular OLED screen we used; they can vary in dimensions slightly, so check yours before cutting the hole. A front bezel covers everything except the OLED display area. The bezel dimensions are in Fig.5. Mains wiring The Solder Diverter needs fixed mains wiring, so you will have to get a licenced electrician to wire it between your water heater and its mains supply. We suggest you test it thoroughly and make sure everything is working (as much as you can test) before taking this step. First, run a 2.5mm2 red mains-rated wire between the A1 terminal of CON7 and the IP- terminal for CON8. The input and output wires should use mains-rated 2.5mm2 flat twin and Earth cable, with similar wiring for switch S2. S2 is the bypass switch, a 20A mains-rated switch in an IP66 housing. The wiring should be run within 20mm or 25mm conduit. Secure the shield over this wiring once the connections have been made. Software setup We will log our data to an online repository and graphing service called ThingSpeak (see Screen 1). If you don’t already have an account, navigate to https://thingspeak.com and open a free account. You can then set up one of your allocated channels with up to eight fields, as detailed in our September 2017 article on the Arduino ThingSpeak.com ESP8266 data logger by Bera Somnath (siliconchip.au/ Article/10804). We only need four fields for our data, and you can set them up as follows: • Field 1: HWS temperature • Field 2: H’sink temperature • Field 3: Excess solar • Field 4: HWS heating Note the “Write API key” on the ThingSpeak.com website, as you will need to include it in your Arduino sketch. siliconchip.com.au Screen 1: an example of the data that will be available on ThingSpeak after the HWS Solar Diverter has been running for a few days. We will also send ourselves an alert email if the solar diverter fails to connect to the inverter for longer than 15 minutes. Otherwise, if the inverter cannot be reached, we may end up with a cold shower! For this, we will use a free email service called PushingBox (www. pushingbox.com). There is no need to open an account if you already have a Google account. Once you log in, you will be taken to the Dashboard screen, where you will see an email “Service” already configured for you. You can edit this if you need to. From here, you need to create a “Scenario”, which will action our email alert. You could name it “Solar diverter status”. Enter a Subject (eg, “Solar Diverter”) and an email Body (eg, “The solar diverter cannot connect to the inverter. Time to check it out!”). That is it! Note the DeviceID key, which we will use in our Arduino sketches. You need the Arduino IDE installed with the ESP8266 Boards Manager to program the ESP8266 module. For details on how to do this, refer to the Silicon Chip article mentioned above, or Tim Blythman’s article on “The ‘Clayton’s’ GPS Time Source” in the April 2018 issue. The Arduino IDE is a free Heatshrink tubing should be used around the leads of the LDR (lightdependant resistor, above) and the DS18B20 temperature sensor (below). The side shot of the case shows the cutout required for the 40mm fan. siliconchip.com.au Australia's electronics magazine download from www.arduino.cc/en/ software The main program file for the solar diverter is “Solar_diverter_HWS_1reg. ino” or “Solar_diverter_HWS_2regs. ino”, depending on whether your inverter stores its export data in one or two registers. These sketches can be downloaded from siliconchip.au/ Shop/6/1835 First testing step There are quite a few elements to this sketch, which has over 600 lines of code, so it is worth testing and validating the software and hardware in parts. This helps in fault-finding/ debugging but will also promote understanding of the code. July 2025  65 Screen 2: these are some of the messages you may see on the Arduino Serial Monitor when running the “Test_ping_alarm_ Pushingbox_NTP.ino” test sketch. The first part to test is the Modbus communication with your router, as well as reading the temperature sensors and displaying the results on the OLED screen. The test sketch is called “Test_Modbus_temp_display_1reg. ino”. You will need to first install the “Modbus-esp8266” library by Alexander Emelianov for this to work. You also need the “OneWire” library by Paul Stoffregen, the “DallasTemperature” library by Miles Burton and the “U8g2” library by Oliver for the OLED screen. All are available through the Arduino Library Manager. Edit the sketch to include your WiFi credentials, as well as the IP address of your inverter, port number and the register address for your data previously determined using the “Modbus Poll” program. There is a separate test program called “Test_Modbus_ temp_display_2regs.ino” if you have an inverter that holds its export data in two registers. To program the raw ESP8266 chip, select the board type as “Generic ESP8266 Module” and attach a USBto-serial converter to the PROG header on the PCB, with Rx of the serial converter connected to the Tx pin on the PCB, and the serial converter Tx pin to the PCB Rx pin. You also need to put a jumper on JP1 because the ESP needs the IO0 pin held LOW to put it in programming mode. Power the PCB from a 5V DC power source connected to CON3, being very careful to wire it up with the correct polarity. There is no reverse polarity protection! A 3.7V Li-ion battery will suffice for this, although a 66 Silicon Chip current-limited bench supply would be better. Don’t be tempted to power it from the mains just yet! With the board powered up, press tactile switch S1 to boot the ESP in programming mode. You will see a short blink of the blue on-board LED as it boots. Ensure both temperature sensors are plugged in and upload the code. Once the code is uploaded, open the Arduino Serial Monitor, remove the jumper from JP1 and press S1 again. This runs the sketch. You should see the display light up with “Connecting to WiFi...”, followed by “Connected to <IP Address>” once connected. You should then see the HWS and heatsink temperatures on the screen, as well as the solar power you are currently exporting or importing. If you don’t see anything on the screen, check the wiring on the display and the JST connector. If these appear OK, it is worth installing one of the I2C scanner libraries through the Arduino Library Manager to see if both the OLED and the ADS1115 ADC addresses can be found. The OLED should be found at 0x3C, and the ADC at 0x48. If either is missing, check for solder bridges and trace-test your connections. If you see the ESP log into your WiFi but then reboot immediately afterwards, check that both temperature sensors are plugged in. If so, check the wiring at the temperature sensor end and the JST connector end. If it seems to work, switch a load on in your house (eg, an electric jug/kettle) and verify that your solar export Australia's electronics magazine drops dramatically. Conversely, your import power will increase dramatically. Hold your hand on each of the temperature sensors in turn, and work out which is which. If the heatsink and HWS temperature sensors are the wrong way around, change the line of code in the getTemps function from: “DS18B20.getTempCByIndex(0)” to “DS18B20.getTempCByIndex(1)” and vice versa for the second sensor. Physically swapping the sensors between sockets won’t do it as they are distinguished by their fixed internal IDs. Second testing step For the next test, use the sketch named “Test_ping_alarm_Pushingbox_NTP.ino”. This will ping your inverter IP address and, if there is no response after three tries, it will send a message to PushingBox, which will send an email alert to you. It will also query a Network Time Protocol (NTP) server to fetch the current time. We need this in our main sketch to override the solar diverter when solar conditions are poor and when the HWS is below 50°C after 3:30pm. Full power will then be provided to the HWS for 2.5 hours. Those parameters can be adjusted to suit your needs, of course, but it has worked well for us. Aside from the standard Arduino libraries, you also need to install “NTPClient” by Fabrice Weinberg, the “Time” library by Paul Stoffregen, and the “ESP8266-ping” library by Alessio Leoncini, for pinging the inverter. Edit this sketch to include your WiFi credentials, your PushingBox Device siliconchip.com.au ID and your inverter LAN IP address, then upload it. In the Arduino Serial Monitor, you will see if the ping is successful or not. It will also show the alarm count and whether an alarm message has been sent (see Screen 2). Hopefully, the pings are all successful so far. If not, check that you have the right IP address for your inverter. Assuming the pings were all successful, try changing the inverter IP address in the sketch to something that is definitely not listed in the client device list of your router and re-upload the sketch. Now watch the unsuccessful pings in the serial monitor. The alarm count should increase to three before an alarm message is sent via PushingBox. Check that you receive the email. After that, cut power to the unit to avoid many alarm messages arriving. In the main Solar Diverter sketch, there is a flag that is set once an alarm message is sent, and this is only cleared on power up (or after waking from sleep), effectively limiting the messages to one per day. At this point, it is advisable to log into your router and change the LAN IP address of your inverter from dynamic (DHCP) to “Fixed”. We don’t want this to change each time the inverter starts up or our pings will fail incorrectly. can get it). For example, if the offset variable in software is 0.18 and the current reading with no load attached is 0.45A, add 0.45 to the offset variable, making it 0.63 (0.18 + 0.45). In the Arduino IDE under Tools → Port, you will now see a network port named something like “SolarDiverter at 192.168.50.180 (Generic ESP8266 Module)”. If you select this network port, you can perform sketch updates (upload) over the air (OTA). Try sending your updated sketch OTA. Note that you will no longer have access to the serial monitor output. Testing the mains switching Assuming the OTA upload worked, you are now ready to connect some wiring to test boiling a jug of water. First, double-­ check your existing wiring and the component orientation on the board. Place the PCB inside the enclosure and secure it with machine screws. Make sure the DC power source is removed and the serial cable is disconnected. Find an extension cord you can cut in half and use for temporary AC mains input and output connections. From the plug end (input), run the Active wire (brown) to the free terminal on CON7, Neutral (blue) to one terminal on CON9 and the Earth wire (green/yellow striped) with a crimped eyelet to the heatsink Earthing screw. Do the same for the wires on the socket end (output): Active (brown) to the ACTIVE OUT terminal on CON8, Third testing step The third part of testing involves checking the mains switching, current measurement and over-the-air (OTA) programming features. If you were powering the PCB by a battery in the preceding parts, you will need to change to a 5V DC source. With the PCB powered from a 5V DC source, measure the voltage at the current sensing ADC (IC2) at test point TP4. This voltage value is used in our sketch to calculate the HWS current. Enter this value in the variable “maxADCVolt” in the “Test_Accurrent_measurement_PWM_OTA.ino” sketch, along with your WiFi credentials. Set the PWM duty cycle to 100% and upload it. Check the amperage output on the serial monitor and the OLED screen, and adjust the “offset” variable so that the measured current with no load is close to zero. To do this, simply add or subtract the amount necessary to bring the measured current to zero (or as close as you siliconchip.com.au This photo shows the finished HWS Diverter in the case without the larger acrylic shield from Fig.5. July 2025  67 Neutral (blue) to CON9 and Earth to the same heatsink screw. Also check that the 2.5mm2 red wire is running from the A1 terminal on CON7 to the IP– terminal on CON8. Attach the enclosure lid, then plug an electric jug filled with water into the extension cord socket. Plug the AC input plug into a GPO and switch it on. You should see the display light up with “Connecting to <YourSSID>”, followed by the LAN IP address when connected, and finally, the current draw of your electric jug. If there is a switch on the jug, activate it and watch the current shoot up to 8.5A, or whatever the rating of your jug is. If you have a current clamp meter, you can calibrate the display output by carefully exposing an Active or Neutral wire (with the power off) and clamping the jaws around the wire. Adjust the “mVperAmp” variable to roughly match the current displayed on the clamp meter. The easiest way to adjust it is to multiply the existing value by the proportion necessary to make it read the same as the reference (clamp meter) current. For example, if the mVperAmp variable in software is 48.5 and a water jug being heated shows as 10.4A, but the clamp meter measures it as 8.5A, you would increase the mVperAmp variable to 59.3 (10.4 ÷ 8.5 × 48.5). Note that a larger mVperAmp value will reduce the current shown since it is used in the equation denominator. After making that change, re-upload the sketch OTA and check that the display roughly matches the clamp meter reading. Now adjust the “pc” variable in the sketch to vary the PWM duty cycle percentage to a lower value and re-upload the sketch OTA. Your jug current draw should be reduced proportionally; the jug will heat slower, and the light may dim or flicker. When the duty cycle is low (say below 20%), the OLED will occasionally display zero for the current draw. This is normal because it is actually quite tricky to display a pulsing current value. If you glance at your clamp meter, you will see that it is all over the place. With a load of 8A and duty cycle of, say, 25%, the current is delivered as 8A, 0A, 0A, 0A, 8A, 0A etc. So, even though we are measuring our current for a full two seconds (100 cycles), the chances of sampling a zero is quite high at low duty cycles. There is no way around it other than sampling for even longer, but that would make our program update slower than it already does. Since it is only for a visual indication of current flowing to the load, we think this is an acceptable compromise. Final testing With it passing all tests so far, it is time to upload the final sketch, which is named “Solar_diverter_HWS_1reg. ino” or “Solar_diverter_HWS_2regs. ino”. Do this over the air. The complete sketch integrates all the components you have tested above and adds a few more, such as sending the data to ThingSpeak every five minutes, using the LDR to check for daylight, the automatic override if the The HWS Diverter mounted on to a wall with the acrylic cover to protect it from rain etc. A licensed electrician is required to wire the Diverter up, so make sure to properly test it before calling one in. 68 Silicon Chip Australia's electronics magazine siliconchip.com.au water temperature is below 50°C at 3:30pm, and active heatsink cooling. Before you upload the sketch, copy your WiFi credentials and all the other parameters you have used in testing to it, including: • your PushingBox DeviceID; • the Modbus register and port; • your inverter LAN IP address; • your solar diverter LAN IP address; • your current measurement calibration details (mVperAmp, max­ ADCVolt and offset). You will also need to enter your ThingSpeak API key and Channel number. Run this sketch for a while and verify that all the components are working, and that figures are being uploaded to the ThingSpeak website. If there is a hiccup somewhere, go back to the relevant test sketch and isolate the issue. Make sure you disconnect the AC mains and revert to a 5V DC power supply if you need to poke around on the PCB. Installation & commissioning As mentioned earlier, you will need a licensed electrician for the final installation of the Solar Diverter. This will involve fixing the enclosure to the wall near the HWS. Since the enclosure does not have any flanges, you might like to make some using two 100mm PVC square down-pipe straps. Simply cut the middle (horizontal) section out and glue the sides to the sides of the enclosure. Alternatively, the enclosure has wall-mounting holes in the corners that are outside the weather seal, so you can remove the lid, mark out the four holes, drill them in the wall and mount it using screws. Talk to your electrician about adding a 20A isolation switch near the enclosure. This makes it handy to de-power or reboot the system. You can run the HWS temp sensor to the PRT valve on your HWS and add some extra lagging for insulation. Waterproofing Assuming your enclosure and HWS are not indoors but under the eaves of your house, you should add an acrylic cover as shown in the photo opposite. This will prevent driving rain from entering the penetrations in your enclosure. The cover is made from a 3mm-thick acrylic sheet, 340 × 307mm siliconchip.com.au Fig.6: if the Solar Diverter will be exposed to wind-driven rain (eg, under the eaves of a house), it must be covered with something like this acrylic shield to prevent water from entering the ventilation holes. Cut the acrylic sheet as shown, then heat it to make the bends on a former like a piece of straight timber. in size, cut and bent according to the template in Fig.6. You can bend the acrylic using a hot air gun on maximum setting, moving it continuously along the bend line. It helps to clamp the piece to a sharp edge to bend it over. Once the acrylic is soft and starts to droop, use a piece of timber to push the hot acrylic along the bend line into position. Use outdoor silicone sealant to fill the gaps in the joins. Final calibration Once it is all installed, you might like to perform a final calibration of the current sensor under the full load of your HWS element. With power to the HWS switched off, attach a clamp meter around the Active at the HWS. Power the system up and send a sketch update OTA with the duty cycle set to 100% and the time set to your current time in the section near the top of the Loop titled “// In case of poor solar conditions”. Assuming your HWS isn’t already up to temperature, this will supply the full ~15A rated power to the element. Read off what your clamp meter Australia's electronics magazine reads and adjust the “mVperAmp” variable in the sketch to suit. Re-­ upload the sketch OTA and check again. Once the current measurement is reading correctly, reset the override time in the sketch to 3:30pm or whatever time you’d like to have your HWS heating on a poor solar day. Conclusion This circuit is essentially quite simple and comprises a WiFi-connected microcontroller, two temperature sensors and the power control circuitry (zero-crossing opto-isolator and Triac) and not much more. The OLED screen, current sensing and the ThingSpeak data logging are nice add-ons but not strictly necessary. The secret sauce is in the software, reading the exported power from the inverter and using that to adjust the mains-controlling PWM duty cycle. There is also the email alert function in case the inverter can’t be reached. If you take your time and work through the test sketches, we are sure you will get to grips with the software very quickly. Enjoy the savings from using more of your own solar power! SC July 2025  69