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.
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.
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.
Sensor output voltage dropped to 3.58 V in the intermediate sample.
The dirty sample had a sensor output voltage of 3.21 V.
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.
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
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.
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.
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.
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
Top Comments