Differences

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

Link to this comparison view

iothings:laboratoare:2025:lab6 [2025/10/28 19:44]
dan.tudose [Why we bother doing this]
iothings:laboratoare:2025:lab6 [2025/10/28 19:55] (current)
dan.tudose [3. Logging training data]
Line 2: Line 2:
  
 ===== What AI/ML + IoT actually is ===== ===== What AI/ML + IoT actually is =====
-The Internet of Things (IoT) is about connecting physical objects — sensors, machines, vehicles, appliances — so they can collect and share data. AI and Machine Learning (ML) are what make that data useful. Instead of just measuring temperature,​ vibration, heart rate, traffic, etc., AI/ML can learn patterns from that data and make decisions: predict a failure, detect something abnormal, optimize energy use, or trigger an action automatically. So in short: IoT gives you data from the real world, AI/ML gives that data “brains.”+The Internet of Things (IoT) is about connecting physical objects — sensors, machines, vehicles, appliances — so they can collect and share data. AI and Machine Learning (ML) are what make that data useful. ​ 
 + 
 +Instead of just measuring temperature,​ vibration, heart rate, traffic, etc., AI/ML can learn patterns from that data and make decisions: predict a failure, detect something abnormal, optimize energy use, or trigger an action automatically. ​ 
 + 
 +So in short: IoT gives you data from the real world, AI/ML gives that data “brains.”
  
 ===== Why we bother doing this ===== ===== Why we bother doing this =====
Line 85: Line 89:
 Run script that logs with label stationary: Run script that logs with label stationary:
  
-''​python ​collect_data.py -stationary --port /​dev/​ttyUSB0 --baud 115200''​+<code> python3 ​collect_data.py -stationary --port /​dev/​ttyUSB0 --baud 115200 ​</​code>​
  
-Get ~10 seconds of data then hit Ctrl+C. The script will automatically save the collected data into ''​raw_data_label_0.csv''​+Get ~10 seconds of data then hit Ctrl+C. The script will automatically save the collected data into ''​raw_data_label0.csv''​
  
 === Run B: "​shake"​ capture (label = 1) === === Run B: "​shake"​ capture (label = 1) ===
Line 94: Line 98:
 Run script #2 that logs with label shaking: Run script #2 that logs with label shaking:
  
-''​python ​collect_data.py -shaking --port /​dev/​ttyUSB0 --baud 115200''​+<code> python3 ​collect_data.py -shaking --port /​dev/​ttyUSB0 --baud 115200 ​</​code>​
  
-Get ~10 seconds of data then hit Ctrl+C. The script will automatically save the collected data into ''​raw_data_label_1.csv''​+Get ~10 seconds of data then hit Ctrl+C. The script will automatically save the collected data into ''​raw_data_label1.csv''​
  
  
-Then we’ll merge the two CSVs in the next step.+Thenwe’ll merge the two CSVs in the next step.
  
 ==== 4. Training the model ==== ==== 4. Training the model ====
Line 118: Line 122:
  
 Download the main.cpp code from [[iothings:​laboratoare:​2025_code:​lab6_4|here]]. Download the main.cpp code from [[iothings:​laboratoare:​2025_code:​lab6_4|here]].
 +
 +Your final project structure should look like this:
 +
 +<​code>​
 +include/
 +  |-LSM6DSL.h
 +  |-model.h
 +src/
 +  |-LSM6DSL.cpp
 +  |-main.cpp
 +platformio.ini
 +</​code>​
  
 When it’s running: When it’s running:
   * Keep the board still → LED should be off (prob_shake < 0.5).   * Keep the board still → LED should be off (prob_shake < 0.5).
   * Shake the board → LED should go green (prob_shake > 0.5).   * Shake the board → LED should go green (prob_shake > 0.5).
iothings/laboratoare/2025/lab6.1761673494.txt.gz · Last modified: 2025/10/28 19:44 by dan.tudose
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0