amc2022:grouph:link
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
amc2022:grouph:link [2022/09/10 00:02] – gustavo001 | amc2022:grouph:link [2023/01/05 14:38] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
===== Build ====== | ===== Build ====== | ||
{{ : | {{ : | ||
+ | | //**figure 5.1**// Setup showing the connections for battery voltage reading on ESP32 | | ||
===== Schematics ===== | ===== Schematics ===== | ||
{{ : | {{ : | ||
+ | | //**figure 5.2**// Schematic for battery voltage reading | | ||
===== Code & Description ====== | ===== Code & Description ====== | ||
Line 59: | Line 61: | ||
} | } | ||
+ | *//For the conversion between the actual Analog reading to a percentage we use a mapFloat function | ||
+ | *//It uses the input range from the analog sensor to produce another set of useful values | ||
+ | *//float values will allows to get decimal numbers and a more accurate reading | ||
+ | *//We use a the min voltage value, then max voltage value, and min percentage and max percentage | ||
+ | *//Then we ask the program to give us the corresponding percentage value within the parameters | ||
| | ||
Line 69: | Line 75: | ||
- | if (voltage > 7.0 && voltage < 8.2) // THIS VALUES HAVE TO CHANGE | + | if (voltage > 7.0 && voltage < 8.2) // THIS VALUES HAVE TO CHANGE |
{Serial.print(" | {Serial.print(" | ||
} | } | ||
- | if (voltage < | + | if (voltage < |
{Serial.print(" | {Serial.print(" | ||
} | } | ||
Line 78: | Line 84: | ||
+ | *//We have included a notification that will tell us what is going on with the voltage and overall battery status | ||
+ | *//We include a parameter that will produce 2 warning signs: | ||
+ | *// LOW BAT means that our battery is within 7 to 8.2V | ||
+ | *// REPLACE BATTERY means voltage has dropped below 6.5V, number obtained from data sheet | ||
+ | |||
} | } | ||
} | } | ||
Line 85: | Line 96: | ||
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; | return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; | ||
} | } | ||
+ | |||
+ | *//here we include the parameters and equation that will serve as the backbone for the mapFloat function above. | ||
+ | |||
void loop() | void loop() | ||
Line 92: | Line 106: | ||
- | // NO LOOP NEEDED,,, ONE VALUE WITH WARNING SHOULD BE DISPLAYED ON GRAFANA | + | *// NO LOOP NEEDED,,, ONE VALUE WITH WARNING SHOULD BE DISPLAYED ON GRAFANA |
| | ||
Line 101: | Line 115: | ||
===== Issues & Characteristics ====== | ===== Issues & Characteristics ====== | ||
- | *//The actual voltage will not be 100% accurate because the ADC pins have a non-linear | + | The actual voltage will not be 100% accurate because the ADC pins have a non-linear |
+ | Additionally we can see that the discharge behavior of the battery we are using, which is a model 6F22 is a curve that has a specific equation, we could find the curve' | ||
- | <WRAP group> | + | ^ {{ : |
- | <WRAP half column> | + | | |
- | {{: | + | |
- | </WRAP> | + | |
- | <WRAP half column> | ||
- | {{: | ||
- | </ | ||
- | </ | ||
amc2022/grouph/link.1662760923.txt.gz · Last modified: 2023/01/05 14:38 (external edit)