Giter Site home page Giter Site logo

lapry34 / so_project_arduino Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 362 KB

This project is designed for an operating systems course and involves using an Arduino to measure electrical current. The measured data is saved and can be accessed from a Linux system, where it can be plotted for analysis.

License: MIT License

Makefile 12.15% C 82.49% Shell 0.75% Python 4.60%

so_project_arduino's Introduction

Current Meter Arduino Project

Overview

This project is designed for an operating systems course and involves using an Arduino to measure electrical current. The measured data is saved and can be accessed from a Linux system, where it can be plotted for analysis.

Project Structure

The project is organized into three main directories: arduino, linux and ML.

Arduino Directory

The arduino directory contains all the files necessary for running the current measurement on the Arduino. The key files include:

  • adc.c / adc.h: Code for the Analog-to-Digital Converter.
  • arduino.c: Main file for Arduino operations.
  • Makefile: Makefile to facilitate the build process
  • avr.mk: Makefile for AVR-specific settings.
  • uart.c / uart.h: Code for UART communication.
  • timers.c / timers.h: Timers initialization.
  • utils.c / utils.h: Utility functions.

Linux Directory

The linux directory contains the files needed to compile, run, and plot data on a Linux system. Key files include:

  • main.c: Main file for Linux-side operations.
  • Makefile: Makefile to facilitate the build process.
  • plot.sh: Script to plot the collected data.
  • serial_linux.c / serial_linux.h: Code for serial communication with the Arduino.
  • utils.c / utils.h: Utility functions.

ML Directory

The ML directory contains the files needed to train a Linear Regression model to fit the sample measuraments:

  • weights.py: Script to train the ML model using Sklearn.
  • data.csv: Data sampled during experiments.

Getting Started

Prerequisites

Ensure you have the following installed:

  • Arduino IDE
  • GCC (GNU Compiler Collection) for compiling C code on Linux
  • Make
  • Gnuplot (for plotting, if applicable)

Setting Up the Arduino

  1. Navigate to the arduino directory:
    cd arduino
  2. Compile and flash (on dev/ttyUSB0) the Arduino code:
    make

Setting Up on Linux

  1. Navigate to the linux directory:
    cd linux
  2. Compile and run the Linux code:
    make
  3. To plot the data, use:
    ./plot.sh

Setting Up Machine Learning

  1. Navigate to the ML directory:
    cd ML
  2. Add measurements to data.csv.
  3. Install requirements:
    pip install -r requirements.txt
  4. Run the script:
    python weights.py

Usage

  • Connect the Arduino to your Linux system via USB.
  • Run the main program to start collecting data.
  • Use the provided script to plot and analyze the data.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgements

Special thanks to Prof. Grisetti and Dr. De Rebotti for the guidance and support throughout the course.

so_project_arduino's People

Contributors

lapry34 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.