I have set up a temperature alarmed monitoring system using 2 DS18B20 temperature sensors, with the output of the buzzer/LED configured to the digital 8 output pin. Initially this operated fine, however the buzzer output was not sufficient.
Therefore I have configured it using a MOSFET (2N7000) to try and amplify the signal. My connections have been the following:
- Vin from Arduino goes to (+) of Piezo speaker
- (-) of Piezo speaker goes to the Drain of the MOSFET
- A 2.2 K ohm resistor connected in parallel to the Piezo speaker
-Digital 8 Pin has a 2.2 K ohm resistor in series and then connected to the Gate of the MOSFET
- Source of MOSFET connected to ground.
I have tried numerous different configurations however this seems the most logical and makes it the closest to getting the correct operation with an amplified output.
However it is still not functioning accordingly. The threshold is set for 25 degrees so when this is exceeded the alarm should go off. The following output is happening:
-On switch on of the Arduino the Alarm is constantly while going through the Void Setup ON (Wrong but not too bothered if remains)
-If the temperature is below 25 degrees the alarm remains ON constantly (Wrong)
-When the temperature goes above 25 degrees the Alarm starts pulsing: On/Off (Correct)
-Now when the temperature goes below 25 degrees the alarm goes OFF (correct)
An help would be much appreciated,