element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • More
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • More
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • More
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • More
  • 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
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
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Just Encase requires membership for participation - click to join
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
Author: feiticeir0
Date Created: 19 Jan 2022 3:43 PM
Views: 376
Likes: 6
Comments: 1
  • 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

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).

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

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 .

Anonymous
  • DAB
    DAB 3 months ago

    Good lesson in testing and understanding your default values.

    • Cancel
    • Up 0 Down
    • Reply
    • More
    • Cancel
Element14

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 © 2022 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

  • Facebook
  • Twitter
  • linkedin
  • YouTube