I'm trying to control my ventilation with heat recovery unit, it needs a signal from 1 - 10 volt
10 volt == Low ventilation
5 volt == Middle ventilation
0 volt == High ventilation
Normally i want low ventilation, when the recovery unit starts i will take that signal to set the arduino to 5 volts. Beceause it needs more ventilation, else the unit will freeze. And then I want to use a push button when i start to shower (With timer).
I'm using the pwm signal to control a mosfet module IRF520. I know it's not a logic mosfet but it is ussable. I made a code in tinkercad, and there it works. But in real life it doesn't work at all. I just don't get it.
This is the code:
const int BUTTON1 = 3;
const int BUTTON2 = 1;
const int LED = 11;
int BUTTON1state = 0;
int BUTTON2state = 0;
unsigned long debounceDuration = 50; // millis
unsigned long lastTimeButtonStateChanged = 0;
Please follow the advice given in the link below when posting code. Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination
I'm getting no output. from the mosfet. I can manual switch the mosfet with a high pwm signal then it works (12v) also with half level pwm I get 5 volts.
1. You have one switch. Correct? 2. At what DPin (digital pin) is the switch connected? 3. Switch is low -- does it mean the switch is closed? 4. Switch is high -- does it mean the switch is opened? 5. Button is pushed -- does it mean that you have another switch named Button? It is pushed -- does it mean that the Button is closed?