# Solar Powered Low Cost LoRa Node with Integrated Battery Holder

**URL:** <https://www.thethingsnetwork.org/forum/t/solar-powered-low-cost-lora-node-with-integrated-battery-holder/14198>\
**Category:** Hardware\
**Created:** [May 15, 2018, 1:53am UTC](https://www.thethingsnetwork.org/forum/t/solar-powered-low-cost-lora-node-with-integrated-battery-holder/14198 "2018-05-15T01:53:30Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![aizukanne](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/aizukanne/32/35697_2.png) [@aizukanne](https://www.thethingsnetwork.org/forum/u/aizukanne)\
**Post date:** [May 15, 2018, 1:53am UTC](https://www.thethingsnetwork.org/forum/t/solar-powered-low-cost-lora-node-with-integrated-battery-holder/14198/1 "2018-05-15T01:53:30Z")

</div>

I wish to share my designs for a multipurpose LoRa microcontroller board based on the Atmel 328P microcontroller with an RFM95W LoRa module attached and LiPo Battery holder mounted on the reverse side of the board. Details of the design including PCB and BOM are [available here](https://easyeda.com/aizukanne/SmartNode_v3_1-10e707362754462cab5af193b1af5af8).

The version 2, [design details available here](https://easyeda.com/aizukanne/smartnode-v2), adds onboard solar power LiPo charger for the integrated 18650 LiPo battery, using the CN3065. The idea is to provide a Low Cost LoRa module that makes all digital and analog inputs of the Atmel 328P available. This node can be used for prototyping. The board runs on 3.3V and the regulator on board is the MCP1700T-3302E/TT. No power LED is provided to reduce power consumption but an LED is connected to D7 via a 1K resistor.

If you plan to implement this project, remember to flash a bootloader unto the controller. Usually, I do this after the controller has been soldered on the board but before the LoRa module is welded on. This allows you to use the pads where the LoRa module should be to connect to the SPI bus of the controller for flashing.

Below are pictures of the finished version 1. Version 2 boards are currently in production.

![IMG_4](https://www.thethingsnetwork.org/forum/uploads/default/original/2X/6/64cb961fa813a862a6fe0df5ced502e6f87f4b40.jpg)

![IMG_6](https://www.thethingsnetwork.org/forum/uploads/default/original/2X/e/ef6ad3ca420b2babd3e6a12260449cb594e434e5.jpg)

![IMG_1](https://www.thethingsnetwork.org/forum/uploads/default/original/2X/d/d24b29261e5fb3fc035162d1bef293d95f4f6d74.jpg)

![IMG_2](https://www.thethingsnetwork.org/forum/uploads/default/original/2X/7/75ba8a51f4bf989febaed7d4254bd6f77ec75526.jpg)

![IMG_3](https://www.thethingsnetwork.org/forum/uploads/default/original/2X/b/b000e7bb2db027ddd8553110391ba9fe721bd987.jpg)

![IMG_5](https://www.thethingsnetwork.org/forum/uploads/default/original/2X/8/80442914d5aaa459001a25571ae621ec8648bbae.jpg)

Feedback and suggestions for improvement are welcome.

---

<div class="post-metadata">

**Author:** ![MT1](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/m/53a042/32.png) [@MT1](https://www.thethingsnetwork.org/forum/u/MT1)\
**Post date:** [May 15, 2018, 10:53am UTC](https://www.thethingsnetwork.org/forum/t/solar-powered-low-cost-lora-node-with-integrated-battery-holder/14198/2 "2018-05-15T10:53:15Z")

</div>

Good Work.

---

<div class="post-metadata">

**Author:** ![lhanneus](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/lhanneus/32/25844_2.png) [@lhanneus](https://www.thethingsnetwork.org/forum/u/lhanneus)\
**Post date:** [May 22, 2018, 7:36am UTC](https://www.thethingsnetwork.org/forum/t/solar-powered-low-cost-lora-node-with-integrated-battery-holder/14198/4 "2018-05-22T07:36:28Z")

</div>

> I do this after the controller has been soldered on the board but before the LoRa module is welded on.

Is it possible to flash the bootloader aftersoldering the RFM95 ?

---

<div class="post-metadata">

**Author:** ![aizukanne](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/aizukanne/32/35697_2.png) [@aizukanne](https://www.thethingsnetwork.org/forum/u/aizukanne)\
**Post date:** [May 22, 2018, 7:59am UTC](https://www.thethingsnetwork.org/forum/t/solar-powered-low-cost-lora-node-with-integrated-battery-holder/14198/5 "2018-05-22T07:59:52Z")

</div>

In my experience, I doesn’t work. The SPI bus doesn’t respond correctly with more than one device on it.

---

<div class="post-metadata">

**Author:** ![ursm](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/ursm/32/46475_2.png) [@ursm](https://www.thethingsnetwork.org/forum/u/ursm)\
**Post date:** [May 22, 2018, 12:06pm UTC](https://www.thethingsnetwork.org/forum/t/solar-powered-low-cost-lora-node-with-integrated-battery-holder/14198/6 "2018-05-22T12:06:04Z")

</div>

> [@lhanneus](#):
>
> possible to flash the bootloader aftersoldering the RFM95

> [@aizukanne](#):
>
> The SPI bus doesn’t respond correctly

It’s possible, but you need to **PullUP SS**!  
[ISP%26PullUp

 ![ISP%26PullUp](https://www.thethingsnetwork.org/forum/uploads/default/original/2X/a/a40048da9fec54bce14b2c35c88093d3cd9000b1.jpg)

---

<div class="post-metadata">

**Author:** ![aizukanne](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/aizukanne/32/35697_2.png) [@aizukanne](https://www.thethingsnetwork.org/forum/u/aizukanne)\
**Post date:** [May 23, 2018, 8:12am UTC](https://www.thethingsnetwork.org/forum/t/solar-powered-low-cost-lora-node-with-integrated-battery-holder/14198/7 "2018-05-23T08:12:33Z")

</div>

> [@ursm](#):
>
> It’s possible, but you need to PullUP SS!

Cool. Thanks for this info.

---

<div class="post-metadata">

**Author:** ![aizukanne](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/aizukanne/32/35697_2.png) [@aizukanne](https://www.thethingsnetwork.org/forum/u/aizukanne)\
**Post date:** [July 13, 2018, 8:53pm UTC](https://www.thethingsnetwork.org/forum/t/solar-powered-low-cost-lora-node-with-integrated-battery-holder/14198/8 "2018-07-13T20:53:41Z")

</div>

Here are some pictures of the Version 2 board, which includes connection for a 6V solar panel and solar charging for a LiPo battery using the CN3065. All unused analog and digital pins are exposed and there are connectors for 3.3V and GND on board. This allows connection of multiple sensors directly to the board. The LoRa module used if the RFM95W.

When encased, we will be using multiple nodes like this to monitor motion and environmental conditions in different locations within a city. I hope people will come up with other more creative applications.

Here are some photos…

![IMG_20180713_214727](https://www.thethingsnetwork.org/forum/uploads/default/original/2X/1/18e56086413911f48260592e601c65424e097381.jpg)

![IMG_20180713_204001](https://www.thethingsnetwork.org/forum/uploads/default/original/2X/2/2916de5e1c8c573a7929cc902ee692a10f268f98.jpg)

---

<div class="post-metadata">

**Author:** ![xz81](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/xz81/32/19234_2.png) [@xz81](https://www.thethingsnetwork.org/forum/u/xz81)\
**Post date:** [October 29, 2018, 7:18am UTC](https://www.thethingsnetwork.org/forum/t/solar-powered-low-cost-lora-node-with-integrated-battery-holder/14198/9 "2018-10-29T07:18:59Z")

</div>

Hi @aizukanne

I find very interesting your design. I may order some pcb’s myself. Have you tried them?  
It could be very interesting any comment based on experience. Any bug until now? What about battery duration? It would be great if you provide some example code.

Thank you very much for sharing! 👏 👏

---

<div class="post-metadata">

**Author:** ![aizukanne](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/aizukanne/32/35697_2.png) [@aizukanne](https://www.thethingsnetwork.org/forum/u/aizukanne)\
**Post date:** [October 29, 2018, 9:39am UTC](https://www.thethingsnetwork.org/forum/t/solar-powered-low-cost-lora-node-with-integrated-battery-holder/14198/10 "2018-10-29T09:39:58Z")

</div>

Hi xz81,

Yes I have tried them. No bugs noticed. The battery duration depends largely on application. Perhaps, if there was a standard application to be used to measure battery life that would help.  
The voltage regulator on board the MCP1700T has Extremely Low Operating Current for Longer Battery Life (1.6 uA typical). I have been running the modules with a 1.25W solar panel attached so I have never had the batteries run out. I have an OTAA node which hasn’t been in the sun for a few weeks but is still running on a 5000mAH (18WH) 26650 LiPo. Battery is currently at 3.2V.

From my experience, battery life depends on your sketch. Reducing blink time for LEDs, increasing update interval etc, all help to increase battery life.

The code is the basic LMIC sketch in ADB or OTAA with the following pin Mapping

> ```
> // Pin mapping
> const lmic_pinmap lmic_pins = {
> .nss = 6,
> .rxtx = LMIC_UNUSED_PIN,
> .rst = 5,
> .dio = {2, 3, LMIC_UNUSED_PIN},
> };
> 
> ```

Here is a picture of one of the nodes

 ![Motion%20Node](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/4/4/4483ff0a61be9dd2f8d70cc42b807f5f28d4be87.jpeg)

Hope that helps.

---

<div class="post-metadata">

**Author:** ![xz81](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/xz81/32/19234_2.png) [@xz81](https://www.thethingsnetwork.org/forum/u/xz81)\
**Post date:** [October 30, 2018, 11:01am UTC](https://www.thethingsnetwork.org/forum/t/solar-powered-low-cost-lora-node-with-integrated-battery-holder/14198/11 "2018-10-30T11:01:52Z")

</div>

Thank you very much for the info.

---

<div class="post-metadata">

**Author:** ![fLottes-Adlershof](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/flottes-adlershof/32/25844_2.png) [@fLottes-Adlershof](https://www.thethingsnetwork.org/forum/u/fLottes-Adlershof)\
**Post date:** [April 12, 2019, 6:14pm UTC](https://www.thethingsnetwork.org/forum/t/solar-powered-low-cost-lora-node-with-integrated-battery-holder/14198/12 "2019-04-12T18:14:19Z")

</div>

Hi,  
this project fits into our current project plan for a dynamo based cargobikometer (kilometer counter) for a prototyp for our free cargobikes of [flotte-berlin.de](http://flotte-berlin.de). The counter uses the dynamo frequency for calculating the distance.

With an extra solarmodule attached on the cargobike, the battery will be charged, if the cargobike is not moving and charged by the dynamo.

Regards  
Roland

---

<div class="post-metadata">

**Author:** ![aizukanne](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/aizukanne/32/35697_2.png) [@aizukanne](https://www.thethingsnetwork.org/forum/u/aizukanne)\
**Post date:** [April 12, 2019, 9:52pm UTC](https://www.thethingsnetwork.org/forum/t/solar-powered-low-cost-lora-node-with-integrated-battery-holder/14198/13 "2019-04-12T21:52:24Z")

</div>

Hi @fLottes-Adlershof,

Sounds interesting. Will you be transmitting the readings over LoRa?  
I will like know how it works out. The schematics and gerber are free to use and modify.

Good luck

---

<div class="post-metadata">

**Author:** ![fLottes-Adlershof](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/flottes-adlershof/32/25844_2.png) [@fLottes-Adlershof](https://www.thethingsnetwork.org/forum/u/fLottes-Adlershof)\
**Post date:** [April 13, 2019, 12:15pm UTC](https://www.thethingsnetwork.org/forum/t/solar-powered-low-cost-lora-node-with-integrated-battery-holder/14198/14 "2019-04-13T12:15:45Z")

</div>

Yes, that is the plan, transmitting the collected data via LoRaWAN to our own intenet server.

---

<div class="post-metadata">

**Author:** ![BoRRoZ](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/borroz/32/44234_2.png) [@BoRRoZ](https://www.thethingsnetwork.org/forum/u/BoRRoZ)\
**Post date:** [April 13, 2019, 12:21pm UTC](https://www.thethingsnetwork.org/forum/t/solar-powered-low-cost-lora-node-with-integrated-battery-holder/14198/15 "2019-04-13T12:21:31Z")

</div>

> [@fLottes-Adlershof](#):
>
> The counter uses the dynamo frequency for calculating the distance.

can you explain a bit more about that ‘sensor’ part… interesting

---

<div class="post-metadata">

**Author:** ![fLottes-Adlershof](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/flottes-adlershof/32/25844_2.png) [@fLottes-Adlershof](https://www.thethingsnetwork.org/forum/u/fLottes-Adlershof)\
**Post date:** [August 9, 2019, 9:57pm UTC](https://www.thethingsnetwork.org/forum/t/solar-powered-low-cost-lora-node-with-integrated-battery-holder/14198/16 "2019-08-09T21:57:20Z")

</div>

Hi,

the signal from the hub dynamo are converted by a trigger into a rectangle signal. Then I measure the period of the signal with the pulseIn() function at pin 25 of my ESP32 device.

```auto
int getFrequency() {
  float freq = 0;
  // use pulseIn function
  // disable interrupt during measure
  noInterrupts();
  // measure HIGH and LOW
  if ( debug == 1 ) {
    Serial.println("DEBUG: call pulseIn functions on measurePin:" + String(measurePin) );
  }
  Htime = pulseIn(measurePin, HIGH, PULSE_TIMEOUT); //read high time
  Ltime = pulseIn(measurePin, LOW, PULSE_TIMEOUT); //read low time
  if ( debug == 1 ) {
    Serial.println("DEBUG: after pulseIn functions" );
    Serial.println("DEBUG: Htime: " + String(Htime) );
    Serial.println("DEBUG: Ltime: " + String(Ltime) );
  }
  //enable interrupts again
  interrupts();

  Ttime = Htime + Ltime;
  if ( Ttime > 0 ) {
    if ( debug == 1 ) {
      Serial.println("DEBUG: Ttime = " + String(Ttime) );
    }
    freq = 1000000 / Ttime; //getting frequency with Ttime is in micro seconds
  }
  // display frequency

  if ( debug2 == 1 ) {
    return (freq_fixed);
  } else {
    return (freq);
  }
}
```

Then the distance will be calculated:

```auto
void getDistance() {
  // speed in m/s wheel_size in mm
  current_speed = ( frequency / dynamo_pulse ) * wheel_size / 1000.0 ;

  // distance in m/s
  distance_during_measurement = current_speed * _MEASURE_INTERVAL;

  // calculate the current speed in km/h
  current_speed *= 3.6;

  // count the total distance in m of the current day
  distance_daily += distance_during_measurement;
  distance_daily_km = distance_daily / 1000.0 ;

  // count the total distance in m
  distance_total += distance_during_measurement;
  distance_total_km = distance_total / 1000.0 ;

  // convert distance_total_km into integer with round function
  //distance_total_lora = round(distance_total_km);

  if ( debug == 1 )
  {
    Serial.print("DEBUG: measurement_interval in seconds = ");
    Serial.println(_MEASURE_INTERVAL);
    Serial.print("DEBUG: current_speed in km/h = ");
    Serial.println(current_speed);
    Serial.print("DEBUG: distance_during_measurement in m = ");
    Serial.println(distance_during_measurement);
    Serial.print("DEBUG: distance_daily in m = ");
    Serial.println(distance_daily);
    Serial.print("DEBUG: distance_total in m = ");
    Serial.println(distance_total);
    Serial.print("DEBUG: distance_total_lora in km = ");
    Serial.println(distance_total_lora);
    Serial.println("");
  }
}
```

But currently I have a problem, if I activate the LMIC functions in my code. With LMIC enabled the pulseIn() function returns always zero.

This is the main part with no activated LoRa functions.

```auto
void setup()
{
  Serial.begin(115200); //INTIALISING THE SERIAL COMMUNICATION
  pinMode(measurePin, INPUT);

  // initialize OLED display
  u8x8.begin();
  initDisplay();

  // initialize LoRa
  //initLoRa();

}

void loop() {
  uint32_t currentSeconds;

  currentSeconds = (uint32_t) millis() / 1000;
  if ( debug == 2 ) {
    Serial.print("DEBUG: currentSeconds: ");
    Serial.println(currentSeconds);
    Serial.print("DEBUG: measuretime: ");
    Serial.println(measuretime);
    Serial.print("DEBUG: _MEASURE_INTERVAL: ");
    Serial.println(_MEASURE_INTERVAL);
  }

  if ((currentSeconds - measuretime) >= _MEASURE_INTERVAL) { // Wake up every xx seconds

    // get the dynamo frequency
    frequency = getFrequency();
    if ( debug == 1 ) {
      Serial.print("DEBUG: Frequency: ");
      Serial.println(frequency);
    }

    getDistance();
    showDistance();
    measuretime = currentSeconds;
  }
  
  //os_runloop_once();

}
```

Do you have any idea, why the pulseIn function returns always zero, if LMIC is active?

---

<div class="post-metadata">

**Author:** ![kersing](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/kersing/32/44777_2.png) [@kersing](https://www.thethingsnetwork.org/forum/u/kersing)\
**Post date:** [August 10, 2019, 8:57am UTC](https://www.thethingsnetwork.org/forum/t/solar-powered-low-cost-lora-node-with-integrated-battery-holder/14198/17 "2019-08-10T08:57:38Z")

</div>

Next time please take the time to [format](https://www.thethingsnetwork.org/forum/t/how-do-i-format-my-forum-post/8735) your message yourself.

---

<div class="post-metadata">

**Author:** ![vedat33](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/vedat33/32/25844_2.png) [@vedat33](https://www.thethingsnetwork.org/forum/u/vedat33)\
**Post date:** [August 10, 2019, 9:44am UTC](https://www.thethingsnetwork.org/forum/t/solar-powered-low-cost-lora-node-with-integrated-battery-holder/14198/18 "2019-08-10T09:44:35Z")

</div>

Hi, good work. Can we use RFM95W module for commercial projects ?

---

<div class="post-metadata">

**Author:** ![LoRaTracker](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/loratracker/32/48502_2.png) [@LoRaTracker](https://www.thethingsnetwork.org/forum/u/LoRaTracker)\
**Post date:** [August 10, 2019, 10:25am UTC](https://www.thethingsnetwork.org/forum/t/solar-powered-low-cost-lora-node-with-integrated-battery-holder/14198/19 "2019-08-10T10:25:08Z")

</div>

> [@vedat33](#):
>
> Can we use RFM95W module for commercial projects ?

Perhaps not directly related to this thread, but yes of course you can use the RFM95W for commercial projects, assuming you carry out the approriate testing and get certification for the end device.

---

<div class="post-metadata">

**Author:** ![Vishmika](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/vishmika/32/39759_2.png) [@Vishmika](https://www.thethingsnetwork.org/forum/u/Vishmika)\
**Post date:** [September 27, 2021, 1:43am UTC](https://www.thethingsnetwork.org/forum/t/solar-powered-low-cost-lora-node-with-integrated-battery-holder/14198/20 "2021-09-27T01:43:41Z")

</div>

thank you so much for the information, I been dealing with this issue for a week trying to find a way to burn boot loader via ICSP while the lora module is soldered on

---

<div class="post-metadata">

**Author:** ![mstar12345](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/mstar12345/32/44346_2.png) [@mstar12345](https://www.thethingsnetwork.org/forum/u/mstar12345)\
**Post date:** [May 24, 2023, 2:10pm UTC](https://www.thethingsnetwork.org/forum/t/solar-powered-low-cost-lora-node-with-integrated-battery-holder/14198/21 "2023-05-24T14:10:02Z")

</div>

Hi,  
I’m Moses, Please how can i purchase this end node for a project in Nigeria.  
Thanks

[Next page](https://www.thethingsnetwork.org/forum/t/solar-powered-low-cost-lora-node-with-integrated-battery-holder/14198.md?page=2)
