2022-05-19 06:19:37 +00:00
# Read Resistances
## Required & Dependencies
### Required
- Python 3 (but below 3.10). And the following packages using `pip` .
2022-05-22 19:19:16 +00:00
Alternatively, you can just switch the file source of the Command line Prompt by using 'cd \file address\\' and after that, run `pip install -r requirements.txt` in to have all packages installed automatically
2022-05-19 06:19:37 +00:00
- matplotlib
- pyserial
- wxPython
- PlatformIO IDE, which could be downloaded as an extension in vs code
2022-08-08 06:47:03 +00:00
- ESP32 WROOM-32 Development Board
2022-05-19 06:19:37 +00:00
### Recommended
- Code Runner (for VSCode only)
- wxFormBuilder
2022-05-20 20:22:43 +00:00
- [Arduino IDE ](https://makeabilitylab.github.io/physcomp/arduino/arduino-ide.html )
2022-05-19 06:19:37 +00:00
## How to use
### Direct use
2022-08-08 06:47:03 +00:00
First download the `.ino` file from `espVoltmeter` folder using Arduino IDE. ~~Or if you are using Arduino Mega 2560 you can
use the code in `ReadAnalog` folder by open the folder in VSCode and run with PlatformIO, or just run `flash.py` in a terminal~~
(Arduino Mega and Uno boards are no longer supported. Please use [this link ](https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html ) to
use on Arduino IDE or PlatformIO for VSCode)
Then you can just run `python test.py` and start from the UI. Enter the relevant information and start collect and measuring data.
2022-05-19 06:19:37 +00:00
### develop & build
Beside the c-based code for the Arduino board to read raw data from the board, everything has now been done in the python
2022-08-08 06:47:03 +00:00
files. The main program is `test.py` , which calls `UI.py` to prompt for input. It is NOT recommended modifying the `ui.py`
2022-05-19 06:19:37 +00:00
as it is generated from wxFormBuilder from `sealammonia.fbp` , which could be modified if any frontend feature need to change.
the main program will generate `settings.json` which saves all required parameters needed to calculate and graph and save the
sensor's values. It also creates a .csv file under `RecordedData` directory to save all recorded+calculated data.
2022-08-08 22:51:36 +00:00
`read_arduino.py` read raw data from Arduino board and convert it to the correct resistance, which could be plotted out
using `serial_plotter.py` . `frontend.py` is the alternative version of the frontend writting using `tkinter` , and `serial_plot.py`
was an older version of `serial_plotter.py` . They are not longer supported.
2022-05-19 06:19:37 +00:00
## Issues
2022-08-08 06:47:03 +00:00
- Newer hardware will require 3.3V. ~~Currently can only use 5V as input voltage.~~ May need to change the algorithm in `read_arduino.py` .
2022-07-17 20:41:23 +00:00
- Should call `writerandomvalues.py` to simulate Arduino data when nothing is connected but user still want to run. Currently just pop up error(fixed)
2022-05-19 06:19:37 +00:00
- "plot" button is completely disabled, should be enabled whenever is not plotting but is reading data
2022-06-26 19:55:40 +00:00
- Matplotlib cannot really run in multithread, this might going to be an issue for packing the program into an executable
2022-07-17 20:21:51 +00:00
- Csv file is only created after you close the UI
2022-08-08 22:51:36 +00:00
- axis window size is not correct
2022-05-19 06:19:37 +00:00
2022-08-08 06:47:03 +00:00
## Todos & [Old Specs](https://docs.google.com/document/d/1Km2HZel7rILOvgHG5iXlUcXFx4Of1ot2I7Dbnq8aTwY/edit?usp=sharing):
2022-05-19 06:19:37 +00:00
- [ ] Fix Issues
2022-08-08 06:47:03 +00:00
- [ ] Automatically setup the driver for ESP32
2022-05-19 06:19:37 +00:00
- [ ] display sensor value in either the UI or on the plot
- [ ] Reopen plot window from the UI when closed
- [x] Need to continue writing to file when graphing window is closed
- [ ] Make it so the time stamp is the actual time
- [x] No blank line in between lines of csv file (new line may be added when file is closed)
- [ ] Make it so we have the option to run multiple graphs at the same time, setting window size in UI
- [ ] Inputting value of 0 for window size should have an infinite window size
2022-07-17 20:41:23 +00:00
- [x] Accept any inputs (such as resistor values, plot window size, base voltage etc.) as either command line argument or as input at beginning of program
- [x] Write random values to simulate a sensor if no sensor available (this feature might be removed in the future)
2022-05-19 06:19:37 +00:00
- [ ] Advanced option menu in the UI to allow user to make more adjustments
2022-06-05 20:26:11 +00:00
- [ ] Add resolution option in the UI to allow interchange between arduino (10bit) and esp32 (12 bits)
2022-08-08 06:47:03 +00:00
- [x] Possibly adding new module to support ESP32
- [ ] Support for non-Windows platforms (and maybe mobile)
2022-06-26 19:55:40 +00:00
- [ ] Make it into one executable
2022-08-08 06:47:03 +00:00
- [ ] Possibly adding new module to support Arduino MEGA and older firmwares