Checking and fixing an Arduino Uno code in C with the Schematic for it -- 2
Budget: $10 – $25 USD
In this version 1, you will design a basic clock having the following functions:
The clock can count real time, and display hours and minutes in 24-hour format (seconds will
not be shown).
The time will be displayed on a 4-digit 7-segment LEDs via GPIOs of the AVR Controller.
The clock has an alarm that goes off after some pre-set time. This pre-set time can be fixed in
the embedded code (for example 2 minutes). The alarm goes off ONCE and wont repeat.
The clock can be controlled and configured using external buttons.
To use the clock in this version, the process is as follows:
a) Before it runs, we have to set the initial time (this is the Set mode). We can either press a button
to get to this mode or we can set this as our default mode right after reset or power-up. To set
the time, we need:
a. Buttons to choose different digits of the 7-segment for minute and hour settings.
b. Other buttons to increase and decrease the value of digits.
b) To start count time, we need to press another button to change to Time mode. In this mode, the
clock simply counts and display time starting from the Initial time on 7-segment.
c) During the Time mode, as time elapses after the pre-set time, an LED/buzzer will blink/sound for
5 seconds to indicate this (you can choose the appropriate frequency for users to observe).
Other requirements of this version 1:
The entire system is constructed properly on breadboard.
Buttons should be debounced properly.
You can use delay C functions (such as delay_ms) for other purposes however you must use
Timer to keep the time for the clock.
Timer for this clock should be precise – You should measure the time of this clock using Virtual
Bench and maybe compare with another clock after some hours (or after a day) and see how
they are compared.
Pay attention to the pin assignment – since we got many peripherals now and your MCU has
limited number of pins, you might need to plan your pin allocations wisely and come up with
control strategy (for example for 7-segment).
There is an additional LED to tell what mode the clock is in.
The clock can count real time, and display hours and minutes in 24-hour format (seconds will
not be shown).
The time will be displayed on a 4-digit 7-segment LEDs via GPIOs of the AVR Controller.
The clock has an alarm that goes off after some pre-set time. This pre-set time can be fixed in
the embedded code (for example 2 minutes). The alarm goes off ONCE and wont repeat.
The clock can be controlled and configured using external buttons.
To use the clock in this version, the process is as follows:
a) Before it runs, we have to set the initial time (this is the Set mode). We can either press a button
to get to this mode or we can set this as our default mode right after reset or power-up. To set
the time, we need:
a. Buttons to choose different digits of the 7-segment for minute and hour settings.
b. Other buttons to increase and decrease the value of digits.
b) To start count time, we need to press another button to change to Time mode. In this mode, the
clock simply counts and display time starting from the Initial time on 7-segment.
c) During the Time mode, as time elapses after the pre-set time, an LED/buzzer will blink/sound for
5 seconds to indicate this (you can choose the appropriate frequency for users to observe).
Other requirements of this version 1:
The entire system is constructed properly on breadboard.
Buttons should be debounced properly.
You can use delay C functions (such as delay_ms) for other purposes however you must use
Timer to keep the time for the clock.
Timer for this clock should be precise – You should measure the time of this clock using Virtual
Bench and maybe compare with another clock after some hours (or after a day) and see how
they are compared.
Pay attention to the pin assignment – since we got many peripherals now and your MCU has
limited number of pins, you might need to plan your pin allocations wisely and come up with
control strategy (for example for 7-segment).
There is an additional LED to tell what mode the clock is in.