User Tools

Site Tools


atmos:researchmeetingnotes:researchmeetingnotes:home:lizcardoza

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
atmos:researchmeetingnotes:researchmeetingnotes:home:lizcardoza [2025/06/17 20:57] – [Carbon Dioxide Balloon-borne Observations] mwitherspoonatmos:researchmeetingnotes:researchmeetingnotes:home:lizcardoza [2025/07/15 14:31] (current) – [Carbon Dioxide Balloon-borne Observations] mwitherspoon
Line 77: Line 77:
   * To test if the raspberry pi is detecting any sensors in terminal: sudo i2cdetect -y 1 (It will be a diagram with dashes and numbers should show for each sensor: if you have 3 sensors three different values should be present)   * To test if the raspberry pi is detecting any sensors in terminal: sudo i2cdetect -y 1 (It will be a diagram with dashes and numbers should show for each sensor: if you have 3 sensors three different values should be present)
  
-import time +Presenation (July 15th2025): 
-import csv +
-import board +
-import busio +
-import adafruit_mcp9808 +
- +
-# Set up I2C and sensor +
-i2c = busio.I2C(board.SCLboard.SDA) +
-mcp = adafruit_mcp9808.MCP9808(i2c) +
- +
-csv_filename = "mcp9808_log.csv" +
- +
-# Write header if file is new +
-try: +
-    with open(csv_filename, "x", newline="") as csvfile: +
-        writer = csv.writer(csvfile) +
-        writer.writerow(["timestamp", "temperature_C"]) +
-except FileExistsError: +
-    pass +
- +
-print("Logging MCP9808 data. Press Ctrl+C to stop."+
- +
-try: +
-    while True: +
-        temperature = mcp.temperature +
-        timestamp = time.strftime("%Y-%m-%d %H:%M:%S"+
- +
-        print(f"{timestamp} | Temp: {temperature:.2f} C") +
- +
-        with open(csv_filename, "a", newline="") as csvfile: +
-            writer = csv.writer(csvfile) +
-            writer.writerow([timestamp, f"{temperature:.2f}"]) +
- +
-        time.sleep(5) +
-except KeyboardInterrupt: +
-    print("\nLogging stopped."+
  
 ===== History ==== ===== History ====
   * Liz Cardoza worked on project during 2024 Summer REU, see [[http://www.openscienceassociates.com/delene/Cardoza_REU2024_Poster.pdf|REU Poster]]   * Liz Cardoza worked on project during 2024 Summer REU, see [[http://www.openscienceassociates.com/delene/Cardoza_REU2024_Poster.pdf|REU Poster]]
 +  * Michael Witherspoon 2025 Summer REU
atmos/researchmeetingnotes/researchmeetingnotes/home/lizcardoza.1750193840.txt.gz · Last modified: 2025/06/17 20:57 by mwitherspoon