Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Near Real-Time Windspeed Tests. Part 4 - Displaying Wind Speed on OLED
#1

Following on from Part 3 (DIY anemometer build), the real time (OPL550A) output of this anemometer, having been sent down 30 meters of cable, is turned into a wind speed by an Atmega328, sent wirelessly via two NRF224L01 2.4GHz transceivers, and displayed on a 0.96" OLED screen as a scrolling graph.

As mentioned in Part 3, if counting all logic transitions (both high to low, and low to high) on its output, the DIY anemometer has a 0.5 mph resolution at all wind speeds in a 0.33 second gate measuring period. An Atmega328 counts the total number of 50% duty cycle logic transitions in a 0.33 second gate period, converts it to a wind speed, and immediately transmits this via a 2.4GHz NRF24L01 transceiver. The NRF24L01 can be configured in software as either a transmitter or receiver, and was used so as to not interfere with the 433MHz band, which, as the transmissions are very frequent (3Hz) could of interfered with other 433MHz signals I have being sent. A second NRF24L01 connected to an Atmega328 receives this wind speed and turns it into an analog voltage with the help of a simple RC low pass filter on the output of one of the Atmega328 pins - 5V corresponding to a 100 mph wind speed, and 0V corresponding to a 0 mph wind speed. (The wind speed was turned into an analog voltage to also easily interface to an existing analog input bargraph display). These cheap NRF24L01 transceivers consume about 13mA of current, and testing showed reception was ok over a 10 meter range and through 2 walls. 10 meters may well be approaching the limit of reception for these lower power transceivers, although there are other higher power NRF24L01 versions on the web (eg, Ebay, AliExpress) with ranges 10x further or more. The analog wind speed output from the Atmega328 receiver is fed into the analog input of another Atmega328 linked to a 0.96" SSD1306 OLED from Ebay.

Currently the test firmware displays an auto-scaling scrolling wind speed graph on the (128x64 pixel) OLED updated every 0.33 secs, so the graph spans 26 secs in time, although this is easily changed. A switch linked to the Atmega328 selects whether a line (non-filled) or a bar (filled) style graph is displayed. With OLEDs having a finite lifespan, a second switch linked to the Atmega328 blanks the display by drawing a black graph on a black background. This enables the graph data to be retained (assuming power is still available) so that when the display is turned back on (drawing a white graph on a black background) the historical graph is instantly displayed, without having to be built up again from scratch.


Snapshot of wind speed on OLED showing both line and bar graph options (number in box is current wind speed):

[Image: 62b36e859850474.JPG]

Video of initial test setup showing NRF24L01 receiver and OLED display (flashing red LED on far left at video begining indicates successful RF reception every 0.33 secs):

With my coding skills being virtually non-existent, the Atmega328 (linked to OLED) test firmware is just a slightly modified version taken from the link I've mentioned in the description section (under the video) of the above YouTube link - have to go to YouTube site itself. (forum won't allow 2 video links here)

Another video showing line and bar graph options, together with screen blanking is also linked in the description of the above YouTube video.


If anyone wants it I've attached in the 'circuit-and-code.zip' file the NRF24L01 transmitter and receiver circuit/firmware, together with the circuit/firmware for the OLED display. Sorry about the quality of the circuit diagrams - they're hand drawn.


Circuits and code:
https://www.dropbox.com/s/i5s3f39o3z9psy...e.zip?dl=0
(click 'download' at top right after page loads)


I'd be interested to know, hypothetically speaking, whether it would be possible to include a near real time scrolling wind speed graph option on the ILI9341 TFT display of the Weatherduino receiver with the current hardware? Werk maybe? (I realise the wind speed updates may well be every few seconds as opposed to sub second updates)

Part 5 will interface the anemometer output to a Raspberry Pi in order to stream the wind speed via websockets so that PCs/smartphones/Tablets on the same internal network, or even the WWW can display a scrolling wind speed graph through a web browser interface.
Reply




Users browsing this thread: 1 Guest(s)