Author Topic: Arduinio Weather Station Grapher  (Read 6071 times)

0 Members and 2 Guests are viewing this topic.

Offline WooferHound

  • Technowhiz
  • Global Moderator
  • Hero Member
  • ******
  • Posts: 897
  • Karma: +40/-3
  • Huntsville Alabama USA
    • My personal webpage
Arduinio Weather Station Grapher
« on: February 12, 2021, 07:59:06 am »
I have always wanted to work with Arduino Microcontrollers and have decided to jump in Head-First and build a Weather Grapher.
This device will make Measurements of the following . . .
Indoor Temp
Indoor Humidity
Outdoor Temp
Outdoor Humidity
Barometric Pressure
Outdoor Light
It will make a measurement of all modes every minute, Every 12 minutes it will be averaged and stored, creating 5 averaged readings per hour.
At midnight the whole day will be averaged for the Out Temp and Out Lite readings and stored to make some graphs that show 120 day Trends
The display will be  small OLED screen with a 128x64 display
8 buttons will cause a graph of information to be displayed . . .
1- In Temp  24hr
2- In Hum  24hr
3- Out Temp  24hr
4- Out Hum  24hr
5- Bar Pres 24hr
6- Out Lite 24hr
7- 120 Day Temp Averages
8- 120 Day Light Averages

This project will involve . . .
Arduino Uno
2 DHT22 Temp Humidity sensors
Barometric Pressure sensor
Small Solar panel
Real Time Clock
and some switches
The Hardware part of the project appears to be simple.

Have programed in BASIC before and have been spending the last week learning Arduino C++
Doesn't seem to be too much of a learning curve.

Haven't ordered any parts yet so this may take some time ?



----- W o o f e r h o u n d -----
My Renewable Energy Projects

Offline WooferHound

  • Technowhiz
  • Global Moderator
  • Hero Member
  • ******
  • Posts: 897
  • Karma: +40/-3
  • Huntsville Alabama USA
    • My personal webpage
Re: Arduinio Weather Station Grapher
« Reply #1 on: February 27, 2021, 05:41:23 pm »
I got my Weather Station parts today and now the Arduino and display are working together.



Made a small solar panel yesterday to check the outdoor Light Level and graphing the light level will be my first learning project with these parts. Been learning Arduino C++ over the last week and will start coding tomorrow.



Realized that my project is too big to fit on a Nano so these computers will be used for learning until I can get an Arduino Mega. also did not realize that this display is really small, so a bigger display will soon be arriving.
----- W o o f e r h o u n d -----
My Renewable Energy Projects

Offline WooferHound

  • Technowhiz
  • Global Moderator
  • Hero Member
  • ******
  • Posts: 897
  • Karma: +40/-3
  • Huntsville Alabama USA
    • My personal webpage
Re: Arduinio Weather Station Grapher
« Reply #2 on: March 09, 2021, 10:00:59 am »
I've had a coupla weeks to play with my little Arduino computers now, They are about the size of your thumb but appear to be more powerful than an old an old 286 Desktop that I had back in the Early 1990's. I think I have figured out most of the C++ programing and have been producing Graphs of the Outdoor Light Level over the last couple days.



I gutted an old Solar Charged Powerbank and all that is left is the 6v solar panel that has a Resister divider to keep the output voltage below 5v for the Arduino input.



It is mounted Outside next to the large solar panel that I charge my batteries with. So it is measuring the light it is receiving for Battery Charge. A small wire goes all the way inside to my Computer desk where I am testing at.

The last few days have been totally clear of clouds and Full Sun all day long. The resulting graphs have been boring straight squiggly lines. But I have been graphing some Sunrise & Sunsets so I can see it doing something.   



I have rewritten this program at least 3 times while learning the Syntax so the results displayed vary a little bit.
The picture above is a Sunset, sampled every 30 seconds, displaying 1 hour of data 120 pixels wide



Above picture is Yesterdays Sunset. Sampled once a minute. Displaying 2 hours of data.



Above picture is this mornings Sunrise. Also Sampled once a minute. Displaying 2 hours of data.

My camera does not take Close-ups very well, even set to Macro, so the focus is a little bit out.
Have decided to make this unit into a solar power monitor. It will keep track of the Sun Light and Battery Charge, will be able to overlay the 2 data streams and scale the data in different ways.
I have a second Arduino that I will build into the Weather Monitoring Station.
Today and the next few days are forecast to be considerably cloudy so I may have some fairly dynamic displays to show soon.
Have discovered that the smaller Arduinos have limited memory so I am looking into the Arduino MEGA for my future projects.
----- W o o f e r h o u n d -----
My Renewable Energy Projects

Offline rossw

  • Senior Moderator
  • Hero Member
  • *******
  • Posts: 879
  • Karma: +35/-0
  • Grumpy-old-Unix-Admin
Re: Arduinio Weather Station Grapher
« Reply #3 on: March 09, 2021, 08:03:04 pm »
Are you trying to plot light level, or the power available?

Silicon cells are hideously non-linear - far more so if you are just looking at the voltage they generate while they have little or no load.
The ideal load is a short circuit, but that makes it hard to measure the output.
The solution to that is to use an opamp as a transimpedance amplifier, where it drives its output to keep the voltage on the PV output at ZERO - in effect, a perfect short circuit - but that outputs a signal proportional to how hard it has to push back!
Of course, using a PV panel as large as you are makes the opamp requirements pretty hefty compared to a smaller photodiode, but still doable.

Try loading the cell down as hard as you can and you should get better.

Offline WooferHound

  • Technowhiz
  • Global Moderator
  • Hero Member
  • ******
  • Posts: 897
  • Karma: +40/-3
  • Huntsville Alabama USA
    • My personal webpage
Re: Arduinio Weather Station Grapher
« Reply #4 on: March 12, 2021, 06:23:31 am »
Are you trying to plot light level, or the power available?

Silicon cells are hideously non-linear - far more so if you are just looking at the voltage they generate while they have little or no load.

Try loading the cell down as hard as you can and you should get better.

Hey Ross
I honestly don't have any real need for these graphs. I just bought my first Arduino Computer and just trying out some things so I can learn the programming. I've always been interested in graphing data and have always thought that a graph of outdoor light level would be very interesting.
Suspected that the voltage output from a solar panel would not accurately follow the actual light level. I feel that the readings I'm getting follow actual levels really good until it gets close to Full Sunlight and then it compresses and flattens out a little bit.
The small solar panel being used to sense the light is 6 volts and measured only 60 ma short circuit. I don't think it is even big enough to charge a Powerbank in the first place. The voltage divider uses 1200 ohms across it so it's not loaded much at all.

After watching a pile of Arduino Videos on YouTube I discovered that the Arduino can send to a Plotter on the computer.
So I plotted 7 hours of time starting at 12:noon and going all the way through sunset. The levels drop off very quickly at sunset cause heavy clouds were also moving in.


----- W o o f e r h o u n d -----
My Renewable Energy Projects

Offline rossw

  • Senior Moderator
  • Hero Member
  • *******
  • Posts: 879
  • Karma: +35/-0
  • Grumpy-old-Unix-Admin
Re: Arduinio Weather Station Grapher
« Reply #5 on: March 12, 2021, 02:46:39 pm »
Suspected that the voltage output from a solar panel would not accurately follow the actual light level.

But it CAN.

Quote
I feel that the readings I'm getting follow actual levels really good until it gets close to Full Sunlight and then it compresses and flattens out a little bit.

Quite a lot looking at your graph!

Quote
The small solar panel being used to sense the light is 6 volts and measured only 60 ma short circuit. I don't think it is even big enough to charge a Powerbank in the first place. The voltage divider uses 1200 ohms across it so it's not loaded much at all.

I would load it up WAY more. I mean *WAY* more.
At 6V with 1200R that's only 5mA and you won't be getting anything LIKE a representative curve.

I would like you to try with a 22 ohm to the panel + and then 82 ohm to ground. Take the junction of the 22 and 82 to your arduino input.
That should give you 58mA draw at full voltage, and reduce the voltage to the arduino to just 4.7V (safe, with a little headroom for overshoot)

What you SHOULD see on a cloudless day is a section of a sine-wave. Despite you thinking the sun comes up and is basically the same brightness all day, it really isn't - at least, not with a fixed detector!

Offline rossw

  • Senior Moderator
  • Hero Member
  • *******
  • Posts: 879
  • Karma: +35/-0
  • Grumpy-old-Unix-Admin
Re: Arduinio Weather Station Grapher
« Reply #6 on: March 12, 2021, 09:02:24 pm »
Here's an example - the last 24 hours at my location.

The green curve is the calculated intensity at this time of day and this day of year, based on my lat/lon, for an arbitary horizontal-plane.

The red curve is the 5-minute peak value observed (which would normally be right at the edge of the blue area, but we have had high cloud all morning, and at midday a lot more cloud has moved in - the high peaks are cloud-edge-effect and the lows are where we've been in deeper shade)

The blue area is the average intensity over the whole 5 minute sample period.

As you can see, it "should" follow a near-perfect section of a sinewave - the amount of the sinewave depends on the time of year and your latitude.

These are measured using a large-area PIN diode and a "perfect short circuit" using the earlier-mentioned transimpedance amplifier.

Offline WooferHound

  • Technowhiz
  • Global Moderator
  • Hero Member
  • ******
  • Posts: 897
  • Karma: +40/-3
  • Huntsville Alabama USA
    • My personal webpage
Re: Arduinio Weather Station Grapher
« Reply #7 on: March 13, 2021, 02:29:48 pm »

I would like you to try with a 22 ohm to the panel + and then 82 ohm to ground. Take the junction of the 22 and 82 to your arduino input.
That should give you 58mA draw at full voltage, and reduce the voltage to the arduino to just 4.7V (safe, with a little headroom for overshoot)


OK I changed those resisters in the Divider Network.
Didn't have the exact values, so I added 50% to each value where I'm using 33 ohm and 120 ohm to divide it.

It does look wildly better with more definition in the brighter samples.
Was worried that putting a load on the panel would reduce Low Light Sensitivity, but that is not really important anyway.

Want to start averaging several samples together instead of taking the sample and immediately plotting the pixel, but I still am not good enough with the programming. Having trouble declaring variables properly, I think it has something to do with Scope of the variable. Really need to learn how to declare a 2 Dimensional Array but keep getting syntax errors.

But still Having fun . . .

Here is a 2 hour section of todays cloud cover with the changes made to the resistors.

----- W o o f e r h o u n d -----
My Renewable Energy Projects