Close

Wind Direction and weighing gauge calibration

A project log for Long Range Weather Station (65€)

A cheap but precise Weather Station (Lora transmission)

jp-gleyzesJP Gleyzes 08/18/2023 at 12:270 Comments

Wind direction sensor

Calibration the wind direction sensor simply consists in telling him where is the north !

Indeed the magnet can be glued in any position on the shaft so the north pole is totally into a random position!

To calibrate the "north" we simply align the sensor to the "north" direction, then we press the touch3 pad on the ESP32 and reset the ESP32 (remove your finger from the touchpad after releasing the reset button). 

This touch pad( named TP1) is also in the bottom right corner of the PCB

Calibration is done by software and value is stored into the ESP32 flash memory.

It's straightforward and simple! 

 float angleValue = as5600.rawAngle() * AS5600_RAW_TO_DEGREES;
  if (touch3detected) //calibrate sensors
  {
    Serial.println ("calibrate anemometer");
    calibAngle = angleValue;
    preferences.putFloat("calibAngle", calibAngle);
  }

You don't even have to physically point the sensor to the north. Just align the sensor with the axis of the PVC pipe (opposite direction of the solar panel).

But you will have to align the solar panel to the south direction when fixing the weather station on the roof.

So, wind direction sensor should be calibrated in this position:


weighing gauge calibration

Calibration of a load cell is quite easy:

In my Weather station the zero offset is dynamically determined. The logic is simple :

The scle factor needs however a static calibration. It is done by weighing a know weight after having reseted the ESP32 while pressing the TP1 touch pad

 GetRawWeight();       //HX711 will sleep after weight acquisition
  if (touch3detected)
  {
    Serial.print ("calibration HX711... ");
    calib = CurrentRawWeight;
    Serial.println(CurrentRawWeight);
    preferences.putLong("calib", calib);
    emptyBucket();
  }

The "calib" parameter is stored into the ESP32 flash. This parameter coresponds to the raw value of a know weight which is "calibWeight". Note that this value is in tenth of grams. I do use a steel ball the weight of which being 33.5g...

Change this value to the weight of your calibration steel ball !

//scale
#define PIN_CLOCK  32        //output to generate clock on Hx711
#define PIN_DOUT   34        //input Dout from Hx711

long calibZero = 0;  //No load sensor Output
long calib = 130968;          //sensor output - calibZero for Weight calibration --> will be auto calibrated later
int calibWeight = 335;         //weight at which calibration is done --> expressed in gramsx10. eg 335 means 33.5g

So the procedure to calibrate the load cell is :

That's it


You should note that the same touchpad is used to calibrate both the load cell and the wind direction sensor.

Be sure you are into the calibration conditions of these two sensors while calibrating

Discussions