CV7Lib is a lightweight Arduino library for reading wind speed, wind direction, and temperature from the CV7-OEM anemometer using serial (NMEA) communication.
- Download or clone this repository.
- Copy the
CV7Libfolder into your Arduinolibrariesdirectory. - Restart the Arduino IDE.
- Open:
File > Examples > BasicUsage > BasicUsage.ino - Upload to your ESP32 or other compatible board.
Wiring example between the CV7-OEM and an ESP32:
- CV7 TX → ESP32 RX (e.g. GPIO 16)
- CV7 GND → ESP32 GND
- CV7 VCC → 12V external power supply
#include <CV7.h>
#define RX_PIN 16
CV7 sensor(RX_PIN);
/**
* @brief Initializes the sensor and debug serial port.
*/
void setup() {
Serial.begin(115200);
sensor.initialize();
}
/**
* @brief Periodically reads sensor data and displays it.
*/
void loop() {
sensor.readFrame();
Serial.printf("Temperature : %.2f °C\n", sensor.getTemperature());
Serial.printf("Wind Speed : %.2f km/h\n", sensor.getWindSpeed());
Serial.printf("Wind Direction: %.2f °\n", sensor.getWindDirection());
Serial.println("--------------------------------------------------");
delay(2000);
}
