* Korrekturfaktor für Strom

* Realen Umrechnungsfaktor für Spannung
This commit is contained in:
Carsten Keller 2024-06-09 17:58:11 +02:00
parent 6808851caf
commit ed738a8a8c
Signed by: carsten
GPG Key ID: DF06343A3A9B8868

View File

@ -222,7 +222,7 @@ namespace ElektronischeLast
*/ */
std::uint32_t iADC::get_current(void) std::uint32_t iADC::get_current(void)
{ {
const float factor = 3.3f / 4096.0f * 1000.0f * 4.0f; const float factor = 3.3f / 4096.0f * 1000.0f * 4.0f / 1.08f;
return factor * current; return factor * current;
} }
@ -238,8 +238,13 @@ namespace ElektronischeLast
* @return Spannung in mV * @return Spannung in mV
*/ */
std::uint32_t iADC::get_voltage(void) std::uint32_t iADC::get_voltage(void)
{ { //22,48484848484
const float factor = (100000.0f + 4700.0f) / 4700.0f * 3.3f / 4096.0f * 1000.0f; const float factor = /*(100000.0f + 4700.0f) / 4700.0f*/22.484848484848f * 3.3f / 4096.0f * 1000.0f;
return factor * voltage; return factor * voltage;
} }
/**
* MCP9701
* Vout = TC * TA + V0°C => Tc = (Vout - V0°C) / Tc
* Tc=19,5mV/°C, V0°C=0,4V
*/
} }