author
7Instructables47,905Views267CommentsAustraliaJoined June 3rd, 2015
I am a retired professional engineer, now farmer. Taking an interest in all things technological and in building devices useful on the farm.

Achievements

100+ Comments Earned a bronze medal
10K+ Views Earned a bronze medal
  • Solar Powered WiFi Weather Station V2.0

    To make a single sided PCB, you normally need to optimise the pattern, and add links using copper wires between areas that can't be joined and need to be. In order to make it possible to add the copper wires, you need to make solder pads with a drill hole so that the wire can be put through and soldered in place. So I think it is quite a big re-design you would need to undertake. Possible? Yes. Easy? No. Keith

    View Instructable »
  • Solar Powered WiFi Weather Station V2.0

    Hi kverwater, Re your question 1 about altitude: this value is generated by the line of code:float altitude = bme0.calcAltitude (pressure);If your device is located at a fixed altitude, this is probably not very useful to you, and you would be better off calculating the "normalised pressure" which is the pressure at mean sea level, based on the current air pressure (measured) and the altitude (known). To do this you could replace the above line withfloat normalisedPressure = bme0.calcNormalisedPressure (pressure, altitude);or in your case:float normalisedPressure = bme0.calcNormalisedPressure (pressure, 15);You can get more information about this calculation at https://www.instructables.com/id/Library-for-BMP28...I will have a look at your other questions and reply if I find ...

    see more »

    Hi kverwater, Re your question 1 about altitude: this value is generated by the line of code:float altitude = bme0.calcAltitude (pressure);If your device is located at a fixed altitude, this is probably not very useful to you, and you would be better off calculating the "normalised pressure" which is the pressure at mean sea level, based on the current air pressure (measured) and the altitude (known). To do this you could replace the above line withfloat normalisedPressure = bme0.calcNormalisedPressure (pressure, altitude);or in your case:float normalisedPressure = bme0.calcNormalisedPressure (pressure, 15);You can get more information about this calculation at https://www.instructables.com/id/Library-for-BMP28...I will have a look at your other questions and reply if I find something useful. Keith

    Hi Kees / kverwater, Adafruit have published a library for the GY-1145 (SI-1145) which gives you access to the basic functions. Basically you will need to follow the example and copy the relevant parts of it into your code for this project. Although written for an Arduino Uno or similar, it compiles for the WeMos and I think it will almost certainly work for you. If you want the UV values to correspond to the real world, it will need to be exposed to it.To connect the DS18B20 you can use any connector you like, or no connector, so long as the wires are connected the right way. You may be able to use the "pluggable terminal" in your picture, simply by using the pins not according to their labels. However you need to check what the two components are doing, and possibly remove t...

    see more »

    Hi Kees / kverwater, Adafruit have published a library for the GY-1145 (SI-1145) which gives you access to the basic functions. Basically you will need to follow the example and copy the relevant parts of it into your code for this project. Although written for an Arduino Uno or similar, it compiles for the WeMos and I think it will almost certainly work for you. If you want the UV values to correspond to the real world, it will need to be exposed to it.To connect the DS18B20 you can use any connector you like, or no connector, so long as the wires are connected the right way. You may be able to use the "pluggable terminal" in your picture, simply by using the pins not according to their labels. However you need to check what the two components are doing, and possibly remove them. If they are for example LED (on the right) and resistor (on the left), they will need to be removed, and assuming the connections then go straight through you can use the 3 pins (right to left) as Vcc, Data, GND as per the PCB. You may need to add a pull-up resistor about 4.7K between data and Vcc.The software library DallasTemperature.h makes working with the DS18B20 quite easy. As for gas sensing, yes the BME680 looks like a good prospect. It still has a heater but the power requirement is probably manageable in the solar powered project. It operates on 3.3V so there is no voltage problem. I have not researched the Grove device. I don't know about WeeWX. When you get Blynk working you may find it meets all your needs. Keith

    Hi kverwater, Re your questions 2, 3 and 4 relating to the GY-1145, an external temperature sensor, and a MQ-2 gas sensor. The first two are addressed in Step 4. GY-1145 is an I2C device and can easily be connected to the provided I2C port. You can connect an external digital temperature sensor DS18B20 to port P2. MQ2 is a lot more complicated/difficult. It depends on how determined you are. First, MQ2 requires a 5V supply (+- 0.2V), which is not available because this is a battery powered project using a single Lithium cell. Also the power requirement is quite significant and may need significant change in the solar panel and battery capacity. It is not clear to me from the MQ2 data sheet how well the sensor will operate with a low duty cycle.Assuming you can solve the power supply que...

    see more »

    Hi kverwater, Re your questions 2, 3 and 4 relating to the GY-1145, an external temperature sensor, and a MQ-2 gas sensor. The first two are addressed in Step 4. GY-1145 is an I2C device and can easily be connected to the provided I2C port. You can connect an external digital temperature sensor DS18B20 to port P2. MQ2 is a lot more complicated/difficult. It depends on how determined you are. First, MQ2 requires a 5V supply (+- 0.2V), which is not available because this is a battery powered project using a single Lithium cell. Also the power requirement is quite significant and may need significant change in the solar panel and battery capacity. It is not clear to me from the MQ2 data sheet how well the sensor will operate with a low duty cycle.Assuming you can solve the power supply question, you can get the 5V required using a boost converter module to generate 5V from the 3.7V battery voltage.The next problem is that the output of the MQ2 is inherently an analog voltage level. Some modules are available with a built-in amplifier and threshold detector, so you can connect them to a digital input on the WeMos. However to get the best information possible from your gas sensor, you need an analog input. Since in this project, the single analog input on the WeMos is allocated to measuring the battery voltage, you either have to re-allocate that to your gas sensor and give up on battery voltage monitoring, or else add an additional ADC device. You can (for example) add an ADS1115, connected to the I2C port, which will give you 4 analog inputs, one of which can be used for the gas sensor. All these additional components needed to support the MQ2 would need an additional circuit board.In summary, adding a GY-1145 and DS18B20 is very simple. Adding an MQ2 sensor entails significant complexity but is possible. I hope this helps. Keith

    View Instructable »
  • ARDUINO SOLAR CHARGE CONTROLLER ( Version 2.0)

    Hi clintonm8, Yes you can replace the buck converter with a different type. LM2596 will be OK. Keith

    View Instructable »
  • ARDUINO SOLAR CHARGE CONTROLLER ( Version 2.0)

    Hi clintonm8, the load output voltage should be very low when the load is turned off (the voltage should be very close to zero) or should be very close to the battery voltage when the load is turned on. If you are using a 12 volt battery, that means the load, and battery, should both be about 12V (usually between 11V and 14V). You need to get both measurements to find the source of any problem. Keith

    View Instructable »
  • ARDUINO SOLAR CHARGE CONTROLLER ( Version 2.0)

    Hi clintonm8,The two 0.1 uF capacitors are listed in the parts list as ceramics (step 1, item 10). The original circuit diagram shows a linear regulator (IC1 7805) but the parts list gives a buck converter (step 1, item 4). Either will work. The updated schematic (v2.01, attached to an earlier comment) shows a buck converter (based on MP2307). If you need to know more, please ask. Keith

    View Instructable »
  • Solar Powered WiFi Weather Station V2.0

    Hi Alan/Topspliff, Interesting that the different WeMos board could be responsible. I think the most likely explanation would be that the USB interface IC is different and is not being put to sleep when the ESP8266 goes to sleep. Anyway replacing with the original WeMos board type should clearly identify that as the problem (or not). About your panel generating only 4.4V, it is possible that a nominal 5V cell might only generate 4.4V if the panel temperature is quite high. The panel voltage goes down as the temperature rises. Where you live I expect you will have high panel temperatures, so you may need to use a nominal 6V cell with 12 cells in series or even higher. The boost converter in series is also a valid solution although it seems a bit complicated compared to additional cells i...

    see more »

    Hi Alan/Topspliff, Interesting that the different WeMos board could be responsible. I think the most likely explanation would be that the USB interface IC is different and is not being put to sleep when the ESP8266 goes to sleep. Anyway replacing with the original WeMos board type should clearly identify that as the problem (or not). About your panel generating only 4.4V, it is possible that a nominal 5V cell might only generate 4.4V if the panel temperature is quite high. The panel voltage goes down as the temperature rises. Where you live I expect you will have high panel temperatures, so you may need to use a nominal 6V cell with 12 cells in series or even higher. The boost converter in series is also a valid solution although it seems a bit complicated compared to additional cells in the panel.When you get your new WeMos I will be interested to know how the current changes. Keith

    View Instructable »
  • Solar Powered WiFi Weather Station V2.0

    Hi Topspliff, Can you confirm that you are seeing 4mA current consumption of the WeMos board, even when it is asleep? The current consumption budget for the WeMos is in Step 7. The TP4056 charging module should be using 0.05 mA (max 0.1mA). The BME280 used in single-shot mode will be using 0.0001 mA when asleep. If your WeMos has a CH340 USB interface IC, it is put to sleep when the processor goes to sleep, and uses 0.05mA when asleep.The voltage regulator RT9013 has a quiescent current draw of about 0.025 mA. The ESP8266 processor uses 0.01 mA when asleep. So during the "sleep" period between reports, the total current consumption should be of the order of 0.135mA. If you want to dig into why you are getting different temperature numbers with the Wemos and an Arduino Uno or ...

    see more »

    Hi Topspliff, Can you confirm that you are seeing 4mA current consumption of the WeMos board, even when it is asleep? The current consumption budget for the WeMos is in Step 7. The TP4056 charging module should be using 0.05 mA (max 0.1mA). The BME280 used in single-shot mode will be using 0.0001 mA when asleep. If your WeMos has a CH340 USB interface IC, it is put to sleep when the processor goes to sleep, and uses 0.05mA when asleep.The voltage regulator RT9013 has a quiescent current draw of about 0.025 mA. The ESP8266 processor uses 0.01 mA when asleep. So during the "sleep" period between reports, the total current consumption should be of the order of 0.135mA. If you want to dig into why you are getting different temperature numbers with the Wemos and an Arduino Uno or Nano, you probably need to look at the raw temperature reading and the associated calibration parameters that are used to convert into Celsius. Keith

    View Instructable »
  • ARDUINO SOLAR CHARGE CONTROLLER ( Version 2.0)

    Hi tgray1, You are right, the schematic is not complete. The author has been working on a small upgrade, which will include a PCB. There will be a new schematic which is complete. The main changes are a) only one fuse which is now in series with the battery; b) replace temperature sensor with DS18B20.Keith

    View Instructable »
  • Solar Powered WiFi Weather Station V2.0

    Hi TimcoV, Sorry but I think you have not understood. Which is quite understandable, but it has led you down the wrong path. The average consumption is 9.3 mA - that is correct, and it is calculated from the charge consumption which is 93.13 mA-minutes every 10 minutes. A milliAmp-minute is a non-standard unit of charge. It means the charge carried by a current of one milliAmp for a time of one minute. The standard unit of charge is the Coulomb, which is the charge carried by a current of one Amp for one Second. It is easy enough to convert from milliAmp-minutes to Coulombs, but it just complicates the arithmetic. Whether it clarifies the concept is perhaps debatable. Anyway the key point is that the average current is 9.3 mA. This is the average current consumption over whatever period...

    see more »

    Hi TimcoV, Sorry but I think you have not understood. Which is quite understandable, but it has led you down the wrong path. The average consumption is 9.3 mA - that is correct, and it is calculated from the charge consumption which is 93.13 mA-minutes every 10 minutes. A milliAmp-minute is a non-standard unit of charge. It means the charge carried by a current of one milliAmp for a time of one minute. The standard unit of charge is the Coulomb, which is the charge carried by a current of one Amp for one Second. It is easy enough to convert from milliAmp-minutes to Coulombs, but it just complicates the arithmetic. Whether it clarifies the concept is perhaps debatable. Anyway the key point is that the average current is 9.3 mA. This is the average current consumption over whatever period of time you want to analyse, whether it be 10 minutes, 1 hour, 24 hours or a week. Now we come to working out the time that the battery will last, and the required size of the solar panel. For this we need to calculate the daily charge requirement. When looking at the daily charge requirement, again this could be in Coulombs per day, but it is more usual to use Amp-hours per day. Also battery capacity is usually quoted in Amp-hours. If this project uses an average of 9.3 mA, then it uses 9.3 mA-hours per hour, which results in 9.3*24 mA-hours per 24 hours = 9.3*24 mA-hours per day (since one day is 24 hours). In your question you wrote "Then you wrote that for one day, it is 24 * 9.3 mA." However what is written is that for one day, the consumption is 24 * 9.3 mAh. The vital difference is the "h". That is, the consumption is a charge, measured in milliAmp-hours, abbreviated mAh.I hope this anwers your question and explains how to do this calculation. The key is keeping the clear distinction between current (charge per unit time) and charge (current multiplied by time). Keith

    View Instructable »
  • ARDUINO SOLAR CHARGE CONTROLLER ( Version 2.0)

    Hello Warrior18, There are several possible explanation for wrong voltage readings. It is important for the correct functioning of the controller to have accurate readings. The key point in your question is the "at times". That is, how far off and does the error vary?The usual problem is having resistors in the voltage dividers that are different from the specified values. It may just be the normal variation in value that occurs from manufacturing tolerances. This variation can be compensated by a small change in the software to calibrate the voltage readings using your multimeter as a reference. The calibration settings are in the function "void read_data(void)" where you will see the nominal resistor values 20 and 120 (which is 100 plus 20). By modifying one or bo...

    see more »

    Hello Warrior18, There are several possible explanation for wrong voltage readings. It is important for the correct functioning of the controller to have accurate readings. The key point in your question is the "at times". That is, how far off and does the error vary?The usual problem is having resistors in the voltage dividers that are different from the specified values. It may just be the normal variation in value that occurs from manufacturing tolerances. This variation can be compensated by a small change in the software to calibrate the voltage readings using your multimeter as a reference. The calibration settings are in the function "void read_data(void)" where you will see the nominal resistor values 20 and 120 (which is 100 plus 20). By modifying one or both of these numbers you should be able to get your Arduino readings to line up with your multimeter readings. Keith

    Hello ShyamS102, The display connection is not shown on the circuit diagram, which is provided by a link at the end of Step 2. The display has 4 wires: Ground and 5V (for power) and two data connections SCL and SDA. SCL connects to the Arduino pin A5 and SDA connects to Arduino pin A4. If you can't work it out, please send another question. Keith

    Hello Qasiml3, There is a link to the circuit diagram at the end of Step 2. Keith

    View Instructable »
  • Solar Powered WiFi Weather Station V2.0

    Hi Spence / CodfishCatfish, Thanks for the reply. At the end of Step 1 in the Instructable for the BMP280 library (https://www.instructables.com/id/Library-for-BMP28... there is a link to a little diagnostic program that can tell you whether your device is BMP280 (without humidity) or BME280 (with humidity) and also the information to tell the difference by visual inspection of the device itself (microscope recommended). I do not think the markings on the circuit board are likely to be reliable, and often there is no marking anyway. The devices (BMP280 and BME280) are physically identical and use the same I2C addresses. However they have different device codes in their registers, which is what the diagnostic program reads and then prints to the serial monitor the result. Keith

    View Instructable »
  • Solar Powered WiFi Weather Station V2.0

    Hi CodfishCatfish, If you are using the BMP280 library that is used with the published software for this project, you should not have such trouble with using a BMP280 instead of a BME280. This library is capable of working with both devices, merely not giving humidity readings if you are using a BMP280. This is different from other libraries for this device. If you want to learn more about the library and its capabilities, I suggest you have a look at https://www.instructables.com/id/Library-for-BMP28...Keith

    View Instructable »
  • ARDUINO SOLAR CHARGE CONTROLLER ( Version 2.0)

    Hi RyuKim, Did you count the cells in your solar panel?Regarding the bad voltage measurements, it is likely to be that the resistors you have used for the voltage dividers used in the measurements are a bit off. You can check the dividers with your multimeter. On the battery side, measure the voltage of the battery, and also at pin A1 on the Arduino. The ratio should be 20/120.You can do the same thing on the panel side, panel voltage and pin A0 on the Arduino. Again the ratio should be 20/120. So for example if your battery voltage is 13V, A1 should be 2.167 V. The calibration of these can be adjusted in the software, in the read_data function. You will see the (120/20) in the code, you can alter them to the ratio that you get from your actual readings. If you are not sure what is happ...

    see more »

    Hi RyuKim, Did you count the cells in your solar panel?Regarding the bad voltage measurements, it is likely to be that the resistors you have used for the voltage dividers used in the measurements are a bit off. You can check the dividers with your multimeter. On the battery side, measure the voltage of the battery, and also at pin A1 on the Arduino. The ratio should be 20/120.You can do the same thing on the panel side, panel voltage and pin A0 on the Arduino. Again the ratio should be 20/120. So for example if your battery voltage is 13V, A1 should be 2.167 V. The calibration of these can be adjusted in the software, in the read_data function. You will see the (120/20) in the code, you can alter them to the ratio that you get from your actual readings. If you are not sure what is happening, please send me your readings and I will try to help you figure it out.Keith

    View Instructable »
  • Solar Powered WiFi Weather Station V2.0

    Hi palbeda, I think you can get all this info from the Blynk web site, but the basics are that when you first register with Blynk as a developer they provide you with a fixed allowance of "energy" for use on their server. If you install your own local server, you get a much larger allowance for use there. Then when you design your dashboard (or dashboards), you do it in design mode by pressing the "+" button near the top of the screen, which then shows you a list of possible "widgets" each of which has its price associated with it. As you add widgets to your dashboard, the energy cost of each is subtracted from your allowance. If you delete a widget, you get a refund of exactly the same amount as you "paid" when you first used it, which means you ...

    see more »

    Hi palbeda, I think you can get all this info from the Blynk web site, but the basics are that when you first register with Blynk as a developer they provide you with a fixed allowance of "energy" for use on their server. If you install your own local server, you get a much larger allowance for use there. Then when you design your dashboard (or dashboards), you do it in design mode by pressing the "+" button near the top of the screen, which then shows you a list of possible "widgets" each of which has its price associated with it. As you add widgets to your dashboard, the energy cost of each is subtracted from your allowance. If you delete a widget, you get a refund of exactly the same amount as you "paid" when you first used it, which means you can experiment with adding and deleting widgets without running up a cost. If you run out of your free allowance, then you can buy more. I have not done this for a while so the situation may have changed, but that is the way it used to be, anyway. I have found Blynk a very flexible and powerful interface, at least for my simple needs. Keith

    View Instructable »
  • ARDUINO SOLAR CHARGE CONTROLLER ( Version 2.0)

    Hi RyuKim,Regarding your panel, please count the solar cells that make up the panel, They are usually clearly visible at the front of the panel, and you can see the connections which are usually silver-coloured strips running down the front. What appears to be a short break between cells is actually the connection going to the back of the previous cell. Each cell will produce about 0.5 volts with full illumination. A panel sold as "12 Volts" usually has 36 cells and generates about 18 V at maximum power, or a bit over 20V when open circuit. If you are measuring 20V on your panel when open circuit, it is almost certainly a "12 Volt" panel. Irrespective of the above explanation, it will be no problem to use your panel with this solar charger. Regarding powering the Ard...

    see more »

    Hi RyuKim,Regarding your panel, please count the solar cells that make up the panel, They are usually clearly visible at the front of the panel, and you can see the connections which are usually silver-coloured strips running down the front. What appears to be a short break between cells is actually the connection going to the back of the previous cell. Each cell will produce about 0.5 volts with full illumination. A panel sold as "12 Volts" usually has 36 cells and generates about 18 V at maximum power, or a bit over 20V when open circuit. If you are measuring 20V on your panel when open circuit, it is almost certainly a "12 Volt" panel. Irrespective of the above explanation, it will be no problem to use your panel with this solar charger. Regarding powering the Arduino Nano, yes it is powered from the 7805 regulator with 5V (and a ground connection of course). Keith

    View Instructable »
  • Solar Powered WiFi Weather Station V2.0

    Hi ЦветанС2, The measurement interval is defined in line 14 of the main program. It is a number in milliseconds, so to get 10 minutes, which is 600 seconds, you need to set it to 600000. In the goToSleep function (found in PTHsleep.h) the awake time for that report is subtracted from the measurement interval and then multiplied by 1000 to bring it to microseconds which is what the ESP.deepSleep() function requires.

    You really need an external temperature probe, such as a DS18B20 mounted in a proper enclosure to protect it from the sun. You can use one of the additional ports on the PCB to make the connection.

    Hi MiroB1, in my version it is (sleepTime * 1000). I don't know how 5000 got into it.Keith

    View Instructable »
  • ARDUINO SOLAR CHARGE CONTROLLER ( Version 2.0)

    Hi AnupamD6, I don't think adding more MOSFETs will increase the charging current. If you need more current, you need a bigger panel, or a charger including a DC-DC converter. Keith

    Hi Jouseph, If you post a copy from your Serial Monitor showing the error code and the preceding text I may be able to make some suggestions. Keith

    Hi YashA56, Sorry about my slow reply to your question. It is very difficult to do debugging using just photographs. I also wonder if you have found the problem since you posted your question. If you have not, you should post your questions again including some voltage measurements.Keith

    Hi RyuKim, A 12V 40W panel should be fine without any component changes. I believe you should be able to use a TMP36 as a direct replacement for the LM35.Keith

    View Instructable »
  • farmerkeith commented on farmerkeith's instructable Controlling DC Converter Modules3 months ago
    Controlling DC Converter Modules

    Hi DannyZeee, I would certainly be interested to see any design concept that may be better than the ones I know. So please send it to me if or when you find it. Keith

    Hi DannyZeee, I agree that the through hole near pin 2 of the XL4016 IC is an equally valid connection point for the feedback pin. However I feel that it is probably a little easier to use the pins of the pot, as I did. But they are both valid and equal. Keith

    Hi DannyZeee, Sorry if my language was not clear. I was using terminology that I used in work I did a couple of years ago but never published. You can find that work, which explains these terms, here:https://www.instructables.com/id/Designing-MPPT-So...The bit you will need for these terms (like "earth phase current") are in Step 2: How a DC-DC Converter Works. I started writing that Instructable in the early stages of my journey with solar chargers, and have learned quite a lot more since then. I think there is still a role for that type of tutorial but it needs a lot of improvement - for example, diagrams showing the panel phase, earth phase and null phase; and more on the design considerations.Despite its deficiencies, I hope you find it helpful.Keith

    Hi DannyZeee, The losses in the diode used with the XL4016 are not so serious when the panel is "12 volts" (36 cells, MPP voltage around 18V) since the current multiplication is reasonably small . The diode losses become more significant, and the benefit of a synchronous converter correspondingly greater, when using a 60-cell panel (MPP voltage around 30V) which is what I think you are planning to use in your larger system with 280W panels. In this case the current multiplication is around 2.5, with the Earth phase current being about 1.5 times the panel current (instead of more like 0.5 times in the case of a 36-cell panel). With 10 panels, you may need to cater for different shading conditions for each panel, or for groups of panels, with separate control for each. This is b...

    see more »

    Hi DannyZeee, The losses in the diode used with the XL4016 are not so serious when the panel is "12 volts" (36 cells, MPP voltage around 18V) since the current multiplication is reasonably small . The diode losses become more significant, and the benefit of a synchronous converter correspondingly greater, when using a 60-cell panel (MPP voltage around 30V) which is what I think you are planning to use in your larger system with 280W panels. In this case the current multiplication is around 2.5, with the Earth phase current being about 1.5 times the panel current (instead of more like 0.5 times in the case of a 36-cell panel). With 10 panels, you may need to cater for different shading conditions for each panel, or for groups of panels, with separate control for each. This is being used in current grid-connect systems, and may be even more needed in an RV environment where the shading conditions may be unpredictable.

    View Instructable »
  • farmerkeith commented on farmerkeith's instructable Controlling DC Converter Modules3 months ago
    Controlling DC Converter Modules

    Hi DannyZeee, I think it would be useful for you to post pictures of your connections. I will check my hardware when I have access to it later, in the next day or two. If you are using multiple XL4016 converters, would you be better off using a smaller number of SZBK07 or equivalent modules? The XL4016 is an async converter, so it has the inherent loss of the series diode built in, where is the SZBK07 is synchronous and all the current passes through "ON" MOSFETs. Keith

    View Instructable »
  • farmerkeith commented on farmerkeith's instructable Controlling DC Converter Modules3 months ago
    Controlling DC Converter Modules

    Hi DannyZeee, I am glad to hear you have used the information successfully. The main issue with your proposal is that there is not much margin between the set point voltage of the feed back loop on the DC converter module, and the forward voltage drop of the diode. That limited margin, combined with any output voltage of your microcontroller when it is at the "0" state, does not give you much room for error. For example, in the case of the ATmega328P, the output low voltage (Vol) is not guaranteed to be under 0.6V at 85C, although it is typically lower than that. If you add 0.7V for the diode voltage drop, you have 1.3V which is higher than the control point voltage of the DC converter, being 1.25 V. So the control will not work in this case.It may not be a problem in practice...

    see more »

    Hi DannyZeee, I am glad to hear you have used the information successfully. The main issue with your proposal is that there is not much margin between the set point voltage of the feed back loop on the DC converter module, and the forward voltage drop of the diode. That limited margin, combined with any output voltage of your microcontroller when it is at the "0" state, does not give you much room for error. For example, in the case of the ATmega328P, the output low voltage (Vol) is not guaranteed to be under 0.6V at 85C, although it is typically lower than that. If you add 0.7V for the diode voltage drop, you have 1.3V which is higher than the control point voltage of the DC converter, being 1.25 V. So the control will not work in this case.It may not be a problem in practice, since the output stage of the microcontroller will probably not have such a high value. If necessary, this problem can easily be solved by using a MOSFET (eg 2N7000) to control the impedance you are adding between the control point and ground. If you use a MOSFET in this position, you do not need a diode and so there is no diode drop to deal with. You will appreciate that I have not tried this and there may be other issues as well. I will be interested to know how you go. If you have trouble understanding the above, feel free to ask again. If you send me a sketch of your intended circuit I will let you know what I think of it. Keith

    View Instructable »
  • Solar Powered WiFi Weather Station V1.0

    Hi ГеннадийБ2i The solution to you voltage reading is a bit of a puzzle. However I am glad it has come good for you. One of the things missing in the original code is the line:pinMode (A0, INPUT);I had thought this line would be redundant (unnecessary) because the default configuration of pin A0 is as INPUT. However maybe it is needed, perhaps only in some versions of the Arduino IDE. You could check whether your code stops working if you comment out this line. In the second version of your code, the comma between the A0 and INPUT is missing. That should cause a compile error, so I suspect you did not remove that comma. Next, a comment on the scaling. Your scale factor from the raw reading to the displayed "volt" value is 3.89/785 which is 0.004955414, while the scale factor i...

    see more »

    Hi ГеннадийБ2i The solution to you voltage reading is a bit of a puzzle. However I am glad it has come good for you. One of the things missing in the original code is the line:pinMode (A0, INPUT);I had thought this line would be redundant (unnecessary) because the default configuration of pin A0 is as INPUT. However maybe it is needed, perhaps only in some versions of the Arduino IDE. You could check whether your code stops working if you comment out this line. In the second version of your code, the comma between the A0 and INPUT is missing. That should cause a compile error, so I suspect you did not remove that comma. Next, a comment on the scaling. Your scale factor from the raw reading to the displayed "volt" value is 3.89/785 which is 0.004955414, while the scale factor in the original code is 5.1/1023 = 0.004985337. The ratio between these is 1.00604, that is there is a 0.6% difference between the scaling factors. So the original code and your new code are scaled almost identically. It seems to me most likely that the critical line that makes your new code succeed is the pinMode line. As for your question about sending data to both Blynk and Thingspeak. I think it is definitely possible. I have not tried to do this, but for a start I have the following suggestions:Where lines 17 and 18 in the main code currently give you the options of BLYNK and Thingspeak, add a new line such as:const String App = "BOTH"; // alternatives are lines belowThen change line 51 fromif (App == "BLYNK") { // choose applicationto if (App == "BLYNK" || App == "BOTH") { // choose applicationand then change line 53 from } else if (App == "Thingspeak") {to } if (App == "Thingspeak" || App == "BOTH") {Note that you have to remove the "else" from this line, and (preferably) break it into 2 lines so that the first "if" statement is terminated and the second one is an independent "if" statement. That way they are both executed if the value of App is "BOTH". And then over in the PTHsleep.h file, you do a similar thing in the code for the measurementEvent() function. I am not sure how familiar you are with writing code, but this should get you started at least. Feel free to ask more if you have trouble. Keith

    View Instructable »
  • Solar Powered WiFi Weather Station V1.0

    Hi ГеннадийБ2 I want to be sure you have connected the restart link in the hardware. D0 has to be connected to RST pin. Otherwise the software will run once and then sleep forever. It could be that having the USB connected allows it to restart (I am not at all sure about that). Anyway please check and let me know if that connection is there in your hardware. If it is not, put the link in and see if the problem goes away. You say you "corrected the sketch a little". Maybe you can tell me what you changed: or try running the original software without any changes and see what it does. When I look at my copy of this software, it is file PTH.sleep.h in line 45 that there is a line:Blynk.virtualWrite(4, volt); // virtual pin 4Is this the "51 lines&qu...

    see more »

    Hi ГеннадийБ2 I want to be sure you have connected the restart link in the hardware. D0 has to be connected to RST pin. Otherwise the software will run once and then sleep forever. It could be that having the USB connected allows it to restart (I am not at all sure about that). Anyway please check and let me know if that connection is there in your hardware. If it is not, put the link in and see if the problem goes away. You say you "corrected the sketch a little". Maybe you can tell me what you changed: or try running the original software without any changes and see what it does. When I look at my copy of this software, it is file PTH.sleep.h in line 45 that there is a line:Blynk.virtualWrite(4, volt); // virtual pin 4Is this the "51 lines" you are referring to? I guess you may have added some lines before this in that file.Keith

    View Instructable »
  • Solar Powered WiFi Weather Station V1.0

    Hi ГеннадийБ2 I think your problem is probably in the software. You do not say what software you have loaded. Have you tried using the software that is included in the Version 2.0 Instructable for this project? It includes code for measuring voltage, unlike the V1.0 software which does not have the voltage measurement in it. The V2.0 software should work with the hardware of the V1.0 design and the additional connection you have described.Keith

    View Instructable »
  • ARDUINO SOLAR CHARGE CONTROLLER ( Version 2.0)

    Hi anupamdg, Re LM35, I agree with you it would be better if the LM35 were connected remotely so it can be phycially associated with the battery. For many environments this will be a very small improvement over mounting it with the controller, since the battery and controller ware generally in the same environment. Note that the LM35 is connected to Arduino pin A3. This is not shown in the V2.0 schematic. Re "more MOSFETs on the solar side" - what problem are you trying to solve?Keith

    View Instructable »
  • 1602 LCD Keypad Shield Module With I2C Backpack

    Hello DannyG94 aka the_paradox_.Yes you can put multiple devices on the same I2C bus using the same SDA and SCL pins, provided you check that each device uses a different I2C address. The address or addresses used by any I2C device is defined by its manufacturer. You can usually find it in the data sheet of the device, although sometimes it requires a fair bit of hunting and understanding. In the specific case of the I2C backpack (I2C address 0x27) and DS3231 (I2C address 0x68) there is no conflict so they can share the same I2C bus. If you look on my github repositories you will find one for an I2C scanner that identifies at least some of the devices that correspond to each I2C address, when that address is found on the bus being tested. The link to the scanner is https://github.com/f...

    see more »

    Hello DannyG94 aka the_paradox_.Yes you can put multiple devices on the same I2C bus using the same SDA and SCL pins, provided you check that each device uses a different I2C address. The address or addresses used by any I2C device is defined by its manufacturer. You can usually find it in the data sheet of the device, although sometimes it requires a fair bit of hunting and understanding. In the specific case of the I2C backpack (I2C address 0x27) and DS3231 (I2C address 0x68) there is no conflict so they can share the same I2C bus. If you look on my github repositories you will find one for an I2C scanner that identifies at least some of the devices that correspond to each I2C address, when that address is found on the bus being tested. The link to the scanner is https://github.com/farmerkeith/I2CScannerKeith

    View Instructable »
  • ARDUINO SOLAR CHARGE CONTROLLER ( Version 2.0)

    Hi anupamdg, The LCD has an I2C interface and is connected to power (5V and GND) and the SDA and SCL lines are connected to A4 and A5 on the Arduino. That is, SDA should be connected to A4. SCL should be connected to A5. Once you make that connection, your LCD should come to life. Keith

    View Instructable »
  • 1602 LCD Keypad Shield Module With I2C Backpack

    Hi The_paradox_, It does sound like an ambitious project. However if you can attack it a little bit at a time, you may be surprised at what you can achieve. There are a lot of people willing to support projects like this, and you can learn a lot.I suggest you put "Arduino library menu" into your search engine and follow the links that come up. Keith

    View Instructable »
  • 1602 LCD Keypad Shield Module With I2C Backpack

    Hi The_paradox_, My first and very quick guess is that it might be backlight or contrast problems. Is the backlight coming on? You will not see anything with it off. And then, have you tried adjusting the contrast setting? This is the main cause of not seeing the characters. Please let me know if you find one of these to be the problem, or ask again if you still cannot see the characters. Good luck, Keith

    View Instructable »
  • ARDUINO SOLAR CHARGE CONTROLLER ( Version 2.0)

    Hi av1483110, Are you using diode MBR2045 as per the circuit diagram? If you are, and it is getting too hot for comfort, you can put a heat sink on it; or you can put two of these diodes in parallel, which will divide the current, and the heat, between them and reduce the temperature rise. Another option is to use a MOSFET diode instead of the MBR2045, although I doubt if the extra complexity is justified. For info about MOSFET diodes, please see https://github.com/farmerkeith/circuits/tree/maste...

    View Instructable »
  • Solar Powered WiFi Weather Station

    Hi tj_314, You are correct about the VCC, GND, SCL and SDA pins, they are the same on the 6-pin and 4-pin devices. For the other 2 pins, connect CSB to VCC, and SD0 (which is actually SDD) to GND. The software is not affected. For more complete details on this and other matters about the BME280, please see my Instructable on the subject at https://www.instructables.com/id/Library-for-BMP28...This Instructable includes a connection diagram for the module and a link to a scanner that can tell you whether you have a BMP280 or a BME280 device.

    View Instructable »
  • 1602 LCD Keypad Shield Module With I2C Backpack

    Hi TarasS2, I am not sure about your question. Please check Step 3, and ask for help if it is not clear. Keith

    View Instructable »
  • farmerkeith commented on farmerkeith's instructable Controlling DC Converter Modules7 months ago
    Controlling DC Converter Modules

    Hi mr-apoptosis, Interesting question.When you control the output of the converter with PWM generated by a microcontroller, you can use any arbitrary algorithm to determine the PWM duty cycle. So, for example, if the microcontroller has measurements of both output voltage and current, the algorithm can simultaneously put a limit on both voltage and current. This would achieve the equivalent of the built-in voltage and current pot settings. Since these converters have a built-in current sense resistor between the IN- and OUT- terminals, and the output current and only the output current flows through that resistor, the simplest implementation of current measurement is to put an op-amp such as AD822 or LM358 with suitable gain setting across those terminals and connect its output to an ...

    see more »

    Hi mr-apoptosis, Interesting question.When you control the output of the converter with PWM generated by a microcontroller, you can use any arbitrary algorithm to determine the PWM duty cycle. So, for example, if the microcontroller has measurements of both output voltage and current, the algorithm can simultaneously put a limit on both voltage and current. This would achieve the equivalent of the built-in voltage and current pot settings. Since these converters have a built-in current sense resistor between the IN- and OUT- terminals, and the output current and only the output current flows through that resistor, the simplest implementation of current measurement is to put an op-amp such as AD822 or LM358 with suitable gain setting across those terminals and connect its output to an ADC input of the microcontroller. The op-amp needs to be capable of outputs down to ground, and inputs a little bit below ground. For an example of this current sense op-amp circuit, have a look at https://github.com/farmerkeith/SolarChargerSZBK07M...Please note that this circuit is not exactly what I describe above, since the current sense is set up to measure INPUT current rather than output current. However the op-amp configuration is the sort of thing you would need. Keith

    View Instructable »
  • Solar Powered WiFi Weather Station

    Hi diy_bloke, The CH340 chip has a sleep mode. Are you sure it is not used? It would make a big difference. As I understand it, the current consumption budget looks something like this:Component Operation mode Sleep modeESP8266 170 mA 10 uACH340 12 mA 50 uALED built in 3 mA 0 uAVoltage monitor 0.006 mA 6 uATotal 185 mA 66 uADo you think these numbers are about right?Clearly if the CH340 sleep mode is not used, its current would dominate during ESP8266 sleep mode. If the ...

    see more »

    Hi diy_bloke, The CH340 chip has a sleep mode. Are you sure it is not used? It would make a big difference. As I understand it, the current consumption budget looks something like this:Component Operation mode Sleep modeESP8266 170 mA 10 uACH340 12 mA 50 uALED built in 3 mA 0 uAVoltage monitor 0.006 mA 6 uATotal 185 mA 66 uADo you think these numbers are about right?Clearly if the CH340 sleep mode is not used, its current would dominate during ESP8266 sleep mode. If the sleep-wake cycle is 10 minutes, with a 30 second wake time, the energy consumption budget looks like this:Wake time 185 mA for 0.5 minues = 92.5 mA-minutesSleep time 0.066 mA for 9.5 minutes = 0.627 mA-minutesTotal in 10 minutes = 93.13 mA-minutesThat is, an average of 9.3 mA.If the CH340 sleep mode is not used, this rises by about 12 mA to about 21 mA. It seems that removing the battery voltage monitor and/or the LED does not make much difference. Keith

    View Instructable »
  • ARDUINO SOLAR CHARGE CONTROLLER ( Version 2.0)

    Hi VaibhavV26, This project is designed for a 12Volt lead acid battery, and a nominal 12 Volt solar panel of up to 10 amps. If you want to run it at the ffull 10 amps you will need to be very diligent about the heat sinking of the main current carrying components (diode, mosftet). An alternative is a 6 volt battery and a nominal 6 Volt solar panel, also up to 10 Amps. Solar panels are usually descrived by their power rating at the maximum power point (MPP). So for a 12 Volt panel, with MPP voltage of 18V and MPP current of 10A, the power rating would be 180W. This is the maximum you could use with this controller. Keith

    View Instructable »
  • Solar Powered WiFi Weather Station

    Ni MarioV98, My guess is that increasing the reporting interval should solve the problem. I am currently using 10 minutes.According to my interpretation of this web site http://globalsolaratlas.info/?c=38.410558,408.3398... you should need about twice as much solar panel as me for the same reporting interval (I am in Eastern Australia). This web site may not be the best design guide, since it does not show day-to-day variability, but at least it gives a starting point.Keith

    View Instructable »
  • Solar Powered WiFi Weather Station

    Hi MarioV98, I think your problem is that the solar panel is not big enough to keep up with the energy usage of the WeMos. It will not be solved by using a bigger battery, all that will do is make it take longer to go flat. I think you have two options: a) increase the solar panel (eg add a second panel in parallel to the first one); or b) use sleep mode so that the Wemos goes to sleep in between readings, which saves a lot of energy. There are quite a lot of other discussions about using sleep mode in this project. I suggest you have a look at those, and if you can't figure out what to do please come back for more guidance. Keith

    View Instructable »
  • Solar Powered WiFi Weather Station

    Hi BartM27, There are lots of warnings "out there" about ESP8266 needing to be protected from voltages higher than its ratings. It may be you can get away with direct connection, but to be sure of not having troubles the divider is a good bit of insurance. Usually a 1K resistor to the Echo pin, a 2.2K to ground, with the junction to the ESP8266 pin is what is used. But really, just running the JSN-SR04T at 3.3V will be much simpler. Keith

    View Instructable »
  • ARDUINO SOLAR CHARGE CONTROLLER ( Version 2.0)

    Hi fonetainer, I think the lcd library you are using has a problem. Maybe an error in the file download, or maybe a bad version. I suggest you delete the current one and reinstall it. You can probably remove the "POSITIVE" from the function call without affecting how it works, but I think this is not your real problem, which is something to do with the library.Keith

    View Instructable »
  • Solar Powered WiFi Weather Station

    Hi BartM27, According to the data sheet, JSN-SR04T will work with supply voltages from 3.0 to 5.5V, so you don't need to boost the supply voltage to it. You can simply connect it to the same power rail as the WeMos. It is possible to provide 5V to the JSN-SR04T but it will make the circuit a lot more complicated and will use more power, so if it is not necessary it is best to avoid it. The solution is to use a boost converter (readily available from vendors on eBay, Aliexpress, etc.) to create 5V from the battery rail, and then insert a resistive divider between the Echo pin of the JSN-SR04T to protect the ESP8266 in the WeMos from the higher pulse voltage coming back from the JSN-SR-04. The trigger pin can be connected directly. If you are using one of the sensors with a combined Echo ...

    see more »

    Hi BartM27, According to the data sheet, JSN-SR04T will work with supply voltages from 3.0 to 5.5V, so you don't need to boost the supply voltage to it. You can simply connect it to the same power rail as the WeMos. It is possible to provide 5V to the JSN-SR04T but it will make the circuit a lot more complicated and will use more power, so if it is not necessary it is best to avoid it. The solution is to use a boost converter (readily available from vendors on eBay, Aliexpress, etc.) to create 5V from the battery rail, and then insert a resistive divider between the Echo pin of the JSN-SR04T to protect the ESP8266 in the WeMos from the higher pulse voltage coming back from the JSN-SR-04. The trigger pin can be connected directly. If you are using one of the sensors with a combined Echo and Trigger pin, you would need to use a bidirectional level converter for it. I provide this information to illustrate that it is possible. However I am pretty sure it is not necessary, and direct connection should work without these complications.Keith

    View Instructable »
  • ARDUINO SOLAR CHARGE CONTROLLER ( Version 2.0)

    Hi fonetainer, You seem to have a lot of problems with this software upload. Are you able to upload a simple sketch to your Arduino? eg the Blink example in the standard distribution. Once that is OK, you need to check what library (if any) you have for the LCD. It should be LiquidCrystal_I2C.h although there are several different versions of this library and some work better than others. You may need to change versions if it will not work with the one you have. However first just getting the loading correct and post your new error messages would be a good step. Keith

    Hi fonetainer, Sorry about slow reply, I am away from home (I am in Central Australia) and my internet access and available time are only occasional. Yes those I+, I- points are for the corresponding pins of the ACS712 module. The logic side pins of the ACS 712 must be connected: 5V pin to 5V supply, GND pin to Ground and data pin to Arduino pin A2. The P6KE36CA is a transient suppressor diode. You can use another transient suppressor diode for a higher voltage; or if you can't get this type of diode you can use a zener diode of a similar voltage (eg 36 volts or higher). Keith

    Hi StergiosZ, The real answer to this question is pretty complicated. There are many pieces of information not provided in your question which are needed to provide a good answer. Is your 300W load continuously On? At 12V, to provide 300W we need 300/12=25 Amps. What battery capacity do you plan? What solar panel capacity do you plan? If you have grid power, why do you want to use a solar panel? Is the reason economic (solar is cheaper)? and if so do you want to hit the optimum cost point for your climate and battery size and panel size?This PWM controller is not very suitable for loads of this size. You would probably be better off with an MPPT controller, which will give you more energy from your panels. If you can give more information, I may be able to advise you more constructively...

    see more »

    Hi StergiosZ, The real answer to this question is pretty complicated. There are many pieces of information not provided in your question which are needed to provide a good answer. Is your 300W load continuously On? At 12V, to provide 300W we need 300/12=25 Amps. What battery capacity do you plan? What solar panel capacity do you plan? If you have grid power, why do you want to use a solar panel? Is the reason economic (solar is cheaper)? and if so do you want to hit the optimum cost point for your climate and battery size and panel size?This PWM controller is not very suitable for loads of this size. You would probably be better off with an MPPT controller, which will give you more energy from your panels. If you can give more information, I may be able to advise you more constructively.Keith

    View Instructable »
  • ARDUINO SOLAR CHARGE CONTROLLER ( Version 2.0)

    Hi AdhiN4, You obviously have a different version of the software from me. Google Translate tells me that the comment that is in your code is Indonesian and they translate it as "loop to read the rough value of adc". The version in this Instructable, written by deba168 and which I am looking at, has comments in English and more of them. The corresponding comment in that code says { // loop through reading raw adc values AVG_NUM number of times which I think is a bit more informative than the English translation of the Indonesian comment.The purpose of this code is to smooth out any noise that my be getting into the voltage readings. If you look in the preamble section, you will see that AVG_NUM is defined as 10. So this bit of code makes 10 measurements of whichever pin it is...

    see more »

    Hi AdhiN4, You obviously have a different version of the software from me. Google Translate tells me that the comment that is in your code is Indonesian and they translate it as "loop to read the rough value of adc". The version in this Instructable, written by deba168 and which I am looking at, has comments in English and more of them. The corresponding comment in that code says { // loop through reading raw adc values AVG_NUM number of times which I think is a bit more informative than the English translation of the Indonesian comment.The purpose of this code is to smooth out any noise that my be getting into the voltage readings. If you look in the preamble section, you will see that AVG_NUM is defined as 10. So this bit of code makes 10 measurements of whichever pin it is told to look at, adds all the measurements together, and divides the total by 10, thus getting the average of the readings rounded down to the nearest integer, which it returns as its result. If you need more clarification, or explanation, don't hesitate to ask again. Keith

    View Instructable »
  • ARDUINO SOLAR CHARGE CONTROLLER ( Version 2.0)

    Hi AdhiN4, It is a bit of a puzzle. It is not clear why the battery voltage seems to be jumping around. I would like you to try the following:a) in the function called void print_data(void) add 2 new statements just ahead of the first Serial.print statement, as follows:Serial.print("Time is "); Serial.println((float)millis()/1000,3);b) in the function called void charge_cycle(void) add 2 new statements right at the top (before the first test, but after the opening brace:Serial.print("bat_volt=");Serial.println(bat_volt);c) Instead of capturing a screen shot, press the button at the bottom left of the screen to stop it scrolling, and select a couple of screens full of the output, copy to your clipboard (edit copy) and paste it into a posting. That will give a sequenc...

    see more »

    Hi AdhiN4, It is a bit of a puzzle. It is not clear why the battery voltage seems to be jumping around. I would like you to try the following:a) in the function called void print_data(void) add 2 new statements just ahead of the first Serial.print statement, as follows:Serial.print("Time is "); Serial.println((float)millis()/1000,3);b) in the function called void charge_cycle(void) add 2 new statements right at the top (before the first test, but after the opening brace:Serial.print("bat_volt=");Serial.println(bat_volt);c) Instead of capturing a screen shot, press the button at the bottom left of the screen to stop it scrolling, and select a couple of screens full of the output, copy to your clipboard (edit copy) and paste it into a posting. That will give a sequence showing the transitions between states on multiple cycles. Keith

    I now understand you are saying, that if I label the first (left) screenshot 1, and the top half 1a and the bottom half 1b, then the sequence is 1a 1b 1a 1b 1a 1b ... and so on, when there is not much illumination; and that it changes to 2a 2b 2a 2b 2a 2b ... when there is full sun. Is that correct?

    Hi AdhiN4, Based on that understanding,

    View Instructable »
  • ARDUINO SOLAR CHARGE CONTROLLER ( Version 2.0)

    Hi fonetainer, If you want to handle more power, it makes sense to go to a MPPT type of charger rather than a PWM charger. It is not that a PWM charger cannot handle more current, just that the amount of energy you will be losing will become sufficient to repay the extra cost of the more complext MPPT charger. Although I do not recommend it, to allow this PWM controller to handle more current, you would need to a) yes use a 20Amp ACs712and b) replace the MOSFETs with a different type with a lower RdsON, such as IRF4905 (instead of IRF9540). Keith

    Hi AdhiN4, I think you need to take a systematic step-by-step approach to working out the problem. You at least need a multimeter to measure voltages, and have your computer connected so you can put in some Serial.print() commands to check what the software is doing. If the battery is connected, but no solar panel, do you get what you expect? Are the voltages from the multimeter consistent with what the software sees. If not you should adjust the calibration factors in the software until they are close. When this part is right, connect your solar panel and use a shade over the solar panel to control its output. Get its voltage on the multimeter and in the software to be consistent. The charger behaviour mainly depends on solar_volt and bat_volt and its relationship to bulk_charge_sp an...

    see more »

    Hi AdhiN4, I think you need to take a systematic step-by-step approach to working out the problem. You at least need a multimeter to measure voltages, and have your computer connected so you can put in some Serial.print() commands to check what the software is doing. If the battery is connected, but no solar panel, do you get what you expect? Are the voltages from the multimeter consistent with what the software sees. If not you should adjust the calibration factors in the software until they are close. When this part is right, connect your solar panel and use a shade over the solar panel to control its output. Get its voltage on the multimeter and in the software to be consistent. The charger behaviour mainly depends on solar_volt and bat_volt and its relationship to bulk_charge_sp and float_charge_sp. If the battery voltage is less than the float charge set point (ie float_charge_sp) the PWM duty cycle should be high and the solar panel voltage should be only a little bit higher than the battery voltage. and the panel should be producing its full current capability. If the battery voltage is higher than the bulk charge set point, the PWM duty cycle should be low and the solar panel voltage should be at close to its open circuit value and several volts higher than the battery voltage with almost no current.I hope this helps. good luck,Keith

    Hi fonetainer, if you look at the schematic diagram which is attached at the end of Step 2, you will see several little connector flags with labels like A0, A1, ... D1, D2, .... These flags with An and Dn are all connections to the Arduino pins which have the same names on the Arduino nano module. The Arduino Nano also has +5V and GND connections (to its 5v and GND pins). Not all of the Arduino Nano pins have connections. If you have any confusion about which connections to make, feel free to ask about them. Keith

    Hi AdhhiN4, Can you please post a sample of your serial monitor output at a time when this blinking is happening? Keith

    View Instructable »
  • ARDUINO SOLAR CHARGE CONTROLLER ( Version 2.0)

    Hi AdhiN4, It seems to me that you have made progress towards what you want, but the logic needs a bit of fixing. Two suggestions:a) Have a look at some of the examples provided with the Arduino IDE. I think the most relevant one is called Debounce; look for it in Files/Examples/Digital. b) Add some (temporary) debugging printouts to your code so you can see what is happening. For example, add a line like: Serial.print ("Line 340 bat_volt="); Serial.println(bat_volt);A few lines like this will let you see what your software is doing. The line number is there so you can easily identify at what point in the code it is checking, and also makes it easy to find the code when you have it working and want to delete all the temporary print commands. If you continue to have trouble, p...

    see more »

    Hi AdhiN4, It seems to me that you have made progress towards what you want, but the logic needs a bit of fixing. Two suggestions:a) Have a look at some of the examples provided with the Arduino IDE. I think the most relevant one is called Debounce; look for it in Files/Examples/Digital. b) Add some (temporary) debugging printouts to your code so you can see what is happening. For example, add a line like: Serial.print ("Line 340 bat_volt="); Serial.println(bat_volt);A few lines like this will let you see what your software is doing. The line number is there so you can easily identify at what point in the code it is checking, and also makes it easy to find the code when you have it working and want to delete all the temporary print commands. If you continue to have trouble, post your code so I can work out what the problem is. Keith

    View Instructable »
  • ARDUINO SOLAR CHARGE CONTROLLER ( Version 2.0)

    Hi AdhiN4, The additional code for the push button is going to be in the function void load_control () which in my version 2.0 of the software is at line 334+. But you need to be a bit clearer about how the button will operate. For example, do you want one push of the button to turn the load on, and a second push to turn the load off? One alternative is to wait for the next daytime (ie with solar_volt >5) and turn the load off then. I think you first need to clearly define how you want the button and the existing load control to interact. You will also need to decide which Arduino pin will sense whether the button is pushed or not. Keith

    View Instructable »
  • ARDUINO SOLAR CHARGE CONTROLLER ( Version 2.0)

    Hi AdhiN4, I think the current fuse (in series with the solar panel) is in the wrong place. If a solar panel is short circuited it will generate current not much higher than its maximum power point current and there will be no damage to any component. In this design, it would be better to put the fuse in series with the battery, which can generate very high and potentially damaging currents if it is short circuited. As for whether your windmill needs a fuse, that depends on its design. It is probably a good safety practice to put in a fuse if you are not sure.Keith

    Hi AdhiN4, It is a calibration problem. There are several factors that affect the results displayed on the LCD: resistor tolerances in the resistive dividers and the power voltage supplied to the Arduio being the main ones.. I think the best solution is to adjust the multiplier used in the voltage calculation in the software. In the function "void read_data (void)" (about line 150 in my copy) is where you will find the calibration constants for the 4 different measurements used. For example one of them is:solar_volt = read_adc(SOL_ADC)*0.00488*(120/20);You should change the value of 0.00488 to another value based on the ratio of the measured and displayed voltages. For example, if your multimeter reads Vm and the LCD shows Va, calculate Cnew = 0.00488 * Vm / Va and use that...

    see more »

    Hi AdhiN4, It is a calibration problem. There are several factors that affect the results displayed on the LCD: resistor tolerances in the resistive dividers and the power voltage supplied to the Arduio being the main ones.. I think the best solution is to adjust the multiplier used in the voltage calculation in the software. In the function "void read_data (void)" (about line 150 in my copy) is where you will find the calibration constants for the 4 different measurements used. For example one of them is:solar_volt = read_adc(SOL_ADC)*0.00488*(120/20);You should change the value of 0.00488 to another value based on the ratio of the measured and displayed voltages. For example, if your multimeter reads Vm and the LCD shows Va, calculate Cnew = 0.00488 * Vm / Va and use that.Keith

    View Instructable »
  • Solar Powered WiFi Weather Station

    Hi Deba168, Certainly the schematic is right. I can't see all of the connections in the pictures of the PCB layout (which seem to be the same, I expected them to be for the 2 different sides of the board). Keith

    View Instructable »
  • ARDUINO SOLAR CHARGE CONTROLLER ( Version 2.0)

    Hi fonetainer, You are missing two files. The first one is in the same repository as the software you are trying to compile. That is, https://github.com/farmerkeith/SolarChargerSZBK07M...The second one, RepeatEvery.h can be found at https://github.com/farmerkeith/executionControl/tr...Both of these files can be put into the same directory as the MPPT_SZBK07.ino file. Keith

    I omitted to answer about the LCD. You can choose any type that you want. The 2-line, 16 character displays are very inexpensive but quite restricted because they only have 2 lines. The other main option is a 4 line, 20 character display, which is more expensive but still quite affordable. Whichever one you choose, I suggest you get it with a serial backpack to conserve pins on your Arduino. Some of these modules can be puchased with the serial backpack pre-installed. If you buy the backpack separately, you can wire them yourself. If you need to do this, have a look at https://www.instructables.com/id/1602-LCD-Keypad-S...Keith

    Hi fonetainer, If you have the V2.0 PWM controller by deba168 as per this Instructable, you should be able to add a LCD to display voltages and currents. I suggest you use an LCD with serial backpack, so you can connect it to the Arduino Nano used in this controller. Your "also" project sounds like a lot more of a challenge. I think you need to start with the load energy you want to supply over night, and use that to size your battery, and from that you can work out the amount of solar panels you require. Have a look at this design which may be closer to what you have in mind.https://github.com/farmerkeith/SolarChargerSZBK07ModuleKeith

    Hi fonetainer, There is no content in the file SZBK07.kicad_pcb, so it won't help you much to open it. I put all the files that KiCad produced in the repository, but I have not done a PCB for this design so the pcb file is just a stub generated by KiCad with no contents.I don't know if you can run KiCad on your Mac. If you can, you should be able to open these files with it. I am using Linux so I am not familiar with using a Mac.

    View Instructable »
  • Solar Powered WiFi Weather Station

    Hi Deba168, Your schematic is correct. You do not have any choice for where the voltage divider ground goes, it is on the WeMos board and goes to the common ground on the board, which is OUT- on the TP4056 module. When the battery is charged and its voltage is above the drop-out value (about 2.8 V) the DW01 protection circuit on the TP4056 module connects the OUT- to B- and the voltage difference between the two will be very small. Also, on the TP4056 module, B+ and OUT+ are connected together, so it does not matter whether the top end of your divider goes to B+ or OUT+ (or even "5V" of the WeMos module). They are all the same voltage.Keith

    Hi Deba168, I did not think of this until you asked about PCB design. a) you could make the board compatible with sleep mode by connecting D0 to RST, either directly with a track (easiest) or via a solder link so that the user can choose to put in the connection or not. More fancy again: Since I expect the default mode will be to have the connection, you could make it a track and on the silk screen write an arrow and "drill here to break D0-RST". This is probably a bit extreme. As you will have observed there has been a lot of correspondence about using sleep mode so it is of interest to many people. b) I think it would be very valuable to make the board compatible with BOTH the 4-pin and the 6-pin versions of the BMP280 / BME280. Even though you wrote BMP280 on the silk scre...

    see more »

    Hi Deba168, I did not think of this until you asked about PCB design. a) you could make the board compatible with sleep mode by connecting D0 to RST, either directly with a track (easiest) or via a solder link so that the user can choose to put in the connection or not. More fancy again: Since I expect the default mode will be to have the connection, you could make it a track and on the silk screen write an arrow and "drill here to break D0-RST". This is probably a bit extreme. As you will have observed there has been a lot of correspondence about using sleep mode so it is of interest to many people. b) I think it would be very valuable to make the board compatible with BOTH the 4-pin and the 6-pin versions of the BMP280 / BME280. Even though you wrote BMP280 on the silk screen, your version actually uses a BME280 as I understand it. The first 4 pins of the 6-pin version of the BMP280 module are identical to the 4 pins of the 4-oin version. The extra pins on the 6-pin module are CSB and SD0. I provided instructions about them in the hardware section of my instructable on the BMP280 library https://www.instructables.com/id/Library-for-BMP28...Anyway, to use the I2C interface, CSB has to be connected to Vdd.The SD0 pin provides address control for the I2C interface, and can be connected to ground or to Vdd. Usually it will be connected to Ground so I think that would be fine for your PCB. If you wanted to give the user the full possibilities, you could include a solder link to enable either connection. These are just ideas. You did ask. Regards,Keith

    View Instructable »
  • ARDUINO SOLAR CHARGE CONTROLLER ( Version 2.0)

    Hi HakimA14, There are many circuit simulators "out there", mostly based on the "spice" simulation method. Your choice partly depends on what operating system you are running. In my own work I have been successful in using ngspice with KiCad. KiCad is used to draw the schematic circuit and produce a "netlist" suitable for spice. Ngspice is used to do the simulation. All this is running on my T420 laptop computer using Manjaro Linux. These software packages are free and open source. I found there were some incompatabilities between the KiCad netlist output and the ngspice input requirements, which I have solved using a shell script called "ng" which uses sed to do the translation. You can find all of this work, including many sample circuits and s...

    see more »

    Hi HakimA14, There are many circuit simulators "out there", mostly based on the "spice" simulation method. Your choice partly depends on what operating system you are running. In my own work I have been successful in using ngspice with KiCad. KiCad is used to draw the schematic circuit and produce a "netlist" suitable for spice. Ngspice is used to do the simulation. All this is running on my T420 laptop computer using Manjaro Linux. These software packages are free and open source. I found there were some incompatabilities between the KiCad netlist output and the ngspice input requirements, which I have solved using a shell script called "ng" which uses sed to do the translation. You can find all of this work, including many sample circuits and simulation results, on my github circuits repository: https://github.com/farmerkeith/circuitsKeith

    Hi AdhiN4, You cannot (or should not) just connect the windmill and PV panel in parallel. Nor do you need to duplicate the entire charger. Currently the input from the solar panel is connected to a transient surge suppressor, a voltage divider for voltage measurement, then through a power diode MBR2045. Your windmill input should have a duplicate set of those components. The cathodes of the two MBR2045 diodes will be connected together. This is to prevent the PV panel from taking current from the windmill when it is dark, and the to prevent the windmill from taking current from the PV panel when the wind is not blowing. You will also need to make corresponding changes to the software to take the higher of the two input voltages (PV and wind). Keith

    Hi fonetainer, Yes you can use this controller with a 100W solar panel. You panel is at the top end of the capabilities of this controller. You may want to consider using an MPPT controller such as https://github.com/farmerkeith/SolarChargerSZBK07... (although this is not in a "plug and play" status as yet.Keith

    View Instructable »
  • Solar Powered WiFi Weather Station

    Hi Glasgowbrian,Your serial monitor output and your mobile phone showing disconnection seem perfectly normal to me. The serial monitor output shows the initiation of a connectionn to the Blynk cloud server and its success. then your measurements. Then I presume your Wemos goes to sleep, which breaks the connection to the Blynk cloud and it shows on your mobile phone as a discconnection. My question is, after the delay you have set, does the Wemos wake up and go through the whole process again? If not, did you connect the D0 and RST pins?Keith

    No worries Glasgowbrian. Keith

    View Instructable »
  • ARDUINO MPPT SOLAR CHARGE CONTROLLER (Version-3.0)

    Hi NorthC2, Yes this circuit, using the XL4016, can be used for that.Keith

    View Instructable »
  • 1602 LCD Keypad Shield Module With I2C Backpack

    Hi clemenlg, Your wiring in the photo looks correct to me, so it is not obvious what might be wrong. Do you have the exact same modules that are specified in the Instructable? There are several different ones on the market. If the backlight does not come on, you will not be able to see the characters in the display. So that is the first thing you need to get working. I have the following suggestion. In the setup() section, after lcd.setBacklight(LOW);I suggest you add:delay(1000);lcd.setBacklight(HIGH);delay(1000);lcd.setBacklight(LOW);And see if the backligh comes on briefly. That will indicate that the polarity is back to front. Good luck. Please let us know if that is the problem. Keith

    View Instructable »
  • ARDUINO SOLAR CHARGE CONTROLLER ( Version 2.0)

    Hi JosephC298, Yes it can be used for a 12V 60AH battery. The limitations of the charger are for the charging current and load current.

    View Instructable »
  • ARDUINO SOLAR CHARGE CONTROLLER ( Version 2.0)

    Hi AhhiN4, There are no guarantees with this, but if you want to handle higher currents then you should change the MOSFETs IRF9540 for MOSFETs with a lower ON resistance, such as IRF4905. You should probably also duplicate the power diode MBR2045. It may also be necessary to upgrade the driver circuit for the gate of MOSFET Q1, to reduce its switching time.

    View Instructable »
  • ARDUINO MPPT SOLAR CHARGE CONTROLLER (Version-3.0)

    Hi NorthC2, The A4 and A5 pins on the Arduino are used for the I2C bus. An I2C bus can interface to many devices, because it uses a device address as part of its protocol. In this design it is used for the RTC and the LCD display. If you do not need the real time clock (RTC), then you can remove it. I put the RTC in the circuit so that the data logging function (on the micro SD card) can include time and date stamps on the data records. You should be aware that if you remove the RTC, it is currently providing the pull-up resistor for the D2 line used for the temperature sensor, and you will need to add a resistor from D2 to +5V. The resistor value can be 3.3K or 4.7K or thereabouts. You may need a lower value if you have very long wires to your DS18B20.

    View Instructable »
  • farmerkeith commented on deba168's instructable Solar Powered WiFi Weather Station 11 months ago
    Solar Powered WiFi Weather Station

    Hi AlekseyFedorovich, I think that diode is not required.

    View Instructable »
  • ARDUINO SOLAR CHARGE CONTROLLER ( Version 2.0)

    Hi David_0519, Here is a sample sketch with a filter function which I think will do what you have asked for. Copy the filter() function out of this sketch into your code before the setup() section. Then in void lcd_display() replace the following llinelcd.print(temperature);with lcd.print(filter(temperature));If that is not clear, or if you have trouble with it, please post your amended code so I can help you get it working.Keith

    View Instructable »
  • ARDUINO MPPT SOLAR CHARGE CONTROLLER (Version-3.0)

    Hi NorthC2, I drew the ACS712 module myself. Its definition is in the xxx-cache.lib file in the folder of the schematics that use it. If you have trouble accessing it I can send you the file separately. These cach.lib files are just simple text files, you can edit them with your favourite text editor (I usually use Mousepad). So if you have a file with your personalised KiCad components in it, you can just copy and paste the definition from the cache.lib file into your own personalised file, and it will be available for your own drawings. Keith

    View Instructable »
  • ARDUINO SOLAR CHARGE CONTROLLER ( Version 2.0)

    Yes you should be able to use a 5 watt 6 volt solar panel, so long of course as you are using a 6 volt battery.

    Hi David_0519, Your battery voltage readings are consistent with a fully charged or nearly fully charged lead acid battery, and applying a load that will discharge it in about 5 hours. So it is probably normal. What sort of variation in the temperature display do you experience? If it is just the last digit, it may be just instability in the last bit of the ADC reading causing the reading to fluctuate between (say) 29 and 28. The least significant bit of the ADC is worth almost 0.5C, so a small instability can make it appear to jump 1C. If that is all it is, you can if you like put in a bit of code to filter out the noise.

    View Instructable »
  • ARDUINO MPPT SOLAR CHARGE CONTROLLER (Version-3.0)

    Hi NorthC2, Yes of course you can leave out the mains supply control sub-circuit. If your panel(s), charger and battery as well as the load are on buoys I guess you need to be careful they don't get wet. That would be my main worry I think. Good luck with it! Keith

    Hi VongsatonC, The reason that I have the Mains supply as well as the solar panel is that I was asked to add it by someone I have been helping. I think that for the majority of situations there will be no mains supply available and that part of the circuit should be simply left out. Keith

    View Instructable »
  • ARDUINO SOLAR CHARGE CONTROLLER ( Version 2.0)

    Hi Michele, That 4th TO220 device is the 7805 voltage regulator, that takes in battery voltage (12V) and puts out the regulated 5V supply for the Arduino, ACS712, LEDs etc.Keith

    View Instructable »
  • ARDUINO SOLAR CHARGE CONTROLLER ( Version 2.0)

    Hi sunita patil, I think you need to think carefully about the logic you use to connect and disconnect the mains supply. You can find an example of the sort of hardware connections required in this schematic:https://github.com/farmerkeith/SolarCharger20AmpAs...The bit you need to look at is in the middle part of the diagram. The key components are Q8 and Q9 and the control from Arduino Pin D3 (which can of course be any pin you choose). You can replace the 230V transformer and rectifier with an AC adapter of suitable output voltage and current capacity for your needs. If this is not clear feel free to ask more.

    Hi Ben_21,I think the panel voltage of 0.67 volts is there because of a little bit of reverse leakage current through the NMR2045 diode, and is not a concern. As for the -0.55 Amps of load current showing, and assuming you do not have any load connected, it must be the calibration point of the ACD712 needs adjusting. The ACS712 puts out Vcc/2 on its data pin when the current is zero. This should be 2.5 volts when the Vcc is 5 Volts. The calibration point is set in the software in line 158 (in my copy) which reads "load_current = (read_adc(CURRENT_ADC)*.0488 -25);"The literal value 25 represents the offset current. If you are getting -0.55Amps, and you adjust that literal value to 24.45, you should get a reading of 0 when there is no current. So now the line will read: "l...

    see more »

    Hi Ben_21,I think the panel voltage of 0.67 volts is there because of a little bit of reverse leakage current through the NMR2045 diode, and is not a concern. As for the -0.55 Amps of load current showing, and assuming you do not have any load connected, it must be the calibration point of the ACD712 needs adjusting. The ACS712 puts out Vcc/2 on its data pin when the current is zero. This should be 2.5 volts when the Vcc is 5 Volts. The calibration point is set in the software in line 158 (in my copy) which reads "load_current = (read_adc(CURRENT_ADC)*.0488 -25);"The literal value 25 represents the offset current. If you are getting -0.55Amps, and you adjust that literal value to 24.45, you should get a reading of 0 when there is no current. So now the line will read: "load_current = (read_adc(CURRENT_ADC)*.0488 -24.45);"There are "better" ways to do this, from a software usability perspective, However this is the minimal change that should get you a good result. Please report back if this solves your issues.

    Hi sunita patil, you can find the schematic diagram at the end of Step 2. There is a link there where you can download the pdf. If you have trouble with the link, please ask again.

    View Instructable »
  • farmerkeith commented on deba168's instructable Solar Powered WiFi Weather Station 1 year ago
    Solar Powered WiFi Weather Station

    Hi johweb, I have not had problems with using deep sleep on various instances of Wemos D1 mini pro. Your problem may be in the particular instance of the Wemos you are using - ie a hardware problem. However I am a bit puzzled by your latest message. You say you have added "Serial.println("pass here!") in the setup() section. My question is do you get this message printed on the serial monitor when the WeMos first starts, but not when it wakes up after deep sleep, when you just get junk characters? One possibility is that the junk characters are disguising the message from your software. I suggest you modify your added statement to include a new line, so it reads:"Serial.println("\npass here!")Good luck,Keith

    View Instructable »
  • farmerkeith commented on deba168's instructable Solar Powered WiFi Weather Station 1 year ago
    Solar Powered WiFi Weather Station

    Hi th.deppe. I have not been using the Thingspeak version, but I am sure it is possible to add the Deep Sleep feature to it. Some other users may know it Thingspeak requires a new login at every wake up. Please see my answer to comments below to PitrP with a bit of discussion about the deep sleep options. Also you need to connect the D0 pin to RST on the Wemos board, which is how the sleep timer is able to wake up the processor. If you need more guidance on the details, please reply with your question(s). Keith

    Hi johweb, You are right it is necessary to connect D0 to RST (which I forgot about in my answer to the question under Comments below (from PitrP). Are you using Blynk? If so, it may be that it is taking a long time to re-start the Blynk process. Two suggestions to get started:a) in the setup() section, just after Serial.begin(9600) line, add a new line such as:Serial.println("\n Solar Powered Weather Station");This will tell you whether the software is getting to that point, or getting stuck before that.b) In the early part of the software, there is a line that looks like this:// #define BLYNK_PRINT Serial // debug printing from library enabledJust delete the first two characters (the //) which will make the line active and give you some print outs of how the Blynk connection...

    see more »

    Hi johweb, You are right it is necessary to connect D0 to RST (which I forgot about in my answer to the question under Comments below (from PitrP). Are you using Blynk? If so, it may be that it is taking a long time to re-start the Blynk process. Two suggestions to get started:a) in the setup() section, just after Serial.begin(9600) line, add a new line such as:Serial.println("\n Solar Powered Weather Station");This will tell you whether the software is getting to that point, or getting stuck before that.b) In the early part of the software, there is a line that looks like this:// #define BLYNK_PRINT Serial // debug printing from library enabledJust delete the first two characters (the //) which will make the line active and give you some print outs of how the Blynk connection is proceeding. It seems likely to me that this is where your problem is.Please report back with the results.Keith

    View Instructable »
  • ARDUINO SOLAR CHARGE CONTROLLER ( Version 2.0)

    Hi bipul027, In Step 1, the author specifies battery voltage of 6 or 12 Volts and current of up to 10 Amps. I am a bit doubtful about using it for 10 amps, because the MBR2045 power diode will be dissipating about 10 Watts at that current. I think a more prudent limit for a project that will keep working for a long time would be more like 5 amps. The rated maximum power point voltage of your solar panel has to be about 40% higher than the battery voltage - 17 V for a 12V battery, or 8.5V for a 6 V battery.So, using a limit of 5 Amps and a battery of 12 Volts, your solar panel should be up to 5*17=85 Watts. If you are using a 6V battery, your solar panel can be up to 42.5 Watts. You can probably get away with somewhat higher panel ratings if you live in a climate where perfectly clear da...

    see more »

    Hi bipul027, In Step 1, the author specifies battery voltage of 6 or 12 Volts and current of up to 10 Amps. I am a bit doubtful about using it for 10 amps, because the MBR2045 power diode will be dissipating about 10 Watts at that current. I think a more prudent limit for a project that will keep working for a long time would be more like 5 amps. The rated maximum power point voltage of your solar panel has to be about 40% higher than the battery voltage - 17 V for a 12V battery, or 8.5V for a 6 V battery.So, using a limit of 5 Amps and a battery of 12 Volts, your solar panel should be up to 5*17=85 Watts. If you are using a 6V battery, your solar panel can be up to 42.5 Watts. You can probably get away with somewhat higher panel ratings if you live in a climate where perfectly clear days with bright sunlight are unusual. The storage capacity of your battery can be as high (or as low) as you like. That just determines how long it can supply the load current when the sun is not shining.

    View Instructable »
  • More Activities