After way too long I finally got back to work on the Modern Device wind sensor data and calibration. I received some good news and some bad news for my efforts.
First lets review some of the problems. The Modern Device wind sensor works on heat, similar but not the same as, a hot wire anemometer. A thermistor is heated and maintained at a temperature 50 degrees C above ambient by an op amp control loop. When the wind blows, it cools off the sensor, which causes the sensor’s resistance to rise, which causes the voltage at the op amp output to rise. This raises the bridge voltage across the sensor, which in turn heats the sensor up more and lowers the voltage output from the op amp. To the sensor is in an equilibrium state whose voltage level depends on the wind speed.
So the voltage is related to the wind speed. But there are problems.
- The voltage is related to the square root (or some arbitrary root) of the wind speed, so it has a power relationship, not a linear one.
- Since the thermistor is maintained at a constant temperature, cold air, which cools the sensor faster, results in higher voltages than warm air. This can be compensated for in a number of ways, however the most simple method is just to determine the zero wind voltage at a particular temperature and subtract the zero wind voltage from the sensor reading. So it’s all done in software.
- The voltage at zero wind is not zero – after all the sensor has to heat the thermistor up above ambient to be able to measure the wind. So the relationship is a little more complicated. One way to state the relationship is that the sensed voltage minus the zero wind voltage is proportional to some root of wind speed.
I’ll get to more detail on the math and some charts later but first let me say that I needed to have the measurements of the temperature sensor at zero wind over a variety of temperatures. I had been working with the wind tunnel which has a heater to control temperature. The problem is that there really isn’t a way to maintain temperature with zero wind speed in the wind tunnel. After all, some airflow would be required to provide the correct temperature air to the sensor. The heater especially doesn’t like low air-flow, as one might imagine.
After thinking about this for a bit, the answer which occurred to me was deceptively simple. If I sealed the sensor up in a box with a temperature sensor and some freezer bags, I could just let the box get warmer, or colder, I could record zero wind values as the sensor passed temperature thresholds. Below are some images of my fairly jury rigged apparatus, which I affectionately named the coldbox. The box could look a lot more professional, but I figured zero wind was zero wind. The cardboard box was taped shut and the sensors were enclosed in another inverted box, to keep the box’s convection currents off the sensor. The final shot has some styrofoam packing material taped to it, for insulation.
The box was filled up with cold packs and allowed to cool off, then data was gathered as the box slowly warmed up either naturally or from the heater. Once the box was at room temperature – which has been averaging about 63 F in my office !?, I switched on the heater and let the box warm up, with the cold packs slowing things down with some thermal inertia. In any case, I performed the experiment a couple of times and the data tracked very closely each time. For a temperature sensor I used the temp421 sensor which we sell. The sensor is sensitive to 1/16th of a degree C and absolutely accurate to about 1 degree C.
The data I wished to gather were just two voltages. The voltage of the sensor at zero wind, and the voltage of the wind sensor’s thermistor output. Both of the these were gathered correlated with the temperature, over a wide temperature range. My coldbox data looked like this:
There were two sensors in the box so I have t1 & w1 for temp and wind from the first sensor and t2 & w2 for the second sensor. One thing you’ll notice right away is that the t1 & t2 (the thermistors on the wind sensors) track each other tighter than w1 & w2 do. This was a small revelation, but made perfect sense in that the temp thermistor is a 1% part, but I can only buy the wind-sensing thermistor with a tolerance of 3%.
Once I had the coldbox data (which covered the hot end of the range too), it was a pretty simple matter to let Excel chart the data. Then I just added trend lines and checked the “print formula” box and Excel dutifully spit out very nice equations for the correlations. I went for a second order polynomial trendline, and also printed the R^2 value, which ranges from 0.0 to 1.00, and gives one an idea about how well the polynomial fits. You can see by the number (.99977) that the fit is excellent.
I had never used these trendline features in Excel so it was lots of fun. I felt like Excel did all the drudge work for me and I just got to happily use the results. I also plotted the thermistor value against the zero wind values so it would be easy to generate the zero wind value from the thermistor values.
Again Excel just spit out the equation and I inputted it directly into an Arduino sketch. I’ll leave the rest of the math and the regressions for tomorrow’s post.
I will say that gathering data is a good way to characterize your hardware, and the sensor-to-sensor wind-speed differences we were seeing in individual wind sensor units was slightly disturbing to us. As an immediate fix, we priced out .1% resistors (we had been using 1% tolerance). Thanks to modern laser trimming the resistors turned out to be fairly affordable and available in the same footprint sizes as our current design. Surprisingly though, I couldn’t purchase a 1 ohm .1% resistor though in the size I needed so the value had to change to 2.21 ohms and another bridge resistor had to change ratiometrically.
Tomorrow – Fun with Regressions
For those of you who wish to get your hands on the Arduino calibration sketch, I uploaded it to our Github repository: https://github.com/moderndevice/Wind_Sensor.
The sensor is in the shop https://moderndevice.com/product/wind-sensor/