A windvane for the BeagleBone Green/Black

Usage no npm install needed!

<script type="module">
  import beagleboneWindvane from '';


BeagleBone WindVane

This project documents how to construct a wind vane using a BeagleBone Green or Black, a 3-axis digital compass and an anemometer. It's entirely written in JavaScript.


git clone
cd beaglebone-windvane
npm install .

Running the code

node index.js

All the constants are described in index.js.

Building the device

I use the HMC5883L compass, as available from SeeedStudio. It comes with Grove connector, so connects directly with the BeagleBone Green, however, you can also connect this to the BeagleBone Black.

The anemometer has a range from 0.4 (at rest) to 2V (high wind) and presumably it's linear in between. The maximum the BeagleBone Black/Green can handle for an input voltage is 1.8V. This means that you will need to create a voltage divider to reduce the voltage. I used two 1 k-Ohm resistors. Below is a schematic of the connected anemometer. One issue I found with this anemometer is that it can take a short while (one or two seconds) to register an increase in wind speed, and a very long time (around 7 to 10 seconds) to register a decrease in wind speed.

Connections to BeagleBone:

  • Blue Wire: AIN4 (P9_33)
  • Black Wire: GND_ADC (P9_34)