Variable Speed Fan

I follow ‘Speak to the Geek’ on YouTube and one of his projects was to control the speed of a fan based on temperature, this blog is how mine ended up.

Full credit goes to ‘Speak to the Geek’ and his homepage where a full description of parts and build are HERE.

The reason this tweaked my interest was to try and maintain a steady temperature in my home IT cabinet and it works with Home Assistant.

My current cooling arrangement has fans which simply trigger on high temperature, hopefully this will smooth out the ‘on – offs’.

I had a spare ‘Room Sensor Enclosure‘ which I bought from The Pi Hut which everything managed to fit inside.

The 120mm fan will turn on at 28oC at a preconfigured speed of 25%, as the temperature increases, so will the fan speed, reaching full speed at 31oC.

So far it is working perfectly 🙂

Automatic Water Dog Bowl – Excessive Water Protection

Last updated – 8 August 2025

I have a automatic filling water bowl for the dog community in the area which is very popular, (Facebook Link), the water is fed by an 8mm pipe to the bowls float system and works really well, the problem I’m trying to stop is excessive water use, typically if the filling feed pipe becomes detached and goes unnoticed leading to wasting water.

My idea is to use a latching solenoid valve and flow meter linked to a Shelly Uni Plus with automation controlled by Home Assistant.

In normal operation the valve would be open and the flow to the bowl monitored, (the bowl takes 2.8 litres to fill from empty), should the flow exceed 5 litres, indicating excessive use, the solenoid valve will be pulsed by the Shelly Uni Plus and the flow turned off, if this occurs a message will be sent to my mobile.

Water controller on bench testing.
Underside of the controller board. 28 July 25, flow sensor 5v derived from the DC/DC converter directly.

The flow sensor used is a YF-B1 bought from Aliexpress, the instructions said that 660 pulses = 1 litre, to calibrate this for the doggie bowl, I measured 2.8L into a bucket and the count was 1535, adjusting the expression value to x/550 until it read 2.79l, which is near enough!

The Shelly Uni Plus requires an ‘active low level’ pulse to trigger to register a count, the user guide quotes a trigger voltage of 1.5v, the flow sensor is powered from the 5v side of the DC/DC converter and works fine on the test rig.

Test setup with mains pressure water feeding into the solenoid in the open state but with the valve at the end of the pipe closed, once all previous counts on the shelly were reset to zero, I opened the manual valve and filled the measuring jugs (2.8l), this gave me the counts recorded value.

Front cover laminated and stuck on with double-sided tape, all holes sealed with silicone sealant to try and keep the lamination in tact.

The above is a screenshot of the Shelly Cloud website displaying my Shelly Uni Plus, the ‘Count’ input was used for the flow meter and each of the two Shelly outputs were assigned as ‘ON’ Pulse and ‘OFF’ Pulse.

The latching solenoid valve requires a 30 millisecond pulse of 5v to latch open, reversing the polarity and applying another 30 millisecond pulse will close the valve, the Shelly has this feature built in.

I used a L298N Motor Driver Module to receive the Shelly output pulses and invert them as required.

The L298N was fed with 5v with the switching inputs going to pins IN1 & IN2, (IN1 & IN3 linked as were IN2 & IN4), this was done to get two mirrored outputs from the L298N.

One of the 5v pulsed outputs from the L298N goes to a latching relay, this enables a visual indication of the status of the solenoid valve via an LED, whilst the other 5v pulsed output goes directly to the solenoid valve.

Automation

Within the Shelly App is ‘Counts Custom Expression’ which for my flow meter is x/550 with the expression unit being l (litres) for a volume of 2.8L which is a complete refill of the doggie bowl.

Home Assistant integrates with Shelly and shows the counter as either a counter value in Litres (set up above), and actual pulses recorded, both of these are cumulative values.

For my purposes I want the open solenoid fill valve to close once 5 litres have pasted through the flow meter in 24 hrs, indicating excessive use.

In order to get the counter value to reset at midnight, I used a Helper and defined the counter entity as a Utility-Meter with a daily reset time and renamed this as Bowl Water Used.

Within Automations, the rule is –

  • When Bowl Water Used is above 5 litres
  • Then Turn Off fill bowl & send mobile notification

Completed Project

Unit plumbed in and 12v power getting connected, another 12v connection is opposite the inlet for future use.

I fitted a perspex divider between the water side and electronics to reduce any damage in the event of a leak, if any water does accumulate, the box has drain holes drilled in the rear of the box and a ‘tell tail’ clear grommet.

Green LED indicates if solenoid valve is latched open, local control of the valve is via the pushbuttons. On the feedpipe to the doggie bowl a drain down/test point is fitted.

To limit rain getting on the control box, I’ve made a small wooden overhang, the enclosure is IP65 rated but I’m trying to keep water from getting into the laminated front panel details.

My Home Assistant display shows the valve position and water used, it is also possible to manually operate the solenoid valve from the dashboard.

Doggie bowl dashboard

Observation

When I emptied the bowl to clean it, the float valve operates to refill the bowl, however, water volume recording is ‘hit and miss’, I’m putting this down to the bowls float valve not being fully open, restricting the flow volume though the sensor leading to detection errors, however, opening the test point into a bucket at full bore, approximately 6 liters flows before the automation closes the solenoid valve to prevent water being wasted which is the main function of this project.