Karaburan: Difference between revisions

From RevSpace
Jump to navigation Jump to search
 
(14 intermediate revisions by the same user not shown)
Line 9: Line 9:
== Next steps ==
== Next steps ==
* write python scripts
* write python scripts
** gpsd-to-mqtt
** arduino turbidity
** arduino turbidity
** turbidity-to-mqtt
** turbidity-to-mqtt
* hook things into systemd
* hook things into systemd / udev
** e.g. insert GPS -> create symlink with udev -> trigger (re)start of gpsd


* analoog in op de pi:
* analoog in op de pi:
Line 19: Line 19:
* UPS voor pi: https://elektronicavoorjou.nl/product/raspberry-pi-ups-hat/
* UPS voor pi: https://elektronicavoorjou.nl/product/raspberry-pi-ups-hat/
* 1-wire stuff:
* 1-wire stuff:
** 1-wire emulation on an stm32: https://github.com/alitekin2fx/stm32_ds2480_emu
** 1-wire adapter emulation on an stm32: https://github.com/alitekin2fx/stm32_ds2480_emu
** owfs.org for easy interfacing with multiple 1-wire devices in a hierarchical way on linux
** owfs.org for easy interfacing with multiple 1-wire devices in a hierarchical way on linux
=== investigate RTK GPS ===
Goal: figure out if it is practically possible to achieve cm resolution with a 200-euro GPS and a free correction service
* https://www.nsgi.nl/referentiepunten-en-gnss-data/gnss-data/real-time-streams public correction data service
* https://www.ardusimple.nl/rtk-in-5-minutes/
* https://www.youtube.com/watch?v=Oc1LBFDj2MA
* Claim: Nauwkeurigheid op centimeterniveau
** <1cm met een basisstation tot 35km
** <1cm met NTRIP tot 35km
** <4 cm met SSR-correcties
** <1.5 m in stand-alone modus
** <0.9 m standalone met SBAS-dekking
* Use with Linux / gpsd: https://stackoverflow.com/questions/77314115/drotek-gpsd-and-ntrip-correction-data-for-precise-positioning ?
* Chipsets
** Quectel LC29H, see https://rtklibexplorer.wordpress.com/2024/04/28/dual-frequency-rtk-for-less-than-60-with-the-quectel-lc29hea/
** uBLOX ZED-F9P
Edit /etc/default/gpsd, set GPSD_OPTIONS:
  GPSD_OPTIONS="ntrip://user:pass@ntrip.kadaster.nl:2101/CBW100NLD0"


== Introduction ==
== Introduction ==
Line 136: Line 156:
=== Detect/find pollution source ===
=== Detect/find pollution source ===
* ...
* ...
== Implementation ==
=== reading temperature sensor ===
The idea is to to use a DB18B20 temperature sensor, read it using an arduino nano board acting as a 1-wire adapter.
Use openwire-fs as user-side openwire software http://owfs.org
Preparation:
* Add the regular user to the 'dialout' group, so it can access serial ports
  sudo adduser <name> dialout
Setting up the hardware:
* connect the DS18B20 to the connector board with the pull-ups
* wire the connector board to the arduino nano, see ...
* plug the arduino nano in the pi
Setting up the software:
* Install openwire fs
  sudo apt install owfs
* Create the openwire fs mountpoint
  sudo mkdir /mnt/1wire
* Configure owfs, edit /etc/owfs.conf
  server: device = /dev/ttyUSB0
  mountpoint = /mnt/1wire
  allow_other
  (comment out the line with the FAKE devices)
* Configure systemd services
  sudo systemctl enable owserver owhttpd
  sudo systemctl disable owftpd
* Start the systemd service
  sudo systemctl start owserver owhttpd
* Check the logs
  sudo journalctl -xeu owserver -f
* Open a browser to view the web interface
  http://localhost:2121 or
  http://raspberrypi.local:2121

Latest revision as of 11:42, 24 June 2024

Project Karaburan
Karaburan.png
Monitoring water quality
Status Initializing
Contact bertrik
Last Update 2024-06-24

Next steps

  • write python scripts
    • arduino turbidity
    • turbidity-to-mqtt
  • hook things into systemd / udev
    • e.g. insert GPS -> create symlink with udev -> trigger (re)start of gpsd

investigate RTK GPS

Goal: figure out if it is practically possible to achieve cm resolution with a 200-euro GPS and a free correction service

Edit /etc/default/gpsd, set GPSD_OPTIONS:

 GPSD_OPTIONS="ntrip://user:pass@ntrip.kadaster.nl:2101/CBW100NLD0"

Introduction

Topics:

  • air quality sensors
    • ammonia
    • NOx
  • water chemical analysis
    • nitrates
    • ammonia
    • dissolved oxygen
    • sulfide/sulfate
    • phosphates?
    • salinity (chlorides?)
  • water physical analysis
    • temperature
    • clarity/turbidity -> investigate standard ways of measuring/expressing this
    • conductivity/total dissolved solids
    • water properties by light reflection, hyperspectral/polarity
    • depth?
  • boat control
    • trajectory -> steering
    • idea: interface with the remote control, not with the boat
    • idea: find a boat with easily hackable remote control protocol
    • idea: can we get sensor data over this link too, e.g. GPS?
  • camera control
  • post-processing
    • data presentation
      • video/photo stitching
      • time lapse view
      • map view of properties
  • use cases
    • verify with domain experts, how to engage?
    • slootview, under/above water
    • minimum viable prototype
    • high-res measurement by location, by time
  • materials
    • boat selection
    • processing platform selection
    • communication platform selection

Air quality sensors

Nitrogen compounds in air

According to https://www.rivm.nl/stikstof/monitoren-advies-onderzoek/overzicht-stikstofmetingen/metingen-stikstof-in-de-lucht average (typical?) values of

  • Ammonia (NH3): 6.7 ug/m3 (9.6 ppb)
  • NOx: 27.3 ug/m3
  • NO2: 18.6 ug/m3 (9.9 ppb)

(ppb-conversion using https://www.breeze-technologies.de/blog/air-pollution-how-to-convert-between-mgm3-%C2%B5gm3-ppm-ppb/ )

RIVM report on inexpensive nitrogen-in-air sensors: https://www.samenmeten.nl/sensoren-voor-no2 Conclusion: most sensors are not sensitive enough to be used in typical outdoor conditions, with perhaps one exception: alphasense NO2-B43F

Water physical analysis

Turbidity / clarity

See https://en.wikipedia.org/wiki/Turbidity

Aliexpress sensor TS-300B: https://nl.aliexpress.com/item/1005006732956937.html Has a range 0 ~ 1000 ± 30 NTU

Order of magnitude for turbidity:

  • Drinking water upper limit: 4 NTU (European turbidity standard for drinking water)
  • Ambient water: 10-150 NTU. The US state of Washington use a "background" value of 50 NTU as reference.

(see https://en.wikipedia.org/wiki/Turbidity#Standards_and_test_methods )

So the Aliexpress sensor is suited only for "dirty" water.

Boat control

Typically the wireless link looks like this:

  • 2.4 GHz working frequency
  • 500m range

Interesting links:

remote control

Image of remote control RF chip: [...]

Parts:

  • 12.000 MHz crystal/oscillator
  • 16-pin control chip: 20_CL6L071
  • 6-pin RF chip: 1110 / VKA3, could be an rx/tx switch, amplifier or filter circuit

See also: https://www.open-tx.org/

Next steps:

  • map out the connections between the mainboard and the rf board, expected: VCC, GND, spi ?

Use cases

material:

Useful distinction, typically used in documents/guidelines:

  • chemical quality, what substances are present in the water?
  • biological / ecology quality, what kind of living organisms live in the water?

Reeuwijkse plassen

See

potential applications:

  • inspect water sides (oever) over time
  • underwater camera: detect invasive cray fish
  • sample water properties at high spatial resolution, high time resolution
  • early detection of indicators for cyanobacteria: temperature and nutrients

Detect/find pollution source

  • ...

Implementation

reading temperature sensor

The idea is to to use a DB18B20 temperature sensor, read it using an arduino nano board acting as a 1-wire adapter. Use openwire-fs as user-side openwire software http://owfs.org

Preparation:

  • Add the regular user to the 'dialout' group, so it can access serial ports
 sudo adduser <name> dialout

Setting up the hardware:

  • connect the DS18B20 to the connector board with the pull-ups
  • wire the connector board to the arduino nano, see ...
  • plug the arduino nano in the pi

Setting up the software:

  • Install openwire fs
 sudo apt install owfs
  • Create the openwire fs mountpoint
 sudo mkdir /mnt/1wire
  • Configure owfs, edit /etc/owfs.conf
 server: device = /dev/ttyUSB0
 mountpoint = /mnt/1wire
 allow_other
 (comment out the line with the FAKE devices)
  • Configure systemd services
 sudo systemctl enable owserver owhttpd
 sudo systemctl disable owftpd
  • Start the systemd service
 sudo systemctl start owserver owhttpd
  • Check the logs
 sudo journalctl -xeu owserver -f
  • Open a browser to view the web interface
 http://localhost:2121 or
 http://raspberrypi.local:2121