member-projects:m0jqq_-_bpq_for_beginners
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| member-projects:m0jqq_-_bpq_for_beginners [2024/12/15 12:27] – [Monitoring a Remote Battery Voltage] m0jqq | member-projects:m0jqq_-_bpq_for_beginners [2025/08/01 18:33] (current) – m0jqq | ||
|---|---|---|---|
| Line 464: | Line 464: | ||
| import serial | import serial | ||
| import time | import time | ||
| - | sdata = serial.Serial('/ | + | sdata = serial.Serial('/ |
| time.sleep(2) | time.sleep(2) | ||
| sdata.reset_input_buffer() | sdata.reset_input_buffer() | ||
| Line 472: | Line 472: | ||
| time.sleep(0.01) | time.sleep(0.01) | ||
| if sdata.in_waiting >0: | if sdata.in_waiting >0: | ||
| - | file = open("/ | + | file = open("/ |
| battState = sdata.readline().decode(' | battState = sdata.readline().decode(' | ||
| file.write(f" | file.write(f" | ||
| Line 484: | Line 484: | ||
| </ | </ | ||
| Make it executable < | Make it executable < | ||
| + | |||
| + | == Create bash startup script – getBattMonitor.sh == | ||
| + | < | ||
| + | nano getBattMonitor.sh | ||
| + | |||
| + | #!/bin/bash | ||
| + | sudo python3 / | ||
| + | sleep 1 | ||
| + | </ | ||
| + | |||
| + | Make it executable < | ||
| + | |||
| + | Now is the time to test your work. Connect a variable power supply set to less than 5 volts to the batt+ and Gnd connections of your Arduino and measure the voltage between GND & A0 It should be about one third of your variable power supply voltage. | ||
| + | Start the script with < | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | a < | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
member-projects/m0jqq_-_bpq_for_beginners.1734265630.txt.gz · Last modified: by m0jqq
