Jump to content

NLCbanner2024.jpg.2478be509670e60c2d6efd04834b8b47.jpg

Weather Station Ideas


Gina

Recommended Posts

41 minutes ago, Gina said:

It seems the ESP32 has programmable pull-up or pull-down internal resistors on most pins.  This may remove the need for external resistors.  I'm hoping this applies to the ADC inputs - I see it certainly applies to most digital inputs.  This makes reed switches more practical as they would only need connecting to ESP and Gnd.  9 connections total.  Another possibility might be Hall switches but more connections needed and they need power.

Yep - very flexible the IO on these controllers though be careful on which you use as some have alternative or special uses as well as standard IO (i.e. some are hardware interrupt capable or named pins for some drivers etc) 

I think reed switches win out on simplicity - either just a common ground or power and then the switched output back to the controller. Are you going to mount the controller with the wind sensors or remote from it? That might factor in thinking around if to bring back multi-core switched outputs or do something more elaborate to simplify return wires (i.e. bring back over parasitic one-wire, power and data combined to 2 core cable)

The advantage of resistive direction sensing is a reduced number of cores combing back to the controller, I then just scale the input to 360deg with 1 line of code.

Link to comment
Share on other sites

Reed switches (or Hall devices) would make for a smaller unit but the optical system would be more accurate with the angles preset in the Gray code disc.  Needs fewer connections to the ESP (4 rather than 8), decoding is simpler, no debouncing code required. 

If I changed the orientation of the optical sensing I could make the surfaces vertical and avoid dust settling.  I may also have an idea for reducing the size by not using a 3" (75mm) Gray code disc.  There is no particular advantage in using a single Gray code disc - with 3D printing it's no problem making 3 cylindrical code parts.

  • Like 1
Link to comment
Share on other sites

5 minutes ago, jiberjaber said:

Yep - very flexible the IO on these controllers though be careful on which you use as some have alternative or special uses as well as standard IO (i.e. some are hardware interrupt capable or named pins for some drivers etc) 

I think reed switches win out on simplicity - either just a common ground or power and then the switched output back to the controller. Are you going to mount the controller with the wind sensors or remote from it? That might factor in thinking around if to bring back multi-core switched outputs or do something more elaborate to simplify return wires (i.e. bring back over parasitic one-wire, power and data combined to 2 core cable)

The advantage of resistive direction sensing is a reduced number of cores combing back to the controller, I then just scale the input to 360deg with 1 line of code.

The ESP will be mounted in the same casing as the wind sensors so connections will be short.  Yes, I shall have to check which pins to use.

  • Like 1
Link to comment
Share on other sites

Just been checking the optical sensor again to see how well it works with a curved reflecting surface.  Didn't get very far.  I found the photo transistor responded to daylight and the collector saturated with 0.16v.  Shading from daylight let the voltage rise a bit but not enough.  The phototransistors are supposed to have filtering to exclude daylight.  I'll try again with a smaller pull-up resistor.

Using two diode volt drops gives 2.3v (3 gave 3.6v) with 10mA.  Half way would be well adequate voltage change for ADC input so if I get 0.5mA collector current from the reflective surface the PU resistor value becomes 1.2v @ 0.5mA = 2.4K.  2K2 will do - that'll give a volt.

Edited by Gina
Link to comment
Share on other sites

New test result:-  Collector still saturates to 0.16v with a curved white PLA reflector at around 3mm and goes up to 0.6v without it - more if shaded from the light coming in through the window.  Think it wants a lower value pull-up resistor.  I'll try 1K.

Link to comment
Share on other sites

Latest test result with 1K pull-up resistor to 2.3v gave 1.3v and 0.3v at the collector.  This seems to be optimal but shielding the sensors from daylight will be essential unless I use another optical sensor as a reference but this is definitely dodgy!

  • Like 1
Link to comment
Share on other sites

Hmmm...  A problem with optical then!  Can I make the inside of the casing dark enough???  At least reed switches and Hall devices don't respond to the earth's magnetic field.

  • Like 1
Link to comment
Share on other sites

The ESP8266 only has one ADC so it has to be the ESP32 if I want to use the optical sensing.  Otherwise if I want to use the ESP8266 I have on order it will have to be magnetic.  That's reed switches or Hall devices.  Reed switches are easier to mount and easier to connect and need no power supply, connecting directly to the ESP with pull-up resistors enabled on those pins.  My only real query with reed switches is reliability and longevity being mechanical.

Link to comment
Share on other sites

2 minutes ago, Gina said:

The ESP8266 only has one ADC so it has to be the ESP32 if I want to use the optical sensing.  Otherwise if I want to use the ESP8266 I have on order it will have to be magnetic.  That's reed switches or Hall devices.  Reed switches are easier to mount and easier to connect and need no power supply, connecting directly to the ESP with pull-up resistors enabled on those pins.  My only real query with reed switches is reliability and longevity being mechanical.

I think the reed switches will out survive the enclosure they are in

Link to comment
Share on other sites

My AAG weather station uses reed switches for both the anemometer and wind vane.  And in fact the rain gauge does, too.  They're still working fine after many years (more than ten).  It's the plastic parts that are falling to pieces :(

James

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

I decided to order a pack of 10 plastic housed reed switches due to arrive tomorrow.  This would give the easiest system to mount and the smallest also probably simplest to connect.

  • Like 1
Link to comment
Share on other sites

I'm trying to find info on the IZOKEE NodeMCU Module ESP8266 ESP-12E but not having much joy.  I shall want 9 digital inputs for the wind sensors.

I do have info on programming it with the Arduino IDE though.
Programming ESP8266 ESP-12E NodeMCU Using Arduino IDE - a Tutorial

EDIT :- I think some of the info I want is in this tutorial.  Seems there are 10 digital GPIOs.  Don't know about internal pull-up resistors.

Edited by Gina
Link to comment
Share on other sites

Give this a go, there's a nice pictorial view of the pinouts. Note some boards have the pins pre-defined others don't but that's less of the case now the ESP8266 is more mature. 

https://randomnerdtutorials.com/esp8266-pinout-reference-gpios/

As I mentioned earlier, the ones with the two switches are a little bit of a pain to programme compared with say teh Wemos ones where it will force the programming mode using the USB. That said, once you have it up and running and connected to your wifi you can just programme OTA as long as you have the right code running.

  • Thanks 1
Link to comment
Share on other sites

The Reed switches only need a single resistor to create a bridge if you are reusing an existing setup. Otherwise you will need 9, one for each octet and 1 for the bridge. 

The adc should not be configured for pull-ups or downs, those options won't be available for an input configured as an adc. 

 

  • Thanks 1
Link to comment
Share on other sites

I don't quite understand your first paragraph, I'm afraid.

I have nothing ATM.  My plan is to connect the reed switches to the ESP and use internal PU if available with the other ends connected to Gnd.

Edited by Gina
Link to comment
Share on other sites

Looks like the NodeMCU Module ESP8266 ESP-12E that is on the way to me won't work in the way I want.  There may be a way round it using fewer pins - I shall have to think...

Link to comment
Share on other sites

How many ADC pins do you have available?  The Dallas/AAG weather station uses four as per the following circuit diagram, but I wonder if you could do it with fewer by using a resistor ladder?  (SW9 and SW10 are the anemometer switches.  I've ever really given any thought to why there are two.  Perhaps it's some sort of workaround for debounce problems.)

DallasOneWireStation.gif.dda34b03516533f2cbbf0ffca5beec07.gif

Whilst I remember, this weather station places the reed switches sufficiently close that adjacent pairs can be activated at the same time, thereby giving you sixteen directions with only eight reed switches.

James

  • Like 1
Link to comment
Share on other sites

Well, well, well, that's the same circuit as an earlier WS of mine using 1-wire.  Except mine didn't use two reeds for the anemometer.

The ESP8266 has just one ADC input.

The NodeMCU Module ESP8266 ESP-12E version has just been delivered.  It's only very slightly smaller than the ESP32!  So I haven't gained much - just a couple of quid cheaper.  I may go back to the ESP32 and use this for something else.  I'm not sure there's any advantage in the 8266.

Edited by Gina
Link to comment
Share on other sites

Hmm.  One ADC makes it a bit more tricky :)  The other perhaps obvious way to handle eight inputs would be to feed them through a multiplexer so you only need three pins?

James

Link to comment
Share on other sites

I reckon I may be able to use the ESP8266 for my observatory roof control.  Current design uses an RPi and Arduino Nano.  It only needs the Nano to read one analogue signal otherwise it's digital I/O.

Link to comment
Share on other sites

Just checked the observatory roof control thread and the requirements are 1 analog input, 6 digital inputs and 2 digital outputs.  I think the NodeMCU Module ESP8266 ESP-12E could cope with this.

Edited by Gina
Link to comment
Share on other sites

I shall be using the ESP32 for the wind sensors then and may add the rain gauge and maybe light level sensor - photo-voltaic cell.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.