Skip to content

Commit

Permalink
Changes according to discussion here:
Browse files Browse the repository at this point in the history
https://meshtastic.discourse.group/t/heltec-tracker-v1-and-v1-1-power-config/12016/4

WORK IN PROGRESS

TL;DR.

Output high to measure voltage in the same why as other heltec device forces the ESP32 to try to pump 3.3v into the base of Q3.
Solution, use internal pullup and pulldown resistors.
http://community.heltec.cn/t/wireless-tracker-power-consumption/13841/6

Progress so far:

* Hasn't caught fire yet.
* Battery measurements seems ok

TODO:

* Measure current, check voltages at pins.
  * Not in a position to measure or a differences for a few days.
* take a better look at code
* CLA issues? credit to OP?
* check circuit for tracker v1.0

Related to this open issue.
meshtastic#3760
  • Loading branch information
mkgin committed Jun 21, 2024
1 parent 0dd363f commit 77d211b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Power.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,15 @@ class AnalogBatteryLevel : public HasBatteryLevel

#ifndef BAT_MEASURE_ADC_UNIT // ADC1
#ifdef ADC_CTRL // enable adc voltage divider when we need to read
#ifdef HELTEC_TRACKER_V1_1
pinMode(ADC_CTRL, ADC_CTRL_ENABLED == LOW ? INPUT_PULLDOWN : INPUT_PULLUP);
//suggested in discourse.
#else
pinMode(ADC_CTRL, OUTPUT);
digitalWrite(ADC_CTRL, ADC_CTRL_ENABLED);
#endif
delay(10);
#endif
#endif // ADC_CTRL
for (int i = 0; i < BATTERY_SENSE_SAMPLES; i++) {
int val_ = adc1_get_raw(adc_channel);
if (val_ >= 0) { // save only valid readings
Expand Down

0 comments on commit 77d211b

Please sign in to comment.