MRK WAN 1310 Solar Recharge

A super application! Love that antenna. I’m just using the little thing that comes with the MCU but something better is needed as one moves beyond proof-of–concept.

Glad to add a link to your project in the documentation’s “potential applications” section. Same goes for others who are using the MKR WAN 1310.

You could try connecting the battery (assuming it’s a 3.7V LiPo) to the MKRWAN rather than the DFRobot solar controller. As Vin rises, the battery will start to charge, and since it’s a 3.3V board, will start the program long before reaching Vin of 4.6V.

I suspect that if the board is already fully up and running when 4.6V is reached, it will not switch to boot loader mode, and the problem will go away. Worth a try anyway.

Good specifics. Thanks.

Yes. 2000mah is not much. The solar cell is the "black" kind you mentioned. The present setup does not seem to be recharging the battery as fast as it is being discharged, given the amount of power being used. This plot shows that. The data was broadcast during the experiment that led to my original question.

Sciroccotorc's water meter system is perfect for deep-sleep power-saving methods because it broadcasts a wee bit of data at long intervals. That was the original idea behind my project too, receive-only PC-powered basestation, relays that only receive and rebroadcast, and sensor nodes that only broadcast. Even there, relays are always operating. Lately I have been pushing at the idea that all nodes should receive and broadcast to enable request/response. That requires continuous operation for all nodes and is the source of high power utilization.

Going to investigate better batteries and solar cells, while trying to keep costs under control.

Maybe the Solar Manager is interfering with the charge controller of the MKR WAN 1310.
This is my Graph with a 5volt 20x20cm white panel directly connected to the USB socket of a XIAO ESP32-C. No fancy charge controller.


The battery is recharged within the hour to 4.18volt.
The 3Ah protected battery is also directly connected to the ESP.

I soldered a 10cm tail wire with USB socket to the solar panel for easy plug/play.
And used hot glure to secure it and waterproof it. Added a blob of vaseline in the socket too.
Leo..

I think you’ll find a way round it with suggestions on this forum. It would be a shame to abandon the board - it really is a nice product albeit expensive.

It sounds like you are heading away from the low power concept, but if you did decide to go with broadcast-only nodes, here is the core code that I put together for my node (a bit simplified). This concept works as follows:

  • the MCU spends most of its time in deep sleep mode
  • the RTC wakes the board on whatever time interval you like, no need for an interrupt from an external device
  • loop() runs for one iteration from the first instruction and goes back to sleep
  • RAM contents are preserved during sleep so your counters etc. are still valid
  • the LoRa radio is turned off fully after every transmit cycle to save power
  • sleep current is about 110 microamps (on my system anyway)

Waking current & time is whatever it is but at least the non-transmitting fraction of time has been optimised.

#include "Adafruit_SleepyDog.h"
#include <RTCZero.h>
#include <LoRa.h>
#include <SPI.h>
#include <MKRWAN.h>

/******************************************************************************************************
Start of loop().
Note that loop() and the functions that it calls only run once per waking of the processor, not continuously.
*******************************************************************************************************/
void loop() {                              // Read sensor and transmit data. Note that readSensor() only               
 if (readSensor()){sendData(counter);}     // readSensor() returns true if the counter has changed and if no pulses are currently occurring.
  USBDevice.end();                         // Tidy up and sleep, waking every SLEEPTIME milliseconds to check target position.
  USBDevice.detach();
  int sleepMS = Watchdog.sleep(SLEEPTIME);
}
/******************************************************************************************************


/******************************************************************************************************
Function to transmit the totaliser-counter value over the LORA radio.

*******************************************************************************************************/
void sendData(int i){
  LoRa.begin(915E6);                   // frequency band for AU (915MHz)  
  LoRa.setTxPower(14); 
  LoRa.setSpreadingFactor(7);          // Settings must match for transmitter and receiver.
  LoRa.setSignalBandwidth(500E3); 
  LoRa.beginPacket();
  LoRa.print(i);                       
  LoRa.endPacket();
  LoRa.end();  
  digitalWrite(LORA_RESET, LOW);
  digitalWrite(LORA_BOOT0, LOW);
  pinMode(LORA_RESET, INPUT);
  pinMode(LORA_DEFAULT_SS_PIN, INPUT);
  pinMode(LORA_IRQ_DUMB, INPUT);
  pinMode(LORA_BOOT0, INPUT);  
}
// Code to fully turn off LoRa modem after use taken from:
// https://forum.arduino.cc/t/deepsleep-mode-13ua-without-lora-begin-290ua-with-lora-begin/693605/3

Starting from ~4.07V, so the recharge is ~10% SOC.
Anyway, that's good result with 400mA panel without solar charge circuit early at the morning. Did you go with the default charge current (380mA)?

The charge current is internally set by the XIAO ESP32-C3.
It can't be changed and should be about 370mA.

A shallow battery cycle is good. Always ready for a couple of days bad weather.

Changing the panel from a small black one to a bigger white one did the trick for me.
The 20x20cm panel is actually 800mA. measured in full sun.
I guess a 17x17cm (400ma) should be enough when using deep sleep (which I don't).
Leo..

It's likely set by a resistor...

Ahh, now that makes sense. I was wondering how 400mA panel can work so well with 380mA constant current charger without panel voltage collapsing.

Not a bad idea. Thanks. Have applied 4.5vdc to the charge controller using a power supply instead of the solar cell. The charge controller “recharging” LED is on. After 24 hours, the MKR has still not powered up. (No LEDs are lit.) If I move the MKR to a PC USB then it works as expected.

From the plot, the solar cell never supplied greater than 4.5vdc. I wonder if that is insufficient, although the charge controller claims it operates on 4.5-6.0vdc. Perhaps here is another indication that the solar cell is indeed insufficient, as was suggested earlier.

What are the specs of your panel? Did you measure open circuit voltage (Voc)?

Here is what I understand about the MKR/Solar/Battery/ChargeController setup: The MKR plugs directly into the USB port on the charge controller for power delivery. The controller uses solar to recharge the battery. Although the MKR has the ability to recharge a battery, additional circuitry is needed if a solar cell is added.

I’d be worried about over-voltage from the solar panel unless additional circuitry were involved.

You may well be right about my heading away from low-power applications. That might be true even with just the relays in a simple broadcast/receive network. Your power-saving code is most welcome.

Another milestone along the path of the point you make is the number of sensors and actuators envisioned to be connected to just one sensor/actuator node. and the volume of code involved. That, along with an always-on network, really does push the limits of power management. It is a worthy challenge though.

Indeed, this thread’s discussion is leading in a very positive direction. Have learned a great deal from it. Many thanks to all.

Yes. Good. Something I need to do, along with a heftier battery, beyond 2000mah.

It is a 6W/6vdc black-panel. It was not expensive. Checked VOC with a bright light and it does deliver 6vdc.

Several have mentioned that white-panel solar cells are better. Can someone post a link to an example?

Only use a 5volt panel when you connect it directly to the USB socket.
A 6volt panel outputs about 7.4volt in full sun when the battery is fully charged, which is too much. A 5volt panel stops at 6volt, which should be ok for a USB input.

Count the cells of the panel if you're not sure. Each cell is 0.5volt.
A 5volt panel has 10 cells, or a multiple of that. A 6volt panel has 6 or 12 cells.

True power can be measured, but it's easy to work out by calculating the total cell area of the panel. Google Ai says: A typical silicon solar cell produces around 0.03 watts (30 milliwatts) per square centimeter.

These white panels are all over eBay and other big sites.
Some have USB-C leads already attached, some have mounting brackets, some come bare.
Look closely at the size, which could be more reliable than the advertiser's power rating.
Happy hunting.
Leo..

Bright light or direct sun?

5V panel typically has ~5V Vmpp and ~6V Voc. That's what your solar charger is designed for. Color is irrelevant here, 6W panel is sufficient.
But your observations of max 4.5V connected panel voltage indicates that something doesn't match.

Just try a white 5V/2W or 4W or 6W panel, connected directly to the MKR WAN's USB (no solar controller.
Report back.
Curious what lattitide (country) OP is.
Right-click on Google Maps (first number). I'm on -45.9
Leo..

The MKR WAN 1310 has it's own charge controller, including load sharing fet.


Don't be tempted to connect your 6V panel to the USB socket.
Max input voltage for the linear part of the chip (battery charger) is 6V.