Notifications
Clear all

InqBee - LoRa, Battery Powered, Remote Sensor Station

44 Posts
2 Users
7 Likes
1,534 Views
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

I need another project (like I need another hole in the head).  My wife and I are taking up Bee Keeping.  They'll supposedly help pollinate my wife's medicinal herbs, and Indian bead production crops.  We also live in the region where Sourwood Honey is near the price of gold.  I don't see myself getting to the point of selling it, but not having to buy it and using it more in substitute for white, processed sugar sounds like a good idea.

Of course... I'd like to IoT the project.  I'll be ordering the first two hives of bees (Nuc) here shortly with the expectation that they show up in the spring.  I plan on building the wood hives over the winter and instrumenting them before the bees show up.

Although bee-keeping is probably rather esoteric on the forum, I know there are plenty of remote projects for gardening and green-house monitoring that might find some of this useful.

The design and plans are malleable at the moment and with the help of the forum, I hope to have success in the relatively near future.  Here are the goals and plans as of now.

  1. Client / Server Architecture - The bee hives will be the clients.  They'll communicate their sensor data to a server in the house.  The server will collect the data from multiple clients and expose a private website for display of current and historical data.  
  2. LoRa - As they won't be in range of my house using WiFi, I can't use my preferred/cheap communications.  I'll be using LoRa.  This is totally new to me.  I've gone through Bill's Tutorial on LoRa and am using the same boards he recommended.  They showed up yesterday.  
  3. Battery Operated - Again, because of the range, I'll be using rechargeable batteries.  This is another new aspect for me.  I usually just use a cheap USB charger connected directly to an ESP8266 WeMos or NodeMCU.  There are two aspects that will be new:
    1. On the hardware side, I need some voltage regulator that is more efficient.  The ones that come on the standard development boards (WeMos, NodeMCU) are not!  For the client, I'll be using the bare ESP8266-07 board.  We've already explored how to get this working without the luxury of having a USB plug and voltage regulator.  Thanks again for those that helped me out on this hardware issue.  Being a cook-book hardware guy, I was finding it difficult to find Internet recipes to wire it up.  Most that I found were what was needed to program it... not simply run it.  I'll be trying to use HT7333-A voltage regulator.  It says it has an Quiescent Current of only 4 µA.  I got the recipe from a couple of YT video's from the Swiss Guy.
    2. On the software side, I need to get Deep Sleep working.  Again, we've already started exploring this here on the forum.  Thanks again guys!  My tentative plans are to wake, gather all the sensor data, turn on the LoRa and transmit it to the server and then go back to sleep.  I haven't decided on the frequency, but I'm starting out with doing data transfer every 15 minutes.  It turns out using the bare ESP8266-07 and turning off the WiFi, this MPU does a good enough job for my purposes.  While sleeping, the client should use 23 µA (19µA MPU + 4µA voltage regulator).  While running, the client will use 16 mA while gathering data and with the LoRa turned on, it should use around 136 mA.  It'll be an early study how I can minimize the time being awake.
  4. Server - Starting out, I'll probably just use my InqPortal web server library running on a WeMos to receive the data and expose the web server on my LAN.  This is merely for expediency.  Of course, it too will need a LoRa to receive the data from various clients, but it'll be on all the time and won't need the all the battery operation HW/SW.  It'll just use the USB power supply and a WeMos ESP8266.  I'll use this combination to study the LoRa and power utilization.  I will find I will likely need more space and capability.  I foresee converting the server to use a RasPi Zero-W and host the web server using Apache or Nginx.  I may use flat files or may add a MySQL database.  
  5. Sensors - I haven't decided on the full complement of sensors yet.  I'll start out, for power and battery life experiments, using the sensors and software code from my InqWeather project.  It uses a BMP180 or BMP280 to get barometric pressure and an AHT10 to gather temperature and humidity data.  The software is already set up to monitor all the factors and do simple, 12 to 24 hour weather prediction.  Once the hives get built and bees added, I'm also considering adding:
    1. A second AHT10 inside the hive to monitor hive temperature and humidity.  I understand these to be the most valuable data of bee hive health.
    2. External light sensor to monitor when sun hits the hive in the morning, leaves in the evening and also to track cloud cover.
    3. Some kind of load cells (maybe from bathroom scales) to monitor bee hive weight.

By all means anyone with expertise in hardware implementation or bee-keeping data tracking, I'd be all-ears to improve the design or add functionality.  

VBR,

Inq

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
Quote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6983
 

@inq, it sounds like you are on top of what you need. I suspect the boards will use a little more current, but since you have to visit the hives to extract the honey on a schedule, I suspect there is a battery size that will be a good fit. I would oversize it by at least 50% in case of unforeseen events.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

Posted by: @zander

@inq, it sounds like you are on top of what you need. I suspect the boards will use a little more current, but since you have to visit the hives to extract the honey on a schedule, I suspect there is a battery size that will be a good fit. I would oversize it by at least 50% in case of unforeseen events.

Hi Ron, I kind of thought with your garden plot project, I might hear from you.  Either you'll have some great insights or I might reduce the bumps in the road for you.

I certainly will oversize the battery.  I think from our other thread, I'm looking at nearly 160 days on an LiIon 18650.  There was a lot of fuzzy assumptions on usage.  Also, the batteries I'll use are scavenged from laptops, so they'll likely be in the 1800 mAh range and there are plenty of other unknowns (to me) about when the voltage regulator / ESP8266 combination will cut out.  I'll also need to add monitoring of the supply voltage to the list of sensor reading passed to the server.  In my initial testing, I have some 380 mAh LiPo batteries.  But even those are calculated to last nearly a month.  

On the flip side, the hive visiting is far more often than honey harvesting.  According to the guys in the local bee community meeting, I should expect to be visiting the hive, opening it up and inspecting it at least every other week.  So, yes... I'll have plenty of opportunity to replace the battery anyway.  

Another fun, learning project!

VBR,

Inq

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6983
 

@inq Yes, we will have a lot in common. I think I will be able to use InqWeather, the only addition that is mandatory is soil moisture, maybe add pH, that is easy but like moisture the sensors are prone to early failure. I have some ideas how to minimize that though. I will also use Lora and don;'t need much in battery, its a short walk away and will visit every day especially as we are going to get a new puppy as soon as we can. When I am ready I will start a blog like Topic since I think I have something to offer but it may not be what folks expect. All I will say is it involves muy 3D printer. Wow, 3D printing and Oscilloscope inside of 1 year at 81 8/12, am I nuts?

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

Posted by: @zander

the only addition that is mandatory is soil moisture, maybe add pH, that is easy but like moisture the sensors are prone to early failure.

Yes, I've read that also.  We in our library user's group played around with those a little.  It seems like I read there were two kinds resistance based and capacitance based.  It seemed like I recall the capacitance versions lasted longer.  But I think it also was a matter of sealing the electronics from moisture at the top of the sensor.  Maybe sealing them in epoxy might help??? 

Posted by: @zander

All I will say is it involves muy 3D printer.

Well... of course it does! 🤣 

Looking forward to it... especially as you use the moisture sensors.

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6983
 

@inq Epoxy!? If you are a boat owner, have you never had to seal a hole below the water line? 3M 5200 beats epoxy senseless, and now there is an Un-hesive. I never had that in my boating days.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

I wouldn't suggest anyone use this yet, because:

  

  1. I am a Cookbook electronic designer.  IOW, Monkey see, monkey do.  And since the Internet if filled with as much bad as good design...  I might have Chosen Poorly.
  2. This is a hodge-podge of requirements and separate references that I used to make my own recipe.  I have no idea if they will complement or conflict.  Kind of like Black Pepper and Vanilla ice-cream.  Someone in Louisiana suggested me trying this... and it's the Mac-Daddy! 
  3. Using a bare ESP8266 (without USB and voltage regulation).  This ended up requiring external circuitry to make work even by itself.  https://forum.dronebotworkshop.com/help-wanted/hardware-problem-powering-confusion/
  4. I will be using deep sleep (first time) so that I can get decent life out of a battery.  https://forum.dronebotworkshop.com/esp32-esp8266/esp8266-deep-sleep-the-darkness-returns/
  5. Using an LDO or any discrete voltage regulator for the first time -
  6. Using a bare RFM95 versus the one on secondary PCBs that Bill demonstrated.  I figured the pin spacing is the same on the ESP8266 and RFM95 and they're of identical width.  My hopes were to nearly stack them with the wire connections.  We'll see if that is possible!
  7. Using a discrete transistor BC337 to power higher current device is another first for me.  The RFM95 is expected to use about 120 mA during sends.  As a logic pin on the ESP8266 can't supply this much, I need to power it independently.  But, I can't power it directly from the 3.3V since it would still be using power when the ESP8266 is asleep.  According to the recipe I used, it switches the ground.  I find this abnormal to what I'm used to.  Since I'm switching it on by a logic pin anyway, I'm hoping I can:
    1. boot up
    2. gather all the sensor data
    3. then turn on the LoRa,
    4. send the packet
    5. switch to the lower power usage receive mode
    6. receive the reply and any update/instructions from the server.
  8. I've jury rigged an experiment testing just this transistor part of the switching circuit.  I used a 300mA LED as the power consumer instead of the RFM95.  If I'm going to let the smoke out, I'd rather it be the LED or even the ESP8266.  Those I got plenty of!  😆 
  9. The single analog pin is reserved to read the incoming voltage to track and alert when its time to change the battery out.
  10. I2C... I'm hoping I can get all my sensors on the one bus.  This might be a challenge as I only have one logic pin left and can't create a second bus.
  11. I still have one errant connection to figure out.  In Bill's topic, the RFM95 library uses a pin for an "Interrupt".  He shows it wired to G0.  The RFM95 datasheet shows extra pins as DIO0 to DIO5.  I'll need to dig into the library code or other references to see if I can safely assume G0 and DIO0 are the same pins.

Here is my wiring diagram so far.  I wouldn't expect anyone to double check me, but if anyone suspects a logic error in my combining so many different Internet recipes, I sure would appreciate it.  Otherwise, the smoke may be freed! 🙄 😜 😥  

InqBee

 

I do plan on publishing all design details - hardware, software, and 3D Prints as well as all the results as testing progresses.  I'm hoping this might be a useful project as a jumping off point for many outside, battery operated projects.  

VBR,

Inq

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

Posted by: @zander

3M 5200

Oh I use this...on my boat.  But it's expensive, where as I can get epoxy at the dime store.  I'm also figuring that the probes being in the wet dirt all the time will still corrode, so it doesn't matter if the 3M 5200 will outlast plastic in the land-fill, the probes will still go bad.  I'm curious if you can even get one full growing season out of them.

Actually, I used melted ABS plastic (with Acetone) and paint it on.  It seals perfectly and I have gobs of both laying around.  😉 But I know, you don't plan on using ABS in your printer so I didn't suggest it.

VBR,

Inq

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6983
 

@inq I guess epoxy means something different to me. I used to use it a lot and bought it in gallon cans. There was a small emergency kit that would be a better match for the sensors, though. I do know 5200 will outlast epoxy by a lot. Until I try the 5200 plus my secret weapon, I don't know how long they will last. It might be months, or it might be years. I never saw epoxy for sale in more than a dollar store (I haven't seen a dime store in many decades). I used to drive to the industrial part of town and got it at the boat building warehouse until I discovered Lee Valley which was closer. That was in Toronto, the 4th largest city in NA, so there is zero chance of finding any here for hundreds of miles, but of course, I can get it online at Lee Valley (oops, they don't carry it anymore). 5200 I can get in town.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6983
 

@inq If the two sensors are I2C, it seems like you are using one more pin than needed.

EDIT: Sorry, I misread the schematic.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

Posted by: @zander

@inq If the two sensors are I2C, it seems like you are using one more pin than needed.

I have 4-lines the power and ground and two data lines going to the standard pins GPIO4 and 5.  Once you create a I2C bus, you can put more than one sensor on it as long as their software addresses are different.  Here are the same two sensors on the InqWeather project:

On the InqEgg bot, all these sensors are on the same 4 wires of the I2C bus:

  1. Accelerometer
  2. Gyroscope
  3. Magnetometer
  4. Barometer
  5. ToF sensor 

VBR,

Inq

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

I forgot the capacitor as specified in the Swiss Guy YT of 1000μF.

InqBee

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

InqBee Server

The hardware side will be a lot easier on the server since it doesn't have sensors or odd power requirements.  In this first iteration, I'll be using an ESP8266 WeMos D1, R2 & Mini.  Here is the wiring diagram for the server. 

InqBee Server

Here is the first breadboarded version.  

InqBee Server

I want to get a working LoRa baseline before I start adding the real server code, so I've loaded up Bill's Receive Sketch.  Also note, that if you're using the Arduino IDE 1.8.19, you will not be able to find the library noted in Bill's documentation.  You can, however, download and install it from the Github repository.  I didn't know that libraries could be targeted to the IDE versions.  

The only changes I've made to Bill's sketch are to use the proper logic pins on the ESP8266 as shown above.  Here is the sketch

It compiles and uploads.  Can't test it without the client.  🤣 

VBR,

Inq

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6983
 

@inq I don't know where my former answer went to, I found it in both because there is only ONE set of libraries. Here are pics.

Screenshot 2023 11 15 at 20.04.29
Screenshot 2023 11 15 at 20.01.37

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6983
 

@inq Remember, this is in your PERSONAL library, not in the builtin or core. Do you have 2 libraries?

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Page 1 / 3