Code for a CanSat or OBCs GUI ground station where different sensor data are displayed in real time. No sensors needed to try it. 2022 jun update.
If you used this project or learned something please give this project a star to keep doing open source projects
The purpose of this project is to make a GUI for the data transmitted by an OBC (on board computer) or a CanSat understandable at first sight through a text string on a serial port.
This project is strongly related to another rocket science and CanSat project. It's still in development.
-
Most of the times the text items disappear, i invite you to solve this.
-
Sometimes it can't convert the first value of the list to int, but it solves it self by re-running it.
-
the speed graph is under development, it grows to infinity.
Project is created with:
- numpy==1.22.4
- PyQt5==5.15.6
- PyQt5-Qt5==5.15.2
- PyQt5-sip==12.10.1
- pyqtgraph==0.12.4
- pyserial==3.5
To be able to run it you have to open the terminal in the folder and type:
$ virtualenv env
$ source env/bin/activate
$ pip3 install -r requirements.txt
$ python3 main.py
if you don't have the electronics you can still use it! When the terminal asks you to write a serial port, write anything and it will work, it will display random data. (but the text bug remains ;v).
Open CMD or PowerShell in the folder and type:
> virtualenv env
> \env\Scripts\activate.bat
> pip install -r requirements.txt
> python main.py
Every 500 ms takes a sample, this number comes from the data rate that the Arduino has if you don't have the Arduino and Sensors, the GUI still works, it graphs random data. The loop is:
timer = pg.QtCore.QTimer()
timer.timeout.connect(update)
timer.start(500)
The update()
function updates the graphics and text of the interface. The first thing it does is get a list of the information to be updated, this list is noted as a value_chainr
.
Then within update
you execute the update methods specific to each element that depends on this list.
The values it receives are: 0. Logging time
- Relative height
- Is in free fall (0 or 1)
- Temperature
- Atmospheric pressure
- Pitch
- Roll
- Yaw
- Acceleration in X
- Y-axis acceleration
- Z-acceleration
Clicking on the Start storage button calls a function of the data_base class that changes a state that determines whether the guardar
method writes the information in the list. The same happens with the Stop storage button.
In this file the list called value_chain
is stored in the same order adding at the end the date that is registered in the computer.
"If I have seen further than others, it is by standing upon the shoulders of giants." - newton making fun of hooke's back.
- Hrisko, J. (2018). Python Datalogger - Using pySerial to Read Serial Data Output from Arduino.
- Sepúlveda, S. Reyes, P. Weinstein, A. (2015). Visualizing physiological signals in real-time. doi: 10.25080/Majora-7b98e3ed-01c
- Golubev, P. (2018). Run Real-time pyqtgraph in PlotWidget GUI.
- Pythonspot.(n.d). PyQt5.
- Mr. Tom. (2016). Calculate speed from accelerometer.
- Selfert, K. Camacho, O. (2007). Implementing Positioning Algorithms Using Accelerometers. Freescale Semiconductor.
- Many other cool people on stack overflow.
It's MIT <3. (for now)
Developed by Daniel Alejandro Rodriguez Suarez, leader of the ATL research seedbed, linked to the Universidad Distrital's LIDER research group.