Showing posts with label wine. Show all posts
Showing posts with label wine. Show all posts

Friday, November 20, 2020

WiFi vs LoRa for Fermentation measurement brewing applications



Timeline/Contact

November 2020 
Mark Troyer, Utrecht, The Netherlands
mtroyer@gmail.com 

Introduction


Anyone brewing beer, apple cider or wine knows the importance of monitoring temperature and specific gravity to determine the progress of the fermentation process. Generally speaking, temperature determines the speed at which fermentation takes place while specific gravity determines the relative sugar content of the fermenting product. For hobbyist brewers, there are several creative open source and proprietary Internet-of-Things (IoT) solutions that allow these temperature and hydrometer measurements to be logged and graphed over time. This data can be used to detect stalled fermentations or the optimal time to stop the fermentation process proceeding to racking or bottling of the given product. 

Some of these products include the iSpindle open source project as well as finished products such as the Tilt or the Float Hydrometer. All of these solutions use 2.4GHz Wifi to communicate temperature and hydrometer information up to a cloud-based management tool such as Google sheets or Brewfather. For most brewers with good WiFi coverage using plastic fermentation vessels, these solutions work fine. There are however occasional issues with 2.4GHz WiFi including the following:

  • WiFi does not perform reliably if the device positioning in the fermenting liquid product is too far from the WiFI Access Point. This is a result of Wifi having limited reach and not performing well around water. 
  • Those using thick high quality stainless steel fermentation vessels such as the Kegland kegmenter may need to place a WIfi repeater or access point within 50cm of the stainless steel fermentation vessels for the Wifi signal to be reached. 
  • Finally, WiFi tends to be power hungry and will consume a 2000MAh battery very quickly potentially requiring batter recharges for longer fermentations going beyond a few weeks with regular hourly temperature and hydrometer readings. 

Hypothesis


How might other radio technologies perform for this use case application? Some of the obvious alternatives include Bluetooth, Zigbee or LoRa. All of these are low cost with development and hobbyist modules available at a low cost with stable and rich development tools. 

LoRa radio technology is a mature and low cost alternative engineered with low-power IoT measurement-taking applications in mind. It has many available tool sets based on open source routing platforms such as The Things Network. The LoRa technology has the advantage of working at much lower frequencies (433 and 866/915MHz ISM bands) compared to Bluetooth and Zigbee that work on the 2.4GHz ISM band. 

Testing Process


In performing a Google search on how Wifi and LoRa performance compares in environments where water and stainless steel are found, little conclusive information can currently be found for brewing environments. With this in mind, it made sense to perform a simple set of tests with Wifi and LoRa in common brewing scenario. The working theory is that an 868Mhz LoRa-based iSPindle-like device would be much more performant than a 2.4 GHz WiFi device. Is there a need for an iSPindle version that supports LoRa radio technology? 

 In order to determine if this working theory is correct, a series of 16 tests has been imagined with the following structure: 

At 10 and 100 meters, test the radio signal being reached in the following environments:
  • Device floating in water 
  • Device submersed in 10cm of water 
  • Device placed in a stainless-steel vessel without water 
  • Device placed in a stainless-steel vessel submersed in 10cm of water 

Test Environment

The testing environment consisted of items that were all on hand that would most accurately simulate an amature or low volume brewing operation.   For the WiFi test, a consumer grade ASUS AC1900 WiFi router was used. 

Asus Wifi Router - AC1900
Higher quality consumer grade device

For LoRa testing, a Things Network Indoor Gateway was used. This device forwards LoRa traffic to the Things Network Cloud using a local WiFi connection.  The Things Network Indoor Gateway operates at 868MHz for European usage.  North American 915MHz versions are also available at a cost of $69 to $100.  This product includes an internal PCB LoRa antenna and seems to have a range of 5 to 10 times that of WiFi.  Using a full mast antenna of about 1M long, LoRa traffic can be received as far as 1.5 to 2 km away in urban environments.

The Things Network Indoor Gateway


The test device consists of a WeMos M1 mini development board based on the ESP8266 micro processor in addition to an RFM95 LoRa module connected via SPI. A simple Arduino application was written sending out 2 sensor values every 20 seconds first via WiFi then via LoRa. In all cases, the data was received  via MQTT. 

A Wemos D1 Mini module connected to an RFM95 transceiver board
The 18650 battery was the most expensive part of this test build!

.
Battery, Wemos and RMF95 board placed in a 
waterproof iSpindle PET vial.  Had to add additional coins
to fullysubmerse in water.




The following readily available house-hold kitchen tools were used as part of the testing.   For the submersion test, a glass pitcher of water was used in lieu of a fermentation vessel for reasons of mobility.
Glass pitcher with fully submerged WiFi/LoRa test device.

For the stainless-steel vessel, a Ninja Steam Pressure Cooker was used with the sealing lid attached. It is not clear if this would accurately simulate the conditions for a single or double wall stainless steel fermenter, but it would provide a relative indication on how WiFi and LoRa perform with metallic enclosures. 

We love our Ninja!  Yet another use case for IoT Testing.
 
Very skeptical that any signal will make it out of the Ninja
when full of water and steam pressure lid locked down. A Ninja Faraday Cage?

While the operating environment and specifications for these tests could be a lot more exact, these 16 tests quickly verified the theory that LoRa could potentially be more performant than WiFi for typical brewing environment use cases and applications.  

Test Results 
Distance/Condition 10 Meters 100 Meters
Device floating in water WFi: PASS 
LoRa: PASS
WFi: PASS 
LoRa: PASS
Device submersed in 10cm of water WFi: PASS 
LoRa: PASS
WFi: FAIL 
LoRa: PASS
Device placed in a stainless steel vessel without water WFi: PASS 
LoRa: PASS
WFi: FAIL 
LoRa: PASS
Device placed in a stainless steel vessel submersed in 10cm of water WFi: FAIL 
LoRa: PASS
WFi: FAIL
LoRa: PASS


The WiFi testing was inline with results encountered by many amature brewers using the iSpindle WiFi device.  It was a great surprise how the LoRa wireless technology performed.   Both submerged water and stainless steel environments did not prevent temperature and tilt measurements from reaching the Things Network cloud.   If would be interesting to characterize the outer limits of how far such a test device would be able to reach the Indoor LoRa gateway submerged both in water and in a stainless steel vessel.  More rigorous characterization testing is needed!   

Conclusions 


It is clear that the 868Mhz LoRa  technology is far more performant that 2.4GHz Wifi from a radio technology perspective for brewing environments. Both technologies allow limited sensor payloads to be continuously logged. Wifi has the disadvantage of working over shorter distances and is far more susceptible to interference with water and metallic objects commonly associated with brewing environments. As a technology, WiFi is over-engineered for simple data collection requirements with a lot more overhead for connection establishment, transmissions, etc. While these radio tests did not review power requirements, the accepted notion that LoRa requires 80-95% less battery power to transmit the same data as that of WiFi. Further current measurements and measurement count testing needs to be made to properly compare the two wireless technologies.  

Next steps 


Currently, I am re-designing a new Ispindle-like PCB which also includes a mounted RFM95 LoRa module in addition to a PCB antenna.  Today, there seems to be two reference PCBs for the iSpindle:  The CherryPhilip PCB4.0 and the Jeffrey PCB v2.1.   

The idea being that this device could be used in WiFi mode with the existing iSpindle firmware for calibration while also supporting data being sent only through LoRa and the Things Network. The final Gerber files will be available from a PCB manufacturer sometime in December 2020.  








WiFi vs LoRa for Fermentation measurement brewing applications

Timeline/Contact November 2020  Mark Troyer, Utrecht, The Netherlands mtroyer@gmail.com  Introduction Anyone brewing beer, apple cider or wi...