Intro and idea

Why?

Maybe there’s not as much need as i perceive it, but as per my discussions with my friends Mrs. Pallavi and Prabhu it was clear that there are far few of rain data points available. Here are some of my perceptions (which one is free to check and prove otherwise) :

  • India’s IMD has a network but i suppose they report the data only at the end of a day or say every half a day. So data rate is too low to make a live map.
  • IMD network’s density is low. As per Prabhu (my friend from MSc days and currently at one of CDAC’s project leaders in Pune), the state of Sikkim has only one IMD sensor!! Similarly, the vast landscape with many terrain features make rain fall a very region specific thing, so rain data must be of higher geographic density than currently is the case.
  • Rain data is not available to the public for independent and parallel processing. It has to be received through IMD and one can only guess the difficult bureaucratic path. As discussed with Mr. Mayuresh Prabhune, an active citizen science torch bearer in Pune, one has to struggle for getting data from public funded institutions.

 

RainCloud

So the plan is to create such a system with following features:

  • Live streaming of rain fall data every 30 minutes, 24×7.
  • Live data plotted on an online geographic map, accessible to anyone, free of cost.
  • Data could be downloaded by anyone for further analysis, free of cost.
  • Cost of device should be low so that density could be increased. Also device should have long maintenance free life.

 

How to do it? – the science and engineering

The main issue with conventional rain guages that have online data reporting capability is the need of calibration. So if ours is to be better, then one must remove any moving parts from the design. So how to make a device that makes a measurement of rain and then empties itself without any moving par like valves, etc? – Enter the auto-siphon.

If you take a pipe (a PVC pipe in the following images) and a bendable straw (i used one from a TuttiFrutti mango drink), as seen in the images one make an auto-siphon.

Top view.
Side view

The white straw is sealed by the small hole (as compared to its own diameter) made in the PVC cap. When this piece is filled with water upto the level of the bend (1st image) then it auto-drains completely.

Conclusion: An auto-siphon designed in such a way as to drain everytime a fixed amount of rain has fallen.

So how to do the measurement?

  1. Every time a draining event happens, the water passes over two electrodes separated normally by an insulating air gap.
  2. One of the electrode is at a higher potential (5V) as compared to the other, so when water passes over (during draining) the second electrode gets a current from the first one.
  3. This is detected by a microcontroller as a digital signal and a counter is incremented. Thus each count signifies a predetermined amount of rain volume being emptied.
  4. The change in count per hour then corresponds to the rain rate/hour.
  5. The latest count value is transmitted by the microcontroller and associated GSM/GPRS circuit to a website.

Breathe2 V1.1

V1.1 was designed to fit into a cap of a PVC pipe and all this held upside down so that the cap is on top. The gaps in the PCB would allow the air sensor to get fresh air and so on. The PCB would have a dual task as a PCB and of keeping the components mounted on it from being exposed to external weather conditions.

A populated V1.1 board and its bottom with our name and version.

However, the biggest mistake (Subir’s) was the selection of the power supplies MP1584 (see the 5V written by hand on the left disc) which ran hot within a few minutes leading to resetting of the boards.

10 PCBs were made, some were populated, but due to the fundamental problem of power supply, all this had to be scrapped.

Some prototype pics

Some pics before the dryer apparatus was shifted to the Ameya’s (client) testing place – Vigyan Ashram, Pabal, Pune.

Over all prototype setup at SmallDesign.
The testing chamber. A loadcell (hidden behind the black bottom) measures the rate change in weight of the sample due to passage of hot air from left to right. 3 RH and T sensors monitor the air before, during and after the sample. Here a silly test sample of a solder coil (what else will you find in a workshop?) is kept.
Another view of the testing chamber.
PyQT based GUI showing all the current T and RH values running on a RPi 3B. Data collected from a SmallDAC V3 Universal Analog Input board.
Live graphs!
The green and red thingy in top is the SmallDAC V3 UAI board with 16 configurable channels. The remaining are just power supplies for the system.
Another view of the SmallDAC UAI board.
Power control box for controlling the air heaters, air blower and the logging unit.

V1 Costing

  Cost ( Indian Rupees)
  1st Prototype Batch production
Wemos D1 Mini (ESP8266) 400 320
Sensiron’s SPS30 4817 3475
Bosch’s BME280 762 610
SIM800 module 800 640
PCB 2000 667
Supporting Electronics 500 400
Power adapter (9V) 200 160
SIM card + 3 month recharge 509 509
Pipe Casing 450 360
Cloud costs / device 300
Online backup UPS   1600
labor charges 1000 500
Overheads, Workshop rents, etc 500
Sustainable minimal profits 1500
     
Total 11438 11540

So selling cost for trial runs could be about 10k (without UPS support) or 12k with UPS support for continuous running.

Prototype V1 (Created – 25th Apr 2019)

Inspired by Breathe device network of IndiaSpend.com

Aim:

Make a low cost but decent performance air quality monitoring device that can upload real-time data to the web for city-scale geographic analysis of air pollution.


Breathe2 Features:

 

Where is it installed:

For testing and calibration purposes Prototype1 has been installed about 10m away from the government’s SAFAR device situated at Indian Meteorological Department (IMD) Office (Shimla Office as known in Pune) at Shivajinagar, Pune.

Live data:

 

Physical structure overview

Challenges / next steps:

  • Verify if Particulate Matter (PM) data is similar to SAFAR data from Govt. of India.
  • See if device can withstand harsh external conditions such as thunderstorms, heat waves and dew condensation conditions.
  • See if device has repeatability over various environmental conditions.
  • Develop robust web-services for collection, analysis and public display of data.
  • Dream: Add a noise sensor to device.

 

Team:

  1. Abhijeet Savant
  2. Subir Bhaduri
  3. Mayuresh Kulkarni

SmallDAq V2 in an industrial panel!

The SmallDAq V2 was integrated with an industrial control panel which will monitor and control a jaggery unit designed and developed by our client Prof. V. Sardeshpande.

Here is the LCD monitor that displays all the process and gives access to the used to control various valves and pumps just by using mouse clicks. This frontend GUI and its backend python codes were all developed inhouse. PyQT5 was used for the GUI and www.draw.io for making the process illustration.

An inside view. Note the SmallDAq V2 (the green PCB thing). More cards and wiring will be added, hence the open wires on the right.

From the outside:

Multiple PT100 with ADS1115

[latexpage]
I wanted to readup multiple PT100 with high accuracy. The features are:

  1. Controlled current source using TL413 to avoid self-heating.
  2. 3 wire PT100 with wire resistance compensation.
  3. Ratiometric measurement.
  4. Amplification of signal to get good resolution – hence ADS1115.
  5. Multiplexing with HC4051.

I went through various designs, searched a lot over the internet but only found few references. Main question was – can the HC4051 be the right choice as a multiplexer. Also if TL431 will give stable current. The always helpful online community at Stack Exchange helped me immensely and directly. Here is my post and discussion over there. I modified the solutions and here is the currently adopted one. Designed in KiCAD.

So the way it goes is:

  1. A single TL431 (right top corner) supplies 1mA.
  2. This 1 mA is multiplexed by a 4051 – U3 on the schematic to the 8 PT100s. Since its a constant current source, the on resistance (Ron) of 4051 would not matter or change anything.
  3. I need to measure the input voltages of the 1st wire of the 3-wire (starting from top to bottom) PT100s. So another 4051 – U1 does that. Here, since i am only measuring the voltage using a high impedance ADS1115 (6 MOhm i read somewhere) there is no current flowing through the 4051 so no voltage drop, hence Ron is not important here too.
  4. Then the monitored 1mA current passes through the PT100 1st wire and can be sensed by the 2nd wire using another 4051. Again since there is no current passing due to high impedance inputs of ADS1115, no potential drop across Ron of 4015 is expected. The difference between the previous measurement (point 3) and this one gives me the potential drop across the wire for a constant current flow = wire resistance!
  5. Finally the 1mA passes through the PT100 and emerges onto a series of 100 ohm resistances. The potential drop across the top 100 ohm resistance is measured again. Since this 100 ohm resistance is 1% accuracy i can compute the current passing through accurately enough. So variations in the current source (TL431) can now be neglected. This also makes the whole thing ratiometric, as explained below.
  6. I didnt want to short the 4rth measurement terminal of the ADS1115 to the ground because of a fear that it would lead to ground loops. So i put in a 100 ohm resistor there. I am purely guessing over here. Maybe a higher resistance must be used than 100 ohm, but that should not overload the TL431 supply.

 

So how does one measure the PT100 after all the above steps? The above schematic is simplified here where a single PT100 interfaces the ADS1115. Note that Rwire is the resistance due to long PT100 wires and is an inherent part of the PT100. The ADS1115 has 4 analog inputs and has a special mode in which each of the 1st three – A0, A1, A2 can be measured differentially with A3. This is what we will use.

PT100 – ADS1115 interface for ratiometric measurement.

First we must measure the circuit excitation current $I_{ex}$ flowing through the circuit:

\begin{equation} \label{eq:Iex}
I_{ex} = \frac{V_{A_2-A_3}}{R_s}
\end{equation}

$R_s$ is a known value, in this cas of 100 $\ohm$. Secondly, the $R_{wire}$ can be deduced using following equation. Note that $I_{ex}$ is not passing through $R_{wire}$ of the wire leading to the A1 pin because A1 is high impedance.

\begin{equation} \label{eq:Rwire}
R_{wire} = \frac{V_{A_0-A_3} – V_{A_1-A_3}}{I_{ex}}
\end{equation}

Further, the relation between the voltages at A1 and A2 and the Pt100 can be put as:
\begin{equation} \label{eq:RwirePt100}
R_{wire} + R_{PT100} = \frac{V_{A_1-A_3} – V_{A2-A3}}{I_{ex}}
\end{equation}

Using eq.\ref{eq:Iex} and eq.\ref{eq:Rwire} in eq. \ref{eq:RwirePt100}, a simplified form emerges:

\begin{equation} \label{eq:Pt100}
R_{PT100} = \frac{2 \times V_{A_1-A_3} – V_{A2-A3} – V_{A1-A3} }{V_{A2-A3}} \times R_s
\end{equation}

Note that its a ratio of two voltage units, so bacically the 16bit raw outputs (CODE) of ADS1115 could be used:

\begin{equation} \label{eq:Pt100CODE}
R_{PT100} = \frac{2 \times CODE_{A_1-A_3} – CODE_{A2-A3} – CODE_{A1-A3} }{CODE_{A2-A3}} \times R_s
\end{equation}

Conversion to temperature is simple, and i have used an equation obtained from this excellent source:

RTD Calibration

and reproduced here.

\begin{equation} \label{eq:T}
T_{PT100} = -244.83 + R_{PT100} \times ( 2.3419 + 0.0010664 \times R_{PT100} )
\end{equation}

So far it works. Need to check this in the full range of 0-200 $\deg$C.

The circuit above has additional components to protect the inputs of ADS1115 as well as filter the input. The filter values have been shamelessly copied from other sources which im stupid enough to not remember or note anywhere, sorry.

 

Why SmallDAq V2?

Like SmallDAq V1, there is a growing need among scientific and student communities of a low cost data logging system with controller and human interface features. With the advent of low cost electronics, opensource systems and internet communities its now possible and obvious that such Data Acquisition systems are made available. Hence the SmallDAq V2.

Its features are:

  1. Modular construction – features could be added or subtracted by using different cards as per needed by the user.
  2. Raspberry Pi 3 B as the base computer.
  3. Human interface and interaction ready with any LCD screen with HDMI port and coupled with mouse and a keyboard.
  4. A 30cm long base board that holds the RPi and seven 2×20 pin ports for adding cards. An IDC cable connects the RPi to the board. Another IDC port available for further expansion. The board can be mounted on DIN rails.
  5. Currently developed cards:
    1. 8 ch PT100 interface using ADS1115.
    2. 8 ch 4-20ma / 0-10V interface using MCP3208.
    3. 8 ch Thermocouple  (K type) interface using MAX31855K.
    4. 16ch Digital inputs -3-30V optically isolated – using MCP23017.
    5. 16ch Digital outputs – 24V 500mA driving capability – using MCP23017.
SmallDAq V2.1 with monitor, keyboard and mouse.
SmallDAq V2.1

Currently being developed for two projects – for VentureCenter’s solar kitchen and another for Dr. Vishal Sardeshpande’s jaggery unit.