Skip to content

This repository contains code and files for the Project 1 - Variant 1 of the Academic Year 2020/2021

Notifications You must be signed in to change notification settings

andriluca/LTEBS_Final_Project

Repository files navigation

AY2021_Project_1-1

Requirements

Software

  1. Python >= 3.7.9
  2. PSoC Creator == 4.4
  3. python-pip >= 20.3.3

Hardware

  1. PSoC 5LP
  2. LIS3DH
  3. TMP36 (Temperature sensor)
  4. 24LC512 (Ext. EEPROM)

Installation

Circuit

Electrical Schematic

Software dependencies management

Windows users

For a basic installation it's required to run these commands on a prompt.

# 1. Installing virtualenv
pip install virtualenv;
# 2. Creating empty virtual environment
mkdir venv && virtualenv venv;
# 3. Activating virtual environment
.\venv\Scripts\activate;
# 4. Managing the requirements
pip install -r win_requirements.txt;
garden install graph

*nix users

Be sure python-pip is installed on your sistem and that the user is a member of uucp or dialout group.

Through shell script

There are two sh scripts that automate installation and run process. The first one is requiring SU privileges in order to install python-pip.

# Allowing the scripts to be executable.
chmod +x RUN.sh INSTALL.sh
# Running installation script. Application will start after this command.
./INSTALL.sh

NB: tested on an Artix linux machine with pacman as package manager and an iMac running macOS Big Sur. The user is kindly asked to check for pip availability on his/her system.

Manual

Run this block if something went wrong during installation through shell script.

# 1. Installing python-pip (Arch based distribution. change package manager if required)
sudo pacman -Syu
sudo pacman -S python-pip
# 2. Appending $USER to the group uucp
sudo usermod -a -G uucp $USER

The procedure is identical. Dependencies are slightly different.

# 1. Installing virtualenv
pip install virtualenv;
# 2. Creating empty virtual environment
mkdir venv && virtualenv venv;
# 3. Activating virtual environment
source ./venv/Scripts/activate;
# 4. Managing the requirements
pip install -r mac_gnu_requirements.txt;
garden install graph

Running the program

For both the kind of system it's necessary to run the following command in order to run the GUI program.

python GUI/main.py

NB: Color legend is reported in the status bar at the bottom of the interface.

  • Acceleration
    • Red: Acceleration along x_axis.
    • Green: Acceleration along the y_axis.
    • Blue: Acceleration along the z_axis.
  • Temperature: Yellow

NB: If y_label on graphs is upside-down change value (y.angle) in line 428 in Graphs' init.

Users Guide

Graphic User Interface

GUI Screenshot

Command Description
1 Ports Selects the COM port to which the device is connected.
2 Conn./Disconnect Toggles the PSoC-GUI communication.
3 Start/Stop Device Toggles data acquisition (N.B if Stop Device is pressed, the previous acquisitions are still maintained).
4 Print Data Returns the stored data in graphical format and automatically saves the session into a [%H-%M-%S]data.csv. Data are stored in directories named as %F/. Once done device is turned off and EXT_EEPROM is reset.
5 Change Settings Allows to select different configurations according to user request, afterwards resets EXT_EEPROM to avoid data inconsistencies.
6 FSR Full scale range that goes from ±2g to ±16g.
7 ODR Output data rate that can be selected as 1Hz, 10Hz, 25Hz, 50Hz.
8 Temp. Format Selects the temperature measurement unit.
9 EEPROM_Saving Enables/disables EXT_EEPROM data saving.

On-Board Controls

  1. On-Board Button: if pressed for more than 1s toggles device state between Start/Stop (same as GUI), if pressed for more than 5s reset the EXT_EEPROM and then restore the last configuration.

Feedbacks

  1. On-Board LED: it's toggled among four states.
    1. Period 1s, DC 0%: device is in a Stop condition (OFF / IDLE).
    2. Period 1s, DC 50%: device is working and saving data in EXT_EEPROM.
    3. Period 0.25s, DC 50%: device is no longer sampling because EXT_EEPROM is full.
    4. Period 1s, DC 100%: EXT_EEPROM is resetting (the pulse duration depends on the n° of pages been written).
  2. External LED: switches on when EXT_EEPROM is being read and data are sent through UART.

Beta

It's also available a beta version that includes the partial reading of the FIFO registers when a print event occurs before Watermark. To test this version it's possible to remove the // BETA VERSION comments in main branch or, without further efforts, by compiling the code in the last commit of the branch "Partial_reading".

For more technical info

Datasheets

Application Notes

About

This repository contains code and files for the Project 1 - Variant 1 of the Academic Year 2020/2021

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages