HPK taruh disini
Hi guys...
Today I’ll show you my microcontroller project using Proteus
8 and Arduino Uno. This project is called “MOM WAKES YOU UP”.
If you have a problem to wake up in the morning actually
that’s my problem and your mom is out
of town or somethin’, so she won't able to wake you up. You’ll need this stuff to help you out.
Let’s get
started...
The components to
build this project are :
1. a LDR
2. a resistor 3.3K
and a resistor 330 ohm
3. a LED, any
color
4. Speaker or
Buzzer (to imitate your mom’s shout ).
5. Motor PWM servo (using to roll out your
curtain) like your mom usually does!!
6. a LCD (16X2)
7. an Arduino Uno
7. an Arduino Uno
LDR
LDR |
BUZZER
A buzzer or beeper is an audio signaling device,
which may be mechanical, electromechanical, or piezoelectric. Typical uses of
buzzers and beepers include alarm devices, timers and confirmation of user
input such as a mouse click or keystroke. (Wikipedia)
Buzzer 5V |
LCD (16X2)
LCD (16X2) |
The LCDs have a parallel interface, meaning that the
microcontroller has to manipulate several interface pins at once to control the
display. The interface consists of the following pins:
- A register select (RS) pin that controls where in the LCD's memory you're writing data to. You can select either the data register, which holds what goes on the screen, or an instruction register, which is where the LCD's controller looks for instructions on what to do next.
- A Read/Write (R/W) pin that selects reading mode or writing mode
- An Enable pin that enables writing to the registers
- 8 data pins (D0 -D7). The states of these pins (high or low) are the bits that you're writing to a register when you write, or the values you're reading when you read.
- There's also a display constrast pin (Vo), power supply pins (+5V and Gnd) and LED Backlight (Bklt+ and BKlt-) pins that you can use to power the LCD, control the display contrast, and turn on and off the LED backlight, respectively.
- The process of controlling the display involves putting the data that form the image of what you want to display into the data registers, then putting instructions in the instruction register. The LiquidCrystal Library simplifies this for you so you don't need to know the low-level instructions.
- The Hitachi-compatible LCDs can be controlled in two modes: 4-bit or 8-bit. The 4-bit mode requires seven I/O pins from the Arduino, while the 8-bit mode requires 11 pins. For displaying text on the screen, you can do most everything in 4-bit mode, so example shows how to control a 2x16 LCD in 4-bit mode.(Arduino.cc)
Ok then HOW DOES
IT WORKS???
First of all, the LDR is kinda sensor that will
detect the intensity of light. If the light is bright enough (you can adjust
the threshold) the microcontroller will trig the LED to blink, the speaker will
be turned on and the Motor will roll out your curtain so the window will be
uncovered and the sunshine will wake you up.
So here’s the
Schematic....
Schematic |
And when you run the simulation, it will look like this...
When the intensity reach out the threshold value |
The LED will blink, the Speaker will turn on, the LCD will says “WAKE UP
Sleepy head!!!” like my mom usually does loudly gently in my ears.
When the intensity still under the threshold value |
But if the intensity still under the threshold, the LED is turned of, the
curtain won’t be rolled up and the speaker will stay quiet and the LCD will say “sleep
tight!!!” (tho you can’t see it coz you’re sleeping).
Ehemmmm so the last thing you need is the code...don’t worry I’ll show you
The Code |
That’s totally easy right… but
you can use your creativity to create more advance alarm to wake you up. So that’s
all, don’t forget to like or share… see you next time… Byeeee…
Here's the video :