Skip to content

fguiet/windvane-v2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Solar powered, waterproof, full 3d printed, optical windvane Version 2

Foreword

This is the second version of my windvane.

First version still available here : https://github.com/fguiet/windvane

This one has 2 majors improvements:

  1. New waterproof top design

Now it includes nuts and bolt to tighten the shaft very hard.

top

  1. Use an optical method to encode

inside

How it works ?

inside

We are going to use an optical method, a perforated disk which rotates between leds and phototransistors. Each time a phototransistor is lighted by the opposite led, it becomes conductive. We associate bit 1 with the conductive state and bit 0 to the blocking state of each phototransistor.

We therefore need to arrange the phototransistors and the holes on the disk so that we can encode a maximum of positions in a minimum of space. It so happens that a given Bruce Spedding imagined a method, later improved by Alain P. Hiltgen and Kenneth G. Paterson, called "Single Track Gray Code". This method presents two noticeable features: first, generated codes differ only from one bit from one position to another. This is the principle of Gray codes, and this limits the risks of reading errors for intermediary positions. Second, the sensors are located on the same circular track, which enables us to build very compact encoders. The price to pay is that the number of codable positions is smaller than 2n. For example, with 5 phototransistors, we can encode only 30 positions. This provides a precision of 12°, which is largely enough when we need to determine wind direction.

Bill Of Material (BOM)

Electronic spare parts needed :

Wiring

Electronic datasheet is available, here : https://easyeda.com/fguiet/windvane-v2

ESP8266 shield

Careful : the "diode" in the middle should be removed...otherwise vcc is directly connected without going through the voltage regulator !

Minimal pin configuration

  • GPIO 15 : GROUND (the shield I am using has a 10k pull ground resistor build-in)
  • CH_PC / EN : +3.3v (the shield I am using has a 10k pull high resistor build-in)
  • GPIO0 : must be pull low to enter flash mode / must be pull high - I added a switch
  • GPIO0 : must be connect to RST pin so deep sleep can work (I added a switch)

3D Models

You can download STL files here : https://www.thingiverse.com/thing:4700240

Power consumption

  • Around 140 mA when reading (65 mA ESP8266 + 75 mA led + photoresistors negligeable...)
  • Around 140 uA when deep sleeping (I need to confirm that)
  • Around 66 mA when ESP8266 is on and led and phototransistor are OFF
  • Around ? when ESP8266 is on and led and phototransistor are OFF and module is connected to Wifi (I have to take this measure)

Reading baterry voltage

The device has a 10-bit ADC pin, which uses 0-1V range to convert the analog data to digital data. It may be used either to read voltage at ADC pin.

Powering the 5 LED

Using the HT7333-A low drop out voltage regultator. Maximum output 250mA, Dropout 90mV...Nice for a 3.7v lithium battery :) A 10 uF capacitor will be used to stabilize the output voltage.

Considering that one LED forward voltage is 2v and forward current is 20mA, we will need 5 resistors each of 69 Ohm (apply law Ohm here with 3.3v input voltage)

My Current Ranger reports a consumption of aournd 75-80mA ... 16mA per LED (we are not so far from the theory computed just above)

Powering the 5 TEPT440 phototransistors

TEPT440 is a phototransitor. Its sensibility ranges from 440 to 800 nm (peak at 570nm).

Programming the ESP8266

To program the ESP8266, use a standard USB to Serial converter.

  1. Pull GPIO0 low via the red button
  2. Connect the USB to Serial converter - Don't connect Serial convert Vcc but use external power (battery)
  3. Connect RST pin to ground (in order to enter flash/program mode)

Bibliography

Some pictures when I built this stuff

  • Led disk holder

led disc holder

  • Photoresistors holder

photoresistors holder

  • Measurement current consumption

Measurement current consumption

  • Optical encoder in place

Optical encoder in place

  • Assembled windvane and PCB ready to be connected

Assembled windvane and PCB ready to be connected

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages