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
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • 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
Arduino Projects
  • Products
  • Arduino
  • Arduino Projects
  • More
  • Cancel
Arduino Projects
Blog LoRa MER Week 3.5:  Testing Turbidity and Posting Data to Internet
  • Blog
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino Projects to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: fmilburn
  • Date Created: 21 Dec 2018 5:35 AM Date Created
  • Views 4680 views
  • Likes 10 likes
  • Comments 13 comments
  • mkr relay shield
  • buoy
  • mkr_giveaway_projects
  • sensors
  • lorawan
  • arduino_projects
  • lora
  • arduino mkr 1300
  • boat
  • arduino
  • mkr_smarterworld
  • wan_1300
Related
Recommended

LoRa MER Week 3.5:  Testing Turbidity and Posting Data to Internet

fmilburn
fmilburn
21 Dec 2018
image

Arduino Home

An Open-Source platform to create digital devices and interactive objects that sense and control physical devices.

Arduino Tutorials
Arduino Projects

 

I am building a prototype for a remote controlled vessel, the LoRa Marine Environmental Ranger (LoRa MER) that gathers environmental data and relays it to a shore based station using Arduino MKR WAN 1300 LoRa boards.  This post is the fifth in a series, and describes the turbidity sensor and how the shore based station will store and display data on the internet using a Raspberry Pi and adafruit.io.

image

Yes, there has been another name change :-)  

 

Implementation Status

Changes from last week are in red bold.  The RPR-0521RSRPR-0521RS Light sensor was described previously in my Rohm SensorShield RoadTest.

Boat

  • RC control and motors tested on land
  • MKR WAN 1300 firmware tested
  • Following sensors / hardware fitted temporarily and tested
    • ST3775 TFT Display
    • ICP10100  Atmospheric Pressure / Temperature
    • NEO-6M-0-001 GPS
    • Thermistor Water Temperature
    • Thermistor Air Temperature
    • KX224-I2C 3 axis Accelerometer
    • RPR-0521RSRPR-0521RS Light Sensor
    • TSW-10 Turbidity Sensor

Shore base:

  • Enclosure completed
  • TFT screen fitted
  • Firmware has LoRa reception (polls) and responds with RSSI
  • MKR WAN 1300 connected to Raspberry Pi by USB serial
  • Python script sends data over internet to adafruit.io
  • Dashboard implemented on adafruit.io

 

Turbidity

The turbidity, or cloudiness of a fluid, is caused by small suspended solids.  In this project the TSW-10 sensor from Amphenol will be used to get a rough indication of turbidity.  The sensor works by emitting light from an IR LED which travels through the water sample being tested to a phototransistor.  Increased levels of solids in the water reduce the light received by the phototransistor and are thus indicative of the turbidity.  The sensor is designed for  washing machines and dishwashers to sense when rinse water is clean.  There are standards for water bodies in some cases as well as drinking water.  However, the measurements here will be rough and serve only as a non-calibrated indication of turbidity.

 

The sensor was connected and tested as described in the datasheet.  Output voltage was measured with a Extech EX330 digital multimeter.  Supply from a bench power supply was set at 5V.  Three uncalibrated samples were tested.  The first was Seattle drinking water.  The second was made by adding a pinch of fine soil from my garden and mixing it till to my eye it looked like dirty pond water.  The third was made by diluting the second by about 5:1.

 

In the photo below the sensor is in open air and the sensor output reading is 2.98 V before being inserted into the samples.

image

To my surprise, the sensor output voltage increased to 3.66 V when inserted into the clean water sample.  I also noticed that voltage was somewhat influenced by ambient light and whether I was shading it with my hand.

image

Sensor output voltage dropped to 3.58 V in the intermediate sample.

image

The dirty sample had a sensor output voltage of 3.21 V.

image

The datasheet provides a graph with sensor output voltage as a function of turbidity in NTU.  There are two lines shown without an explanation.  The data from this experiment is plotted using 3 asterisks on the same graph below.

image

I am not sure how to interpret the graph but the experimental data is between the two lines - whatever they are - and the sensor is sensitive to turbidity.  It is possible to buy a powder for mixing standards for testing but at this point I don't intend to do so and will use the meter as indicative only.

 

Posting to the Internet

As previously noted, LoRaWAN is not implemented in my area and for the prototype a second MKR WAN 1300 has been connected to a Raspberry Pi via USB

image

A python script running on the Raspberry Pi parses the data and sends it to the free version of Adafruits Internet of Things service, adafruit.io.  For testing, the base station was placed on the other side of my small lab while the MKR WAN 1300 with the sensors was placed in front of my main computer and monitor as shown below.

image

A trial dashboard to show what is possible was developed.  In the screenshot below the air and water temperature are on dials along with the turbidity.  Acceleration is shown underneath the arrow icons representing x, y, and z directions while light intensity is graphed on the far right.

image

Different dashboards can be constructed and individual feeds can also be examined in detail.  The light intensity data is shown below where after being out for a while I came back to the lab and turned on the lights.  A while later I turned a light to be more directly on the sensor.

image

Adafruit has a free plan with restrictions as well as a premium plan with more access that costs $99 per year.  My own experience with these services is limited to a few experiments with adafruit.io.

 

The code is in an unrefined state for the boat and shore station but acceptable for testing the prototype.  I will post it on github after a bit more testing.

 

I've not tested the boat in water or done distance tests this week due to weather but also thought I would wait until the junior engineers (grandkids) were available to help next week.  They might be unhappy if I crashed the boat and they weren't there to help fish it out of the water.  On reflection, I am not going to mount the sensors until after making sure the boat runs OK.  There is a 90 day return / replacement but I doubt they would honor it if I have drilled holes and mounted various stuff on it.  So that will probably wait a week or two.

 

Next Steps

  • Test distance on land
  • First tests in water with the boat.

 

Comments, corrections, and ideas are always welcome!

 

Links

MKR WAN 1300: LoRa Marine Environmental Ranger  - This is the landing page which outlines the project

LoRa MER Week 1:  Making it Portable

LoRa MER Week 2: Boat in a Box

LoRa MER Week 3: Building a Shore station and Starting the Boat

  • Sign in to reply

Top Comments

  • genebren
    genebren over 7 years ago in reply to fmilburn +4
    Frank, Interesting thoughts on water sensing. I have developed image processing software for a microscope with CCD optics for counting mammalian cells. The processing was all about statistic and object…
  • fmilburn
    fmilburn over 7 years ago in reply to genebren +4
    True, but I think much of it may be inherent to the sensor itself. The phototransistor is bound to have variation in sensitivity and gain, plus there is the issue of alignment with the LED. This isn't…
  • fmilburn
    fmilburn over 7 years ago +3
    On reviewing this, I thought the points I plotted on the NTU graph should be clarified. As noted in the discussion, my samples are not calibrated so only the NTU value of the tap water, which should be…
  • fmilburn
    fmilburn over 7 years ago in reply to shabaz

    That is an interesting idea!  Still photography is a longtime hobby and I have one of those Rosco sample books.  I would think they could be correlated to turbidity and other water conditions.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 7 years ago

    Hi Frank,

     

    This project is looking great!! Interesting sensor too.. as you say, maybe the rubber/foam reduces ambient light.

    I don't know if it is helpful (I know nothing about this topic), maybe photo filter samples (you can get a book of several hundred samples for little cost) could have useful capability for a crude calibration. This type of stuff basically (I've not used this one):

    https://www.amazon.com/Rosco-Lux-Small-Swatchbook/dp/B0002ER2YG 

    There are usually neutral filters for (say) 10% reduction, 20% reduction, etc.. I'm not super familiar with the photography stuff, but Problemchild and balearicdynamics are, they may know.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • fmilburn
    fmilburn over 7 years ago in reply to genebren

    True, but I think much of it may be inherent to the sensor itself.  The phototransistor is bound to have variation in sensitivity and gain, plus there is the issue of alignment with the LED.  This isn't a great photo but notice what appears to be a small trim pot with the label VR.

    image

    Maybe they use it to adjust and get within the band at the factory.  Also note the black foam around the sensor slot.  I think that serves to hold things in place as well as possibly block some ambient light.  As noted in the write-up above, I did notice some variation when I moved my hand to block light but it was second order.  I have also noticed it isn't entirely consistent from day to day with no real discernable environmental change.  They may take a reading in the dishwasher of clean water when they start, kind of like I did above, and then use slope similar to how I plotted my asterisks for practical calibration and use.

     

    Like you, I searched the internet without finding much.  You can buy the standard but there are also some photos of how "cloudy" various degrees of turbidity look.  From these I deduce that my plot above may not be too bad and turbidity is maybe close to the asterisks as shown.  Interesting stuff...  In the old days they would lower a disk into the water until they couldn't see it any more and the distance underwater was how turbidity was quantified.  Maybe I could automate this by moving a disk up and down with a motor and use a camera with AI to detect when it was no longer visible ;-)  Or I could make a disk and try using it to calibrate my sensor above.

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • genebren
    genebren over 7 years ago in reply to fmilburn

    Frank,

     

    I was interested in trying to find an explanation for the two extreme lines in the above graph.  I found the manufacturers specification to be little help.  I searched for other references to turbidity and/or water quality sensors to see if there might be any clues as to what factors might influence these sensor, still no luck.  I did find an interesting article on water quality measurement sensors (https://ijret.org/volumes/2016v05/i06/IJRET20160506031.pdf ), but it was a little thin on explanations.

     

    My guesses for what might influence theses sensors are most likely temperature and ambient lighting.  You could easily test for these variables by tests, similar to those you have done, with the added points for temperature changes (hotter and colder than room temperature) and light changes (darkened room and bright light on the sample).  If you can better understand the origin of the two lines, and how environmental changes may effect your readings, you might be able to compensate by factoring other variables (temp and lighting) into the readings.

     

    Best of luck!

     

    Gene

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • fmilburn
    fmilburn over 7 years ago

    On reviewing this, I thought the points I plotted on the NTU graph should be clarified.  As noted in the discussion, my samples are not calibrated so only the NTU value of the tap water, which should be very low, is known.  Assuming the graph in the datasheet gives the limits for sensor output, there is a range of NTU that the output voltage might represent.  The plot as presented above assumes the data follows the slope of the limits on the plot but I don't know this to be true.  A better representation might be this:

    image

    But in truth, I don't know how to interpret the output at this point and will treat it as directionally representative only.

    • Cancel
    • Vote Up +3 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 © 2026 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