From 0d0cd8d7b6d78f263d1ab6af8a919416e381482e Mon Sep 17 00:00:00 2001 From: Marcus Date: Wed, 5 Jun 2024 14:02:15 +0200 Subject: [PATCH] firmware wip - adjust PWM frequency. todo: add some decoupling capacitors to pcb --- Arduino/CanGrow/CanGrow.ino | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Arduino/CanGrow/CanGrow.ino b/Arduino/CanGrow/CanGrow.ino index b6eddd6..807841d 100644 --- a/Arduino/CanGrow/CanGrow.ino +++ b/Arduino/CanGrow/CanGrow.ino @@ -77,12 +77,8 @@ void setup() { // PINsoilmoisture is always HIGH and gets LOW in moment of waterlevel measurement digitalWrite(PINsoilmoisture, LOW); - // set PWM frequency lower to avoid annoying noises - // in combination with 47uF at fan output, 220Hz is kinda sweetspot for a fan - // but i guess putting just a cap in parallel for voltage regulation isnt a good idea - // low pass filter or buck converter would be better - // 220Hz is note A3 btw. - analogWriteFreq(220); + // set PWM frequency to 2.2KHz + analogWriteFreq(2200); // Start EEPROM EEPROM.begin(512); @@ -229,7 +225,7 @@ void loop() { if(MaintenanceMode == true) { if((currentRuntime - MaintenanceStarted <= MaintenanceDuration * 1000 ) && (UseLEDrelais == false)) { // in case of being in Maintenance Mode , dimm the grow light when not a relais is used - setOutput(1, 20); + setOutput(1, 15); } else { MaintenanceMode = false; }