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:
Calibration of a load cell is quite easy:
- determine the zero offset "tare"
- substract the zero offset from the raw value and then linerly convert this value to weight
In my Weather station the zero offset is dynamically determined. The logic is simple :
- once a day empty the bucket --> get the zero offset
- if weight decreases, abnormal condition then empty the bucket --> get the zero offset
- if weight is too big then empty the bucket --> get the zero offset
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 :
- insert your steel ball into the bucket
- press the TP1 touchpad and hold your finger on it
- reset the ESP32
- release your finger
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
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.