Propeller Clock with ATmega328P This propeller clock is powered from 4x AAA Eneloop 1.2 V battery. An ATmega328P microcontroller is controlling the LEDs. 2 buttons are used to set the time, another button for resetting the cpu and a switch for power on. A magnet and a hall effect sensor (SS411P) is used to tell the microcontroller when it is at the starting position. Working principle The fan is spinning at 15 Hz, so 15 full revolutions every second. One revolution is 65 ms time. A timer interrupt is generated every 200 us. (65 ms / 200 us = 325) so in one revolution the timer interrupt is called 325 times. Another timer interrupt is used to count the seconds to track the time accurately. Meanwhile if no interrupt occurs the processor is calculating the LED patterns for the display in the main routine. If the hall effect sensor passes by the magnet a pin change interrupt is generated on PINB3. This interrupt resets the display to the home position. So the microcontroller knows tha...
Posts
Showing posts from March, 2022