element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Just Encase
  • Challenges & Projects
  • Design Challenges
  • Just Encase
  • More
  • Cancel
Just Encase
Blog [Pool Water Monitoring] #15 Collecting values and sending via LoRa: Update1 - Collecting values and sending them away... and a crazy value that was hard to track
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Just Encase to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: feiticeir0
  • Date Created: 19 Jan 2022 3:43 PM Date Created
  • Views 1010 views
  • Likes 6 likes
  • Comments 1 comment
  • Lora DHT22
  • LoRa ds18b20
  • pool_water_monitoring
  • lora
  • Arduino MKR WAN 13000
  • Lora Send / Receive
  • lora communication
  • Lora am2302
  • just_encase
  • just encase
Related
Recommended

[Pool Water Monitoring] #15 Collecting values and sending via LoRa: Update1 - Collecting values and sending them away... and a crazy value that was hard to track

feiticeir0
feiticeir0
19 Jan 2022

image

Hi all !

Hope everyone is well .

Last night was time to start working on the code to collect all the data and send it away to the remote Arduino MKR 1300 WAN via LoRa .

In my last post regarding the data collecting, everything is wired and working, only missing the LoRa code to send the data away.

Data collecting

In summary, for now, I'm collecting:

  • Water temperature
  • Enclosure Temperature/Humidity
  • Water TDS
  • Water PH (as soon as the probe arrives)
  • Battery percentage

Here's the testing stuff:

Testing data collecting

The TDS probe and DS18B20 temperature probe were inserted in my water bottle:

Testing stuff

After collecting all these values, for now, I'm displaying them in the console, so I can keep track if everything is perfect.

The following image is an example, with a small problem: The TDS value is way, way high - it should be around 130ppm  (tap water).

image

Why ?

If the TDS code was in a Arduino sketch by itself, the TDS values were perfect, but, without any changes, in the main sketch, I was getting crazy values.

The realization

After about 40m and a lot of testing, I decided to change the order of the functions that collect the values.

The TDS reading was after the battery percentage - after changing the TDS reading to before the battery percentage, the first iteration of the code, the reading was perfect. The next iteration, the values were, again, high.

Why was that ?

The Fix

If you recall, in my post about the battery monitoring on the Arduino MKR 1300 WAN, i've changed the AnalogReference to 1V, so that it can measure with accuracy, the battery voltage.

It turns out, instead of taking a reference of 3.3v when reading the values from the Analog PIN, it was taking 1V . After changing the AnalogReference in the TDS collecting function to the default - 3.3v - the values were back to normal.

LoRa sending

After all this sorted out, just create a "package" (more of a string - still need to see if I can send an array) to send via LoRa and receive it on the other end.

The following image shows this

image

Nice !

Next Steps

For the data collecting end, while on the testing phase, the code is on a loop and delaying for 10 seconds.  This is not what I want - not only because I don't need to collect values every 10s - maybe every hour or 4 times a day, this will drain to much battery.

The next move will be to deep sleep the Arduino and wake up only to collect the values and go back to sleep again.

Stay tuned and stay safe

Note: The code (and explanations of it) will all be shared when this is all working .

  • Sign in to reply
  • DAB
    DAB over 3 years ago

    Good lesson in testing and understanding your default values.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube