Add test data, update depth recording script

This commit is contained in:
Pi 2022-09-03 18:17:20 +03:00
parent bef7c9afea
commit f2344d9386
4 changed files with 115 additions and 11 deletions

View File

@ -0,0 +1,43 @@
time and date, Voltage of depth sensor (V), Depth (m)
2022-09-03T17:55:58,0.714,-0.13
2022-09-03T17:56:01,0.714,-0.13
2022-09-03T17:56:04,0.714,-0.19
2022-09-03T17:56:07,0.714,-0.19
2022-09-03T17:56:10,0.714,-0.19
2022-09-03T17:56:13,0.714,-0.13
2022-09-03T17:56:16,0.714,-0.19
2022-09-03T17:56:19,0.716,-0.19
2022-09-03T17:56:22,0.714,-0.13
2022-09-03T17:56:25,0.714,-0.19
2022-09-03T17:56:28,0.714,-0.19
2022-09-03T17:56:31,0.714,-0.19
2022-09-03T17:56:34,0.714,-0.19
2022-09-03T17:56:37,0.714,-0.13
2022-09-03T17:56:40,0.714,-0.13
2022-09-03T17:56:43,0.714,-0.19
2022-09-03T17:56:46,0.716,-0.13
2022-09-03T17:56:49,0.714,-0.13
2022-09-03T17:56:52,0.714,-0.13
2022-09-03T17:56:55,0.716,-0.19
2022-09-03T17:56:59,0.714,-0.19
2022-09-03T17:57:02,0.714,-0.19
2022-09-03T17:57:05,0.716,-0.13
2022-09-03T17:57:08,0.714,-0.13
2022-09-03T17:57:11,0.714,-0.19
2022-09-03T17:57:14,0.714,-0.13
2022-09-03T17:57:17,0.894,5.48
2022-09-03T17:57:20,0.986,8.54
2022-09-03T17:57:23,0.988,8.47
2022-09-03T17:57:26,1.368,20.58
2022-09-03T17:57:29,1.354,20.26
2022-09-03T17:57:32,0.714,-0.19
2022-09-03T17:57:35,0.716,-0.13
2022-09-03T17:57:38,0.714,-0.19
2022-09-03T17:57:41,0.714,-0.19
2022-09-03T17:57:44,0.714,-0.19
2022-09-03T17:57:47,0.716,-0.19
2022-09-03T17:57:50,0.714,-0.19
2022-09-03T17:57:53,0.714,-0.13
2022-09-03T17:57:56,0.714,-0.13
2022-09-03T17:57:59,0.714,-0.19
2022-09-03T17:58:02,0.714,-0.13
1 time and date Voltage of depth sensor (V) Depth (m)
2 2022-09-03T17:55:58 0.714 -0.13
3 2022-09-03T17:56:01 0.714 -0.13
4 2022-09-03T17:56:04 0.714 -0.19
5 2022-09-03T17:56:07 0.714 -0.19
6 2022-09-03T17:56:10 0.714 -0.19
7 2022-09-03T17:56:13 0.714 -0.13
8 2022-09-03T17:56:16 0.714 -0.19
9 2022-09-03T17:56:19 0.716 -0.19
10 2022-09-03T17:56:22 0.714 -0.13
11 2022-09-03T17:56:25 0.714 -0.19
12 2022-09-03T17:56:28 0.714 -0.19
13 2022-09-03T17:56:31 0.714 -0.19
14 2022-09-03T17:56:34 0.714 -0.19
15 2022-09-03T17:56:37 0.714 -0.13
16 2022-09-03T17:56:40 0.714 -0.13
17 2022-09-03T17:56:43 0.714 -0.19
18 2022-09-03T17:56:46 0.716 -0.13
19 2022-09-03T17:56:49 0.714 -0.13
20 2022-09-03T17:56:52 0.714 -0.13
21 2022-09-03T17:56:55 0.716 -0.19
22 2022-09-03T17:56:59 0.714 -0.19
23 2022-09-03T17:57:02 0.714 -0.19
24 2022-09-03T17:57:05 0.716 -0.13
25 2022-09-03T17:57:08 0.714 -0.13
26 2022-09-03T17:57:11 0.714 -0.19
27 2022-09-03T17:57:14 0.714 -0.13
28 2022-09-03T17:57:17 0.894 5.48
29 2022-09-03T17:57:20 0.986 8.54
30 2022-09-03T17:57:23 0.988 8.47
31 2022-09-03T17:57:26 1.368 20.58
32 2022-09-03T17:57:29 1.354 20.26
33 2022-09-03T17:57:32 0.714 -0.19
34 2022-09-03T17:57:35 0.716 -0.13
35 2022-09-03T17:57:38 0.714 -0.19
36 2022-09-03T17:57:41 0.714 -0.19
37 2022-09-03T17:57:44 0.714 -0.19
38 2022-09-03T17:57:47 0.716 -0.19
39 2022-09-03T17:57:50 0.714 -0.19
40 2022-09-03T17:57:53 0.714 -0.13
41 2022-09-03T17:57:56 0.714 -0.13
42 2022-09-03T17:57:59 0.714 -0.19
43 2022-09-03T17:58:02 0.714 -0.13

View File

@ -0,0 +1,49 @@
time and date, Voltage of depth sensor (V), Depth (m)
2022-09-03T18:01:18,0.716,-0.13
2022-09-03T18:01:21,0.716,-0.13
2022-09-03T18:01:24,0.714,-0.19
2022-09-03T18:01:27,0.716,-0.13
2022-09-03T18:01:30,0.714,-0.19
2022-09-03T18:01:33,0.716,-0.13
2022-09-03T18:01:36,0.716,-0.13
2022-09-03T18:01:39,0.716,-0.13
2022-09-03T18:01:42,0.716,-0.13
2022-09-03T18:01:45,0.714,-0.19
2022-09-03T18:01:48,0.714,-0.19
2022-09-03T18:01:51,0.714,-0.19
2022-09-03T18:01:54,0.714,-0.19
2022-09-03T18:01:57,0.716,-0.13
2022-09-03T18:02:00,0.716,-0.13
2022-09-03T18:02:03,0.714,-0.19
2022-09-03T18:02:06,0.714,-0.19
2022-09-03T18:02:09,0.714,-0.19
2022-09-03T18:02:12,0.714,-0.19
2022-09-03T18:02:15,0.714,-0.19
2022-09-03T18:02:18,0.716,-0.13
2022-09-03T18:02:21,0.716,-0.13
2022-09-03T18:02:24,0.714,-0.19
2022-09-03T18:02:27,0.714,-0.19
2022-09-03T18:02:30,0.714,-0.19
2022-09-03T18:02:33,0.714,-0.19
2022-09-03T18:02:36,0.714,-0.19
2022-09-03T18:02:39,0.716,-0.13
2022-09-03T18:02:42,0.714,-0.19
2022-09-03T18:02:45,0.714,-0.19
2022-09-03T18:02:48,0.714,-0.19
2022-09-03T18:02:51,0.714,-0.19
2022-09-03T18:02:54,0.714,-0.19
2022-09-03T18:02:57,0.714,-0.19
2022-09-03T18:03:00,0.714,-0.19
2022-09-03T18:03:03,0.714,-0.19
2022-09-03T18:03:06,0.714,-0.19
2022-09-03T18:03:09,0.714,-0.19
2022-09-03T18:03:12,0.714,-0.19
2022-09-03T18:03:15,0.714,-0.19
2022-09-03T18:03:18,0.716,-0.13
2022-09-03T18:03:21,0.716,-0.13
2022-09-03T18:03:24,0.714,-0.19
2022-09-03T18:03:27,0.716,-0.13
2022-09-03T18:03:30,0.714,-0.19
2022-09-03T18:03:33,0.714,-0.19
2022-09-03T18:03:36,0.714,-0.19
2022-09-03T18:03:39,0.714,-0.19
1 time and date Voltage of depth sensor (V) Depth (m)
2 2022-09-03T18:01:18 0.716 -0.13
3 2022-09-03T18:01:21 0.716 -0.13
4 2022-09-03T18:01:24 0.714 -0.19
5 2022-09-03T18:01:27 0.716 -0.13
6 2022-09-03T18:01:30 0.714 -0.19
7 2022-09-03T18:01:33 0.716 -0.13
8 2022-09-03T18:01:36 0.716 -0.13
9 2022-09-03T18:01:39 0.716 -0.13
10 2022-09-03T18:01:42 0.716 -0.13
11 2022-09-03T18:01:45 0.714 -0.19
12 2022-09-03T18:01:48 0.714 -0.19
13 2022-09-03T18:01:51 0.714 -0.19
14 2022-09-03T18:01:54 0.714 -0.19
15 2022-09-03T18:01:57 0.716 -0.13
16 2022-09-03T18:02:00 0.716 -0.13
17 2022-09-03T18:02:03 0.714 -0.19
18 2022-09-03T18:02:06 0.714 -0.19
19 2022-09-03T18:02:09 0.714 -0.19
20 2022-09-03T18:02:12 0.714 -0.19
21 2022-09-03T18:02:15 0.714 -0.19
22 2022-09-03T18:02:18 0.716 -0.13
23 2022-09-03T18:02:21 0.716 -0.13
24 2022-09-03T18:02:24 0.714 -0.19
25 2022-09-03T18:02:27 0.714 -0.19
26 2022-09-03T18:02:30 0.714 -0.19
27 2022-09-03T18:02:33 0.714 -0.19
28 2022-09-03T18:02:36 0.714 -0.19
29 2022-09-03T18:02:39 0.716 -0.13
30 2022-09-03T18:02:42 0.714 -0.19
31 2022-09-03T18:02:45 0.714 -0.19
32 2022-09-03T18:02:48 0.714 -0.19
33 2022-09-03T18:02:51 0.714 -0.19
34 2022-09-03T18:02:54 0.714 -0.19
35 2022-09-03T18:02:57 0.714 -0.19
36 2022-09-03T18:03:00 0.714 -0.19
37 2022-09-03T18:03:03 0.714 -0.19
38 2022-09-03T18:03:06 0.714 -0.19
39 2022-09-03T18:03:09 0.714 -0.19
40 2022-09-03T18:03:12 0.714 -0.19
41 2022-09-03T18:03:15 0.714 -0.19
42 2022-09-03T18:03:18 0.716 -0.13
43 2022-09-03T18:03:21 0.716 -0.13
44 2022-09-03T18:03:24 0.714 -0.19
45 2022-09-03T18:03:27 0.716 -0.13
46 2022-09-03T18:03:30 0.714 -0.19
47 2022-09-03T18:03:33 0.714 -0.19
48 2022-09-03T18:03:36 0.714 -0.19
49 2022-09-03T18:03:39 0.714 -0.19

View File

@ -0,0 +1,11 @@
GPStime utc,latitude,longitude,speed,sats in view
2022-08-20T09:23:40.000Z,60.196451148,24.960462239,0.582,0
2022-08-20T09:23:41.000Z,60.196446687,24.960462239,0.374,0
2022-08-20T09:23:42.000Z,60.196437765,24.960462239,0.257,7
2022-08-20T09:23:43.000Z,60.196441539,24.960486191,0.192,7
2022-08-20T09:23:44.000Z,60.196441539,24.960486191,0.121,7
2022-08-20T09:23:45.000Z,60.196437078,24.960486191,0.279,7
2022-08-20T09:23:46.000Z,60.196439678,24.960493798,0.233,7
2022-08-20T09:23:47.000Z,60.196439678,24.960493798,0.059,7
2022-08-20T09:23:48.000Z,60.196439678,24.960493798,0.124,7
2022-08-20T09:23:49.000Z,60.196446739,24.960501406,0.369,7
1 GPStime utc latitude longitude speed sats in view
2 2022-08-20T09:23:40.000Z 60.196451148 24.960462239 0.582 0
3 2022-08-20T09:23:41.000Z 60.196446687 24.960462239 0.374 0
4 2022-08-20T09:23:42.000Z 60.196437765 24.960462239 0.257 7
5 2022-08-20T09:23:43.000Z 60.196441539 24.960486191 0.192 7
6 2022-08-20T09:23:44.000Z 60.196441539 24.960486191 0.121 7
7 2022-08-20T09:23:45.000Z 60.196437078 24.960486191 0.279 7
8 2022-08-20T09:23:46.000Z 60.196439678 24.960493798 0.233 7
9 2022-08-20T09:23:47.000Z 60.196439678 24.960493798 0.059 7
10 2022-08-20T09:23:48.000Z 60.196439678 24.960493798 0.124 7
11 2022-08-20T09:23:49.000Z 60.196446739 24.960501406 0.369 7

View File

@ -14,18 +14,18 @@ i2c = busio.I2C(board.SCL, board.SDA)
ads = ADS.ADS1015(i2c)
# Create single-ended input on channel 0
tmp36 = AnalogIn(ads, ADS.P0)
# tmp36 = AnalogIn(ads, ADS.P0)
# Attempting to create a single-ended input on channel 1
depthS = AnalogIn(ads, ADS.P1)
# Subtract the offset from the sensor voltage
# and convert chan.voltage * (1 degree C / 0.01V) = Degrees Celcius
temperatureC = (tmp36.voltage - 0.5) / 0.01
# temperatureC = (tmp36.voltage - 0.5) / 0.01
# Open the file to write down the results
timestr = time.strftime("%Y-%m-%dT%H-%M-%S")
filename = "/home/shared/logger-raspi-setup/data/depth-temp/" + timestr + "depth_temperature_data.csv"
filename = "/home/shared/logger-raspi-setup/data/depth/" + timestr + "_depth_data.csv"
#depthM = ((depthS.voltage * 31.848) - 22.93)
@ -35,18 +35,19 @@ filename = "/home/shared/logger-raspi-setup/data/depth-temp/" + timestr + "depth
#bar = psi * 14.503773800722
with open(filename, "w") as f:
f.write("time and date, temperature (C), Voltage of depth sensor (V), Depth (m)\n")
with open(filename, "w", 1) as f:
f.write("time and date, Voltage of depth sensor (V), Depth (m)\n")
while True:
depthM = ((depthS.voltage * 31.848) - 22.93)
voltage = depthS.voltage
depthM = ((voltage * 31.848) - 22.93)
rounddepth = round(depthM, 2)
roundtemp = round(temperatureC, 2)
roundvolts = round(depthS.voltage, 3)
# roundtemp = round(temperatureC, 2)
roundvolts = round(voltage, 3)
print((str(roundtemp) + " °C ") + (str(roundvolts) + " V ") + (str(rounddepth) + " m"))
print((str(voltage) + " V ") + (str(depthM) + " m ") + (str(roundvolts) + " V ") + (str(rounddepth) + " m"))
f.write(time.strftime("%Y-%m-%d %H:%M:%S") + ",")
f.write((str(roundtemp) + " °C ") + "," + (str(roundvolts) + " V ") + "," + (str(rounddepth) + " m\n"))
f.write(time.strftime("%Y-%m-%dT%H:%M:%S") + ",")
f.write(str(roundvolts) + "," + str(rounddepth) + "\n")
time.sleep(3)