Open jerabaul29 opened 4 years ago
@jerabaul29 There are two options to include the other environmental sensors. 1) simultaneous recording with the 1000Hz recordings 2) separate from the 1000Hz recording
The first will be difficult, as the I2C sensors take quite a bit of time to be read. I think the maximum speed of reading is about 40 ms. So in that time, I don't think you can actually record the other sensors I guess as the Arduino will be busy?
Alternatively, after each 15 min records of the vibration signals, the sensors get 1 minute to get as many samples as possible, take the average and write it to a file.
I was thinking of adding the exact same to the "LoggerWavesInIce_InSituWithIridium". So first it logs the IMU, after IMU it records for a minute or two the environ. sensors. Then sends the GPS + environ.sensor data through Iridium and continues as normal.
What do you think?
Considering the following probes: Wind anemometer (analog) Temperature 1-3 units (I2C) Pressure (I2C) Sonar (I2C) Only wind might need more than 1 minute to get a good average reading. For the vibration logger, it can be recorded simultaneously with the geophone.
I think it may / should work with simultaneous logging, because the ADC logging is interrupt based, so it will happen in the background even if the board is busy with something else, that's the beauty of interrupt based actions :) .
For each of your external sensors, can you provide a link to the GitHub repo or other explaining how to use it?
So regarding these additional sensors:
I think the simplest is to sample the analog wind anemometer at the same frequency as the other ADC channels. That may be far higher sampling frequency than needed, but it is the simplest from a programmatic point of view, and it will not hurt anyways.
The other sensors should be quite easy to interface. They will become logged as CHR messages. Have you already bought some of the sensors / can you send me the link to their webpage / datasheet / github repo so that I can add them to the arduino code?
Pressure: https://bluerobotics.com/store/sensors-sonars-cameras/sensors/bar02-sensor-r1-rp/ https://github.com/bluerobotics/BlueRobotics_MS5837_Library
Temperature: https://bluerobotics.com/store/sensors-sonars-cameras/sensors/celsius-sensor-r1/ https://github.com/bluerobotics/BlueRobotics_TSYS01_Library
Sonar: https://bluerobotics.com/store/sensors-sonars-cameras/sonar/ping-sonar-r2-rp/ https://github.com/bluerobotics/ping-arduino
I have a Sonar sensor here, but haven't had time yet to test it yet due to covid. Given that the temperature probes have the same address, I used this one:
https://learn.adafruit.com/adafruit-tca9548a-1-to-8-i2c-multiplexer-breakout
Great, I will write some software for all of these in the days to come then :) . Do you have some working arduino sketches where you already use these / could you upload it on the repo?
Btw, the sonar looks really nice. Do you think it may be possible to measure ice thickness using it? Do you have any more information about that? Or do you plan for another use? :)
I do. It is functional, but looks pretty inefficient. GPS_ArduinoDue_parsing_v6/GPS_ArduinoDue_parsing_v6.ino
I had to re-initialize the sensors in the loop, otherwise I was getting very weird values when using the GPS breakout. I tried to reset the TCA9548A instead but that didn't help.
That is the aim of sonar, but have only been able to try in air (couldn't find the speed of sound setting). It started drifting like crazy when placed under a small angle. Maybe it won't do that in water but have to check that.
Ok, sounds good! I do not have all the hardware, so may be a bit back and forth getting it to work with code development from my side and test from yours :) .
Btw, so fun that you choose some equipment from BlueRobotics. We have a ROV from them and we are very happy with it :) We use it to take PIV pictures under the ice to evaluate turbulence. That's still challenging though ^^ .
That is impressive, in the field? PIV/PTV is already complex in the laboratory. I've wanted to do the same in the field, but there is no ice around Australia unfortunately ;) ADV's already have difficulties in measuring under the ice due to a lack of particles so PIV must be worse, although you could attempt to inject tiny air bubbles near the measurement window.
I've picked BlueRobotics as they are reasonably cheap, provide good specifications and perhaps most important is that they are waterproof :)
This is exactly what we have been doing: we use a compressor to generate the bubbles. There are challenges, but we got some images a few months ago. :)
Yes.
Btw, which sensors are having the same address and conflicting? Or do you want to have several temperature sensors in use?
Yes, multiple temperature sensors :)
Ok :) How do you want to read them? One after the other / all at the same time / other?
And how many temperature sensors do you want to use?
What is easiest is good enough. Just need to get an average reading over a given period of time. If it can run simultaneously with vibration measurements, then an average over 15 minutes would be great. Generally one reading a second is already more than enough as we can't use these sensors to measure small scale turbulence anyway...
I was thinking of 3 temperature sensors, but can be 4 as well (I won't be giving every instrument that many sensors though). Two in the air, one in the ice, the other underwater. The length of the I2C wires might be an issue for the water measurements though if the ice thickness is large. I still need to find a good way to protect the air measurements from solar radiation. Given the price, perhaps it is more accurate to just have two probes stuck out of the side of the Pelican case and orientate it in such a way one is always in the shadow. Anyway, those are different types of issues :)
The temperature sensors should be part of the CHR data now.
I will add pressure / sonar. How many pressure sensors do you plan on adding?
CHR data? Btw, how are they connected or did you describe that already somewhere?
One pressure sensor should be enough :)
CHR = the char data. I.e. this part of the data in the output of the python parser:
I just tested the sonar, which works well. Have to ask the BlueRobotics techs for more info how it works exactly.
This one works on serial: https://github.com/bluerobotics/ping-arduino
I used the following sketch to get correct output, only tried it on the mega (didn't bring a due) at 3.3V input voltage:
#include "ping1d.h"
static const uint8_t arduinoRxPin = 19; //Serial1 rx
static const uint8_t arduinoTxPin = 18; //Serial1 tx
static Ping1D ping { Serial1 };
static const uint8_t ledPin = 13;
void setup()
{
Serial1.begin(9600);
Serial.begin(115200);
pinMode(ledPin, OUTPUT);
Serial.println("Blue Robotics ping1d-simple.ino");
while (!ping.initialize()) {
Serial.println("\nPing device failed to initialize!");
Serial.println("Are the Ping rx/tx wired correctly?");
Serial.print("Ping rx is the green wire, and should be connected to Arduino pin ");
Serial.print(arduinoTxPin);
Serial.println(" (Arduino tx)");
Serial.print("Ping tx is the white wire, and should be connected to Arduino pin ");
Serial.print(arduinoRxPin);
Serial.println(" (Arduino rx)");
delay(2000);
}
ping.set_speed_of_sound(1500000);
}
void loop()
{
if (ping.update()) {
Serial.print("Distance: ");
Serial.print(ping.distance());
Serial.print("\tConfidence: ");
Serial.println(ping.confidence());
} else {
Serial.println("No update received!");
}
// Toggle the LED to show that the program is running
digitalWrite(ledPin, !digitalRead(ledPin));
}
It consumes quite a bit of power though. Any way to turn it on and off? If so, probably get an average over say few seconds, all data with 'confidence' below 85-90 can be discarded.
@jerabaul29 add an explanation / example about how to add sensors.