Relay controlled by microcontroller
This is my first project with microcontroller.
Relay is connected on pin PORTB4 (PB4)
and controlled by switch on pin PORTD0 (PD0)
Source code.include "8515def.inc"
Formule for LED ResistorU = 5V
U forward led = 2V
I led = 12.5mA
R = U/I =>
R = (U - U forward led) / I led => R = (5-2) / 0.0125 => 240 ohm
R4 LED = 240 Ohm