Jump to content
Thank you for the great forum, Safe Driving over the weekend. Sincerely Jason
Javi Martínez

Low cost radiation sensor

Recommended Posts

Hi all!

I share with you a very low cost radiation sensor I have installed at home. It is only needed a small sollar panel, 5w 18 Vo, a ESP32 and a pair of 10 ohm resistors.

Here you have the scheme:

You can see my radiation sensor online on this web:

beduino.sytes.net/www/radiation.php

Iy you are interested i can send the code for esp32.

We´ve got a cloudy day and it is funny.

esp32.jpg

Edited by Javi Martínez

Share this post


Link to post
Share on other sites

The code:

#include <ETH.h>
#include <WiFi.h>
#include <WiFiAP.h>
#include <WiFiClient.h>
#include <WiFiGeneric.h>
#include <WiFiMulti.h>
#include <WiFiScan.h>
#include <WiFiServer.h>
#include <WiFiSTA.h>
#include <WiFiType.h>
#include <WiFiUdp.h>
//#include <stdio.h>


const char* ssid = "******"; // your ssid
const char* password = "*****"; // your pass

const char* host = "*****"; // your host
int t;
float v;


void setup()
{
 Serial.begin(2400, SERIAL_8N1);
 // We start by connecting to a WiFi network

 Serial.println();
 Serial.println();
 Serial.print("Connecting to ");
 Serial.println(ssid);

 WiFi.begin(ssid, password);

 while (WiFi.status() != WL_CONNECTED) {
 delay(500);
 Serial.print(".");
 }

 Serial.println("");
 Serial.println("WiFi connected");
 Serial.println("IP address: ");
 Serial.println(WiFi.localIP());
}

void loop () {
    
    for (int i=1;i<=5;i++) {int a=analogRead(39);t=t+a;delay(200);}
    
    float k = t; t=0;
    
    k = k/5;
      
    v=2*k/4095*3.3/10*1000/0.33; // 0.33 is the ISC of my pannel in Amps. Use your ISC.


  //Serial.print("connecting to ");
  //Serial.println(host);

 
    WiFiClient client;
    const int httpPort = 80;
    if (!client.connect(host, httpPort)) {
    Serial.println("connection failed");
    return;
 
 }

    String url = "*****"; // your URL
   


    client.print(String("GET ") + url + v + " HTTP/1.1\r\n" +
    "Host: " + host + "\r\n" +
    "Connection: close\r\n\r\n");
 
 unsigned long timeout = millis();
 while (client.available() == 0) {
 if (millis() - timeout > 5000) {
 Serial.println(">>> Client Timeout !");
 client.stop();
 return;
 }
 }
 

   
 while (client.available()) {
 //String line = client.readStringUntil('\r');
 //Serial.print(line);
 }

 //Serial.println();
 //Serial.println("closing connection");

 
}

Share this post


Link to post
Share on other sites

Hi Javi

Are you using this to compare your (large) solar panel power production with a small reference panel? I can see this being useful to quickly check if there is a problem, on your main solar panels, without  having to climb onto the roof.

 

Share this post


Link to post
Share on other sites
1 minute ago, NigelL said:

Hi Javi

Are you using this to compare your (large) solar panel power production with a small reference panel? I can see this being useful to quickly check if there is a problem, on your main solar panels, without  having to climb onto the roof.

 

Yes, you are right.

Share this post


Link to post
Share on other sites

I think that I will need to make one of these.

I am not sure if you are familiar with the bird called the "Hadeda". It is quite large, loud, and also has a correspondingly large droppings! My house seems to be on the Hadeda and Egyptian Goose flight-path to a nearby water reservoir.... 😀

 

Share this post


Link to post
Share on other sites
7 minutes ago, plonkster said:

Kaaaa! Kaaaa! (at 6AM in the morning)...

I believe it is the only avian species with a fear of hights.

Once on the ground walking, not a peep.

Once they get airborne, and gain some height, Kaaaaa!!!!! Kaaaaa!!! :-)

Share this post


Link to post
Share on other sites
7 minutes ago, Riaanh said:

I believe it is the only avian species with a fear of hights.

Once on the ground walking, not a peep.

Once they get airborne, and gain some height, Kaaaaa!!!!! Kaaaaa!!! :-)

HAHAHA!

Share this post


Link to post
Share on other sites

@Javi Martínez , thank you for the idea , I had a look at the code and it seems like you are measuring the voltage of the panels with a resistor for the load. I liked the idea and jumped at it and patched up a small panel to a ardunio. Used a LED as a resistor but I I found that it just dropped the peak voltage to a lower value rather than "following" the solar output. Here is a pick of the last few days data , you will see that it stays virtually the same all the time even , like today , we have hardly any sunshine .

Capture.thumb.PNG.895272f06b319c05c069a1e4c09ef449.PNG 

 

Should I get a larger Panel?

Best regards

Paul

Share this post


Link to post
Share on other sites

Thank you , I will add a small resistor instead. 
 

3 hours ago, Javi Martínez said:

Which panel are you using? Vo and power

One of those very small panels that you get on the garden solar lights. So I dont have an idea of what the specks would be. I measured 3.2 v OC but that is as much as what I have. 

Share this post


Link to post
Share on other sites
1 minute ago, PaulF007 said:

Thank you , I will add a small resistor instead. 
 

One of those very small panels that you get on the garden solar lights. So I dont have an idea of what the specks would be. I measured 3.2 v OC but that is as much as what I have. 

If you measure 3.2 V, I suppose Isc will be 300 ma?. Then you can try with a 1 Ohm resistor. Also you have to change the skects, because ADC of ESP32 is 12 bits and Arduino is 10, and ESP measures from OV to 3.3 V and Arduino from 0 to 5 V

Share this post


Link to post
Share on other sites
28 minutes ago, Javi Martínez said:

Then you can try with a 1 Ohm resistor. Also you have to change the skects, because ADC of ESP32 is 12 bits and Arduino is 10, and ESP measures from OV to 3.3 V and Arduino from 0 to 5 V

Oh yes I have changed it , infact I created a new sketch as I am sending the data directly to Emoncms , but at the moment I am measuring the volts as the figure it self does not make any difference. Ill change to the 10 ohm and have a look at the data for a day or two. 
 

Share this post


Link to post
Share on other sites

Ok - running the little panel for a couple of day's I happy to report that this little bugger works well. I ended up not using your sketch. I prefer a wired system so I went for an Arduino with ethernet shield. I also prefer to use MQTT as a data protocol as I can use it within the home automation system as well. While I was at it I also added an LDR and a Temp sensor to the panel just to compare the Light intensity as well as the Temperature output to the solar radiation.  

As usual Emon CMS is used. :) 

First Graph is the " Calibrated " values comparing the solar output to the radiation monitor. ( Forgot to mention I decided to capture the panel volts instead for the radiation value as both values are calculated from the analog output so it would not make much difference ) .  I calculated the difference between the "Radiation Panel " and the solar output on a bad weather day, this way I knew that all the power that the panels could provide would be used. 

This is quite close

2018-12-28_172835.thumb.png.3bbdeba04960129efae8fc30b0e6b66d.png

The next graph is the "Radiation Sensor" vs the Temp sensor. You can see that it follows the output. It will be interesting to see how this changes in the winter months. 

2018-12-28_174309.thumb.png.63e4e84bc8b90c1b4ebcfd528da1b896.png

The last one is the LDR value. Even if the radiation changes the light intensity does not change much. 

2018-12-28_174618.thumb.png.9837c31cdf667eed5eedbc7f7a41126b.png

In conclusion, I am happy to report that works surprisingly well considering I am using one of those small cheapo solar panels that powers a led for a week and then gets thrown  in the bin.  

Thank you @Javi Martínez for sharing the idea. I can now use the data to switch the geyser on or off during daytime to optimize some of the "lost" energy :) . 

Share this post


Link to post
Share on other sites
On 2018/12/28 at 4:58 PM, PaulF007 said:

Ok - running the little panel for a couple of day's I happy to report that this little bugger works well. I ended up not using your sketch. I prefer a wired system so I went for an Arduino with ethernet shield. I also prefer to use MQTT as a data protocol as I can use it within the home automation system as well. While I was at it I also added an LDR and a Temp sensor to the panel just to compare the Light intensity as well as the Temperature output to the solar radiation.  

As usual Emon CMS is used. :) 

First Graph is the " Calibrated " values comparing the solar output to the radiation monitor. ( Forgot to mention I decided to capture the panel volts instead for the radiation value as both values are calculated from the analog output so it would not make much difference ) .  I calculated the difference between the "Radiation Panel " and the solar output on a bad weather day, this way I knew that all the power that the panels could provide would be used. 

This is quite close

2018-12-28_172835.thumb.png.3bbdeba04960129efae8fc30b0e6b66d.png

The next graph is the "Radiation Sensor" vs the Temp sensor. You can see that it follows the output. It will be interesting to see how this changes in the winter months. 

2018-12-28_174309.thumb.png.63e4e84bc8b90c1b4ebcfd528da1b896.png

The last one is the LDR value. Even if the radiation changes the light intensity does not change much. 

2018-12-28_174618.thumb.png.9837c31cdf667eed5eedbc7f7a41126b.png

In conclusion, I am happy to report that works surprisingly well considering I am using one of those small cheapo solar panels that powers a led for a week and then gets thrown  in the bin.  

Thank you @Javi Martínez for sharing the idea. I can now use the data to switch the geyser on or off during daytime to optimize some of the "lost" energy :) . 

Good!

If you like this kind of things, I can share a circuit which makes a capacitive barrier of solar pannel, obtaining 64 points of IV curve. I think It is interesting because you know the power that FV could give in that moment.

What we did is obtain solar radiation, without considering cell temperature.

Share this post


Link to post
Share on other sites

Hi Javi!

Great work. I currently start to experiment with sensors and ESPs, and i want to measure solar radiation from a solar panel like you did.

Can you pliz explain me the function you use for the calculation of the  radiation?

In particular that line of code : v=2*k/4095*3.3/10*1000/0.33; // 0.33 is the ISC of my pannel in Amps. Use your ISC

Do you use anywhere the dimensions of the solar cell at the calculation since its W/m2?

My solar panel is 6V 1.1W 200mA , 112 x 84 mm. I use ESP32.

Pliz help if you can. Thanks.

Nick.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


Topics

Contact Us - Power Forum South Africa

×
×
  • Create New...