Humidity sensor with led alarm | Arduino project

This page contains Arduino Humidity sensor with led alarm source code. This project is good for someone who wants to make a humidity meter or hygrometer with led alarm if humidity and temperature over a threshold. It's easy to make and doesn't require an external power supply, just use power from an Arduino UNO R3 board (USB power compatible with this project).

Electronic components list:
1 x Arduino Uno R3
1x 20 x4 I2C LCD display
1 x AM 2320 humidity/temp sensor
1 x 5 mm led ( 2 x if you plan to use led for pin 13 instead built-in led)
1 x 1000 ohms resistor ( 2 x if you plan to use led for pin 13 instead built-in led)
Any USB power adapter, 500 mA current at least.

Here is the Arduino code:
AM 2320 library
LCD display i2c library

#include <Wire.h>
#include <AM2320.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x3F, 20, 4);
AM2320 th;
int led2 = 12;

how to make condenser microphone pre-amplifier

I saw a comment on my youtube video that he want to connect condenser microphone directly to pam8610 amplifier board. However, if he needs to connect condenser microphone to any amplifier board he must bias and amplify the signal before.

Now let's start!!!

Condenser microphone need a power supply to bias circuit inside that why we need specific preamplifier for it. You need two electronic component to make condenser microphone to operate 

1. 2 to 10 kilo-ohms resistor
2. Capacitor uses to blocking dc current to preamplifier
See picture below for better understand.

However, an output signal from the microphone is very small and need to amplify with any preamplifier before connecting to amplifier board. Now, let's start making and preamplifier.

Above picture shows how to bias opamp for single power supply (V+ and Ground)
R1 and R2 divide voltage to 1/2 power supply I use 2x 20 kilo-ohms resistors
R3 use to set input impedance I use 10 kilo-ohms resistor so the voltage on non-inverting opamp input is half of power supply.

An above picture shows feedback part of the opamp we use them to set amplifier gain but you need to remember if you increase gain the opamp bandwidth will decrease so I setting the gain for this preamplifier to around 21 times.
The formula for noninverting operation feedback is 1+ (R1/R2) The R1 feedback from output and R2 connect from inverting input to ground, The feedback also needs a capacitor (C1) to block any dc current to ground.

You also need DC blocking from preamplifier output to an amplifier board. Like an image above.
Now let's test a condenser microphone pre-amplifier in real life.

List of component:

IC ne5534
R1,R4 20 Kilo-ohms (See how to read resistor color code here)
R2,R3 10 kilo-ohms
R5 10 kilo-ohms
R6 500 ohms
C1 2.2 uf/16 volts ( C1 can replace with MKP type capacitor for better sound)
C2 0.1 uf/60 volts ceramic or mks,MKP cap (lower value increase high-frequency respond)
C3 2.2 uf/16 volts (C3 also can replace with MKP type capacitor for better sound)
C4 10 uf/16 volts (can use 100 uf/16 volts for better low-frequency respond)
power supply 5 - 12 volts


  1. Can i replace ne5534 with ha741/lm741? & Why ne5534 is better than 741? Answer As simple as possible..

    1. lm741 high frequency respond is poor, you can hear the different easily.


Post a Comment