diff --git a/microcontroller/sketch_apr22a/sketch_apr22a.ino b/microcontroller/sketch_apr22a/sketch_apr22a.ino index fe7f26b..8236efa 100644 --- a/microcontroller/sketch_apr22a/sketch_apr22a.ino +++ b/microcontroller/sketch_apr22a/sketch_apr22a.ino @@ -356,11 +356,12 @@ float getKadarGas() { // konversi tegangan ke persen berdasarkan rumus yang telah ditentukan float getPersentaseKadarGas(float voltase) { - float m = 6.0 / (1.49 / 0.81); - float b = -m * 0.81; + float m = 6.0 / (1.49 / 0.33); + float b = -m * 0.33; float persentase = m * voltase + b; - // float persentase = 0.2043 * pow(voltase, 2.0) + 0.0611 * voltase - 0.0249; float hasil = constrain(persentase * 100, 0, 100); + // float persentase = 0.2043 * pow(voltase, 2.0) + 0.0611 * voltase - 0.0249; + // float hasil = constrain(persentase * 100, 0, 100); return hasil; } @@ -512,13 +513,15 @@ void cekKematangan() { void cekKegagalan() { int lamaJam = getLamaJamFermentasi(); - float regresiKadarGas = 0.0025 * pow(lamaJam, 2.0) - 0.0397 * lamaJam - 0.1222; - float nilaiPerempat = regresiKadarGas / 4.0; + // = -0,000006 * (x * x) + (0,0013 * x) + 0,002; + float regresiKadarGas = -0.000006 * pow(lamaJam, 2.0) + 0.0013 * lamaJam + 0.002; + regresiKadarGas = regresiKadarGas * 100; + float nilaiPertiga = regresiKadarGas / 3.0; if (lamaJam > 12) { // jika kadar gas tidak naik secara signifikan - // if (persentaseKadarGas > (regresiKadarGas + nilaiPerempat) || persentaseKadarGas < (regresiKadarGas - nilaiPerempat)) { - if (persentaseKadarGas < (regresiKadarGas - nilaiPerempat)) { + // if (persentaseKadarGas > (regresiKadarGas + nilaiPertiga) || persentaseKadarGas < (regresiKadarGas - nilaiPertiga)) { + if (persentaseKadarGas < (regresiKadarGas - nilaiPertiga)) { status = "Gagal"; insertHistory(false); } diff --git a/microdebugging/microdebugging.ino b/microdebugging/microdebugging.ino index d24a367..67bc193 100644 --- a/microdebugging/microdebugging.ino +++ b/microdebugging/microdebugging.ino @@ -358,12 +358,17 @@ float getKadarGas() { // konversi tegangan ke persen berdasarkan rumus yang telah ditentukan float getPersentaseKadarGas(float voltase) { - float m = 6.0 / (1.49 / 0.81); - float b = -m * 0.81; - float persentase = m * voltase + b; - // float persentase = 0.2043 * pow(voltase, 2.0) + 0.0611 * voltase - 0.0249; + // float m = 6.0 / (1.49 / 0.33); + // float b = -m * 0.33; + // float persentase = m * voltase + b; + // float hasil = constrain(persentase, 0, 100); + + float persentase = 0.0526 * voltase - 0.0174; float hasil = constrain(persentase * 100, 0, 100); + // float persentase = 0.2043 * pow(voltase, 2.0) + 0.0611 * voltase - 0.0249; + // float hasil = constrain(persentase * 100, 0, 100); + return hasil; } diff --git a/pcb.png b/pcb.png new file mode 100644 index 0000000..6fdf141 Binary files /dev/null and b/pcb.png differ diff --git a/printpcb.pdf b/printpcb.pdf new file mode 100644 index 0000000..a59e554 --- /dev/null +++ b/printpcb.pdf @@ -0,0 +1,2 @@ +04/06/24 11.42 /Users/izzaalfiansyah/Documents/EAGLE/projects/fermonitor/schematic.brd + diff --git a/printpcbmirror.pdf b/printpcbmirror.pdf new file mode 100644 index 0000000..8ebe954 --- /dev/null +++ b/printpcbmirror.pdf @@ -0,0 +1,2 @@ +04/06/24 15.42 mirrored /Users/izzaalfiansyah/Documents/EAGLE/projects/fermonitor/schematic.brd + diff --git a/printpcbv2.pdf b/printpcbv2.pdf new file mode 100644 index 0000000..fa86af8 --- /dev/null +++ b/printpcbv2.pdf @@ -0,0 +1,2 @@ +04/06/24 13.57 /Users/izzaalfiansyah/Documents/EAGLE/projects/fermonitor/schematic.brd + diff --git a/website/src/App.tsx b/website/src/App.tsx index 90f6d77..13bfa06 100644 --- a/website/src/App.tsx +++ b/website/src/App.tsx @@ -147,7 +147,7 @@ export default function (props: JSX.HTMLAttributes) {
Fermonitor
- +