---
title: '7 Simple Arduino Projects for Beginners'
source: 'https://youtube.com/watch?v=GLaBjiL4Vg4'
video_id: 'GLaBjiL4Vg4'
date: 2026-06-13
duration_sec: 1598
---

# 7 Simple Arduino Projects for Beginners

> Source: [7 Simple Arduino Projects for Beginners](https://youtube.com/watch?v=GLaBjiL4Vg4)

## Summary

This video demonstrates seven simple Arduino projects, primarily using the Arduino Uno board. The projects range from a water detector and automatic night light to a touch sensor doorbell and a PC gamepad controller, each explained with circuit schematics and code snippets.

### Key Points

- **Introduction to Arduino Projects** [00:00] — The video covers 7 simple projects using Arduino boards, mostly Arduino Uno, which has enough I/O pins for most tasks.
- **Test Sketch: Flashing LED** [01:48] — A test sketch flashes an LED wired to digital pin 7 with a 430 Ohm resistor. The recommended output current for ATMEGA328 is 20 mA, max 40 mA, and total current for all pins must not exceed 200 mA.
- **Project 1: Water Detector** [02:42] — Uses electrical conductivity of water. A sensor with two isolated plates is connected to 5V via a 100k resistor. When water bridges the plates, voltage drops, triggering a buzzer. The alarm can only be disabled by resetting.
- **Project 2: Single LED Automatic Night Light** [06:06] — Uses one LED as both light emitter and sensor. The LED is turned off briefly to read ambient light via ADC, then turned on/off accordingly. A 2-second delay is used to avoid flicker.
- **Project 3: Touch Sensor Doorbell** [10:27] — Uses a metal paper clip as touch sensor with a 1M resistor to ground. Relies on capacitive coupling from mains wiring. A frequency meter filters 50/60 Hz signals. Plays a WAV sample using the PCM library.
- **Project 4: Electronic Ruler with CD-ROM Motor** [15:25] — Uses a CD-ROM spindle motor as displacement sensor. Motor's commutator generates pulses proportional to rotation. Two analog inputs with polarity switching allow bidirectional counting. Accuracy adjustable via calibration factor.
- **Project 5: Infrared Remote Control Decoder** [18:29] — Uses TSOP 1736 IR receiver. Decodes remote keycodes using the IR Remote library. Can control multiple loads (LEDs) based on specific button presses.
- **Project 6: PC Gamepad Controller** [20:49] — Emulates USB keyboard using Arduino Pro Micro (32U4). Has 5 buttons (4 cursor keys + fire). Uses Keyboard library and debouncing. Differentiates press/release events to support simultaneous key presses.

### Conclusion

The video provides a practical guide to building seven diverse Arduino projects, from simple sensors to USB gamepad emulation, suitable for beginners to learn electronics and programming.

## Transcript

In this video we will look at 7 simple projects 
that can be built using Arduino boards.  
Most of them will be based on Arduino Uno: 
I chose it because its most popular and has  
enough input and output pins for most tasks. 
Basically, everything we are going to be  
working on today can be implemented using 
any Arduino board: as you probably know,  
the Arduino IDE automatically compiles your sketch 
based on the board type you have chosen – which,  
I would say, is its huge advantage. As you 
can see, I have the board type set to Uno.
We will also be using this cute project board 
which I have purchased online – the link to order  
it you may find in the description. It fits 
both Uno and Mega and features the so-called  
bread-board, which is a compact rig, that allows 
one to build circuit prototypes without using a  
soldering iron. Bread-board's holes are 
connected vertically – in this fashion,  
also the board contains dedicated holes for ground 
and positive power rails, which, I should note,  
comes quite handy when assembling circuits... The 
project board should be attached to Arduino this  
way: basically it's hard to mess anything up here, 
but you should be carefull not to bend the pins,  
and watch your fingers when you do it. Also note 
that the USB cable should not be unreasonably  
long. I've come across boards that were 
not stable with cables longer than 1.5m –  
not necessarily that happens to you, but just 
in case, keep it in mind, please. The USB  
cable will also be used to power the extension 
shields – that's also important to remember.
To make sure everything's working, let us first 
upload a test sketch that flashes the LED.  
The diode is wired to digital pin 7 and positive 
power rail in series with a 430 Ohms resistor.  
I used the +5v rail here for no particular reason,  
it was easier to wire, but it doesn't really 
matter, since Arduino Uno has push-pull outputs,  
and you can just as well use ground to power your 
load. This, however, will affect output polarity.  
The recommended output current for ATMEGA328 
is 20 mA, max current is 40 mA. Wiring several  
digital pins in parallel and switching them 
simultaneously will provide higher output current.  
You have to remember though, that max total 
current for all pins must not exceed 200 mA.
The first project we are going to 
work on today is the Water detector.  
Such devices rely on the electrical conductivity 
of water to warn the user of flooding.  
We will use a piece of standard PCB to produce 
a sensor consisting of two isolated plates.  
Then, using a resistor in series, we will 
feed 5v to them relative to the ground.  
Initially our sensor will output 5v. As it will be 
immersed in water, a circuit will be established  
between the plates. Current will flow and the 
voltage on sensor's positive plate will decrease.  
This, accordingly, will be reflected by 
the value read by Arduino's A/D converter,  
and our program, once a certain threshold 
value is hit, will sound the buzzer.
Before we proceed to writing the sketch, we 
need to decide on the value of the R1 resistor.  
Let's set up an experiment...  
And the resistance of water turns out 
to be around 5k. For the sensor to be  
triggered reliably, the resistor's value must 
be proportionally large. I suggest we use 100k.  
Basically, the only purpose of this resistor 
is to protect Arduino's A/D input from noise  
when the sensor is dry. If you experience 
false positives, R1's value may be reduced.  
Note, that both pins of the beeper will be 
connected to digital outputs of Arduino,  
and we will not use a ground connection here. This 
will allow us to use push-pull outputs of ATMEGA  
in opposite phase to create a bridge circuit, 
which will make the beeper sound louder...  
Ok, here's what our sketch will look like. 
In the setup() section we program the LED  
and speaker pins for output, and initialize them. 
In the main loop we use the analogRead() command  
to read the value of the A/D converter and sound 
the buzzer if the value is greater than 700. The  
alarm() function plays tones and takes frequency 
and duration as parameters... Let's check it out!  
As the sensor is flooded, 
alarm immediately sounds.  
Because flooding is an emergency, the alarm 
can only be disabled by resetting the device.  
And... the alarm goes off again, because 
the sensor is still immersed in water.
The maximum value Arduino's A/D converter 
can read is 1023. The greater the value,  
the higher the degree of flooding. If necessary, 
you can change the alarm threshold by changing the  
value of this constant... Also, if we position the 
sensor vertically and play with resistor's value,  
we can come up with water level sensor: its 
resistance will reflect the degree of immersion.  
Note however, that electrical conductivity 
of particular liquid will also affect the  
readings, so this method of level 
measuring is not very accurate.
Our next device is the single LED automatic 
night light. Its functionality is very simple.  
In low light conditions the LED lights up, and 
when external lighting is detected, it turns off.  
Here you can see the schematic 
diagram of this device.  
When I said “the single LED”, I literally meant 
there isn't anything here except for the MCU and  
the LED. That's right! We are going to use the 
same component both as a light emitter and as  
a light sensor, because LEDs can also sense light. 
As you have probably guessed, the software part of  
this project will be a bit more complicated than 
the hardware. But it is precisely this why we use  
microcontrollers! The problem is, the LED cannot 
work both as an emitter and sensor simultaneously.  
But! Because LEDs switch really quickly, what we 
can do is turn it off for a small amount of time,  
read the illuminance value, and then, based 
on the result, switch the diode on or off.  
Here's the sketch source code. The LED is wired 
to analog pin 2 using a 430 Ohms resistor.  
But how are we going to power the LED 
with the analog input – you may ask?  
Actually, all analog inputs of 
Arduino can act as digital outputs  
if you use the appropriate pinMode command. 
ATMEGA328 is such a wonderful processsor!
And there's something else. Arduino's A/D 
converter needs some time to perform its readings.  
This becomes even more evident if you keep 
switching the pin from input to output mode.  
So, to make our program more stable, we need to 
add a small delay before the analogRead() command,  
its less than 100 ms, but unfortunately, 
will be noticable to the human eye.  
Also, while debugging the device 
I came across another problem.  
After switching from digital to analog mode, 
A/D converter's threshold is temporarily offset.  
This is probably caused by some transient 
processes going on inside the ATMEGA chip. Anyway,  
we do not have time to wait for the offset to 
be restored, so I introduced a new variable I  
called “shelf” that takes care of this error. 
The main threshold constant, which equals 220,  
was found by trial and error method... If you 
intend to build an LED night light of your own,  
you will probably have to play with this 
value too, as it will differ from LED to LED.
Here's the source code of the program. At the 
beginning of the loop we set the LED pin to  
logic zero and then switch it to analog mode. Then 
we read the ADC value. The readData() functions  
performs 10 consecutive reads at 10 ms intervals. 
This is a standard programmatic way of ruling out  
ADC errors and bounce. When we're done with the 
ADC, we switch the LED pin to digital output mode.  
If the value read is greater than 220, we 
turn the LED off. Otherwise, we turn it on.  
If the LED was turned on, we set the shelf 
value to 180. If it was not, we set it to 0.  
Then there's a 2 seconds delay, 
and then we start over again.
Let's check it out! Ok,  
if said that the flicker is unnoticable, I would 
have probably lied. But in a real device it is  
not necessary to read the illuminance value so 
frequently. Doing this once every 15 or even 30  
minutes will quite suffice. The Sun doesn't set 
so fast, unless it's a total eclipse, of course.  
In that case I don't think anyone 
will pay attention to flicker.  
To adjust this interval you need to 
change the value of this constant.
Our next project is the touch sensor doorbell. 
Here is the schematic diagram. We will use a  
regular metal paper clip as a finger sensor, which 
we are going to wire to analog pin 0 of Arduino.  
We will also need a 1M resistor that we 
will wire between this pin and ground.  
This device relies on the effect of 
flow of capacitive currents from the  
phase wire located somewhere in 
the room through the human body.
When you touch the paper clip, the MCU registers 
signal on ADC input and performs the required  
action -- sounds a bell in our case. It should 
be noted, that any such circuit is prone to  
interference and noise. To protect from them 
usually a filter or a specialized IC is used.  
But we have a microcontroller here, 
so we can do it all programmatically.  
For the device to work properly, we need it 
to be triggered only by a 50 (or 60 depending  
on your country) Hz sine. Any other signals, 
especially high frequency must be filtered out.  
To implement this, I wrote a simple frequency 
meter here. In programming measuring frequency is  
usually done by counting the number of transitions 
through zero during a set time interval.  
In our case it will be 25 ms – I picked it based 
on the desired response time. If the number of  
pulses counted lies in the range of 70 to 150 – 
I found these values empirically – then we have  
good signal... For now let us output the result 
returned by our frequency detector onto the LED.  
As we can see, the program is quite stable and 
is able to detect finger touches without errors.  
If the touch is too short, it's ignored.
Now let's try to playback some sound. Of 
course, we can use simple square wave tones  
to buzz a primitive melody through the speaker. 
But my intention was to get this thing to sound  
like a real old-school door-bell. I was able to 
find online a WAV file with the required sound  
sample without trouble, here's what it sounds 
like... The problem is, Arduino does not have  
a built-in D/A converter and it appears there's 
no way we could play back sampled sounds with it.  
But! I found a quite remarkable library. It's 
called damellis-PCM. According to the description,  
it can play back 8-bit PCM format samples 
using the built-in ATMEGA's 328 timer.  
You need to download the library – the link is 
in the descripiton – then unpack it and put the  
files into the “libraries” folder of Arduino 
using the name PCM. You also need to open the  
PCM.c file and change the sample rate from 8000 to 
11025 Hz – that's the format our WAV's gonna use.  
The sample file I got off the net has format 
44 Khz 16 bit stereo. We must convert it to  
11025 Hz 8 bit mono – note it's the only 
format this library can actually play back.  
Conversion is necessary because Arduino's memory 
is too small to store large chunks of data.  
Naturally, lowering the bit-resolution and 
sample-rate will cause loss of quality, but in our  
case its not important. Now that we're done with 
the conversion, let us delete the meta-headers  
from the WAV file and extract the raw 8-bit audio. 
Now we need to put this data into a byte array.  
Unfortunately, the Arduino IDE can not 
load a binary file into a variable.  
So, we need to convert our binary dump into 
a standard C-style array definition operator.  
To do it, we are going to use 
a program called Hex Workshop.  
Here's what our bell sample looks like now.  
Let's save it into a separate file 
and include in our main program.  
To play back the sample all we need to do 
is invoke the StartPlayBack() procedure.  
Its only two parameters are name 
of the array and array's size.  
Please note, that you must wire the speaker 
to digital output 11 of Arduino and this pin  
assignment may not be changed. This is due 
to the fact that internal timer's output is  
hard wired to this pin inside the MCU. 
Now let's hear it... Sounds good to me!
Our next project is the electronic ruler 
that uses a salvaged CD-ROM spindle motor  
as displacement sensor. It's not secret to anyone 
that any commutator DC motor is also a generator.  
However, the type of current such motor 
will produce is not exactly direct,  
because the windings are constantly switched 
by the commutator, thanks to which the circuit  
is periodically broken at a frequency 
proportional to shaft rotation speed.  
This is the feature that our device will rely on. 
You can see the schematic diagram on the screen.
We will also use a two-digit 7-segment 
display operating in dynamic mode. Just  
like in our previous sketches, data will be read 
with the analog input, but with a little nuance.  
It would be nice to implement counting in both 
directions – up and down – the way it happens  
in a digital caliper, for example. We know, 
that change of rotation direction will cause  
change of EMF polarity on motor's output. 
How can we read this with the help of ADC?  
We can use a resistor divider and shift 
ground level to half the power supply voltage.  
In this case motor's positive EMF will increase 
the voltage, while negative one will decrease it.  
But we would like our circuit to stay as 
simple as possible. So what are we gonna do?  
We will wire the motor between two analog 
inputs – and no resistors! As we already know,  
ADC ins of Arduino can turn into digital outs. 
So what we're going to do is switch one analog  
in to digital mode and set it to logic zero 
while we read the ADC value of the other one.  
Then we just switch them. This will 
effectively flip the input polarity of  
the ADC. I should also note that solutions like 
this are often used in embedded programming. MCU  
pins are switched into different modes and sensors 
are read one by one. Naturally, for this to work,  
switching must happen much faster than 
change of data you are trying to analyze.
The main loop of the sketch is before us. The 
“minus” button is used to reset the counter.  
We switch the A1 input into digital mode and 
set it to zero. Then we read data from input A0.  
If the value is greater than 0, we increment the 
distance counter. In the next section inputs A0  
and A1 are switched: A0 is now zeroed and A1 is 
read data from. Based on the result, the distance  
counter is decremented. While experimenting I 
found that faster motor rotation yields greater  
signal amplitude, which also affects the readings. 
To rule out this error I introduced a calibration  
factor, found empirically. The accuracy of the 
measurement can be adjusted using this constant.
Let's check it out...  
Good! If you have an old CD-ROM sitting somewhere 
on the shelf, I think this project is for you!
The next circuit we are going to look at 
today is the infrared remote control decoder.  
Using this device, you can switch 
on and off any type of load.  
The circuit relies on the TSOP 1736 IR receiver.  
This element is not your regular photo-diode 
or photo-resistor. It's an IC that outputs  
quality square wave signal, with noise and bounce 
eliminated, which can be directly fed to the CPU.
In our case the IR-receiver is wired to line A2 
– we don't really need the ADC converter in this  
sketch, but we can still use all analog pins as 
digital inputs, if necessary. For the receiver IC  
to work, it also needs to be powered. LEDs are 
connected to digital pins 2, 5, 7, 10 and 13.  
Hypothetically, if you want to control a 
single load, like turn the lights on and off,  
you can get away with a simple D-type flip flop 
instead of a CPU. However, such circuit will  
be very unstable, because it will react 
to any infrared remote used in the room.  
Like when you wanna switch channels on your 
TV, anytime you press buttons on the remote,  
your device will also be triggered. It may even 
react to regular lights, because any electric  
bulb emits light in the infrared spectrum. 
So, to make our device react to certain  
button-presses on a certain remote control, 
we need to write the signal decoder program.  
Fortunately, Arduino already carries a 
dedicated library that takes care of that.  
To compile this sketch you need to add the library 
called “IR Remote” in your IDE. To use the library  
all you have to do is initialize it in your 
setup() procedure, and then in your loop()  
procedure compare decoded keycodes to a list of 
predefined code values. I have already run this  
sketch in debug mode, read the keycodes of this 
cute tiny remote and put them into the program.  
As we can see, now pressing buttons on the 
remote turns on and off the corresponding LEDs.
The last device we are going to build today is 
the PC Gamepad controller. This project relies  
on Arduino's ability to emulate USB slave devices. 
If properly programmed, it can act as a joystick,  
mouse, touchscreen, webcam, microphone, etc. To 
use this function, all you have to do is attach  
your Arduino to your PC using the regular USB 
connection. Please note, that only 32U4 based  
Arduino boards can emulate USB port. I will be 
using Arduino Pro Micro here. Our keyboard will  
contain 4 cursor keys and a fire button. This 
matches controller setup of most retro-games.  
If you wish, you can add more buttons to the 
controller by adding their support in the sketch.
Here is the schematic of the device. 
Buttons are wired to the ground,  
so we will use the INPUT_PULLUP 
mode to read their state.  
To emulate USB keyboard we will use a 
built-in Arduino library called “Keyboard”.  
For the sketch to compile successfully you must 
activate it using the IDE menu... like this.  
To use the library all you have to do 
is initialize it in the setup section.  
Then, as a keypress is detected on the gamepad,  
call the corresponding library routine to 
send the key code to the USB interface.
At first glance, the algorithm is plain simple. 
Read the buttons, send codes to the USB port.  
In reality, it's a bit more complicated. 
When you control a player character,  
you often have to hold a button down or 
press several buttons simultaneously.  
For example, for them to be running, you 
have to press and hold the arrow key.  
For them to jump to the left, you must press 
the “up” and “left” keys simultaneously.  
To implement this correctly, the process of 
pressing a button must be split in two events:  
button press and button release. The events 
must be sent to the USB interface separately.  
Fortunately, the Keyboard library supports this.
Now, how do we differentiate between a button 
press and a button release on our gamepad? There's  
an old programmer's trick that accomplishes it. 
We will define two sets of variables – according  
to the number of keys. There are 5 keys on our 
gamepad, so we are going to need 10 variables.  
At the beginning of the loop we read all button 
states and save them into this set of variables.  
At the end of the loop we copy these 
states to the second set of variables.  
So, at the beginning of a new loop iteration all 
R variables will contain the current button state,  
while the M varialbles will have the pre-stored 
buttoon state from the previous loop iteration.  
Now all we have to do is compare these two arrays. 
If the previous state of a button was RELEASED and  
current state is PRESSED -- note that PRESSED 
is 0 -- it means we have the keypress event. So  
we send it to the USB interface. If the previous 
state was PRESSED and current state is RELEASED,  
it means the user released the button. Send that 
to USB too. If the current and previous states are  
the same, it means no event had happened, and 
we don't need to send anything to the USB bus.
While debugging the program I also added 
a small function called multiRead().  
It performs 50 consecutive reads of 
the button and counts ones and zeros.  
Based on that it decides whether the button 
is pressed or released. This is necessary  
to eliminate switching bounce and is called 
debouncing in programming. On any event the  
LED will flash, and then a delay of 100 ms will 
be executed – also to prevent bounce. Here we  
have keycodes to be sent to USB interface. Space 
button will act as Fire key, its hex code is 20.
Shall we check it out? Looks 
like everything's working!..
And... that would be it for today! If you like 
this video please show your support by subscribing  
to this channel and sharing it on social media. 
Also don't forget to give me a thumbs up and write  
a comment. And if you'd like to drop me some 
Bitcoin or Ether, please use wallet numbers,  
that you can find in the description 
section. This was Ron Mattino! See you soon!
