This is the week i decided to interface a LED with Atting45 . The LED's currently available in the FAB-LAB inventory .
This led can be interfaced in two different configurations
This is the datasheet of the led which shows the power dissipation and maximum voltage and current consumption . Continous forward current = 30 ma which is more than the sourcing capacity of ATtiny45.
Following is the LED configuration . In the above image , PIN is denoted as the micro-controller pin which the LED will be interfaced with.
Current Sourcing = When a load is connected to a device so that the device supplies current to the load (sources current) then the configuration is said to be current sourcing. In this case the device is the IC and load is the SMD led . In this case intensity of the led is dependent the current supplying capability of the device .
Source configuration of the device is a current limiting register is not needed as the load is connected to ground . Thus the load will only consume the amount of current which is required
Current Sinking = When a load is connected to a device so that current flows from the power supply through the load and into the device, then the configuration is said to be current sinking. When current flows into the device, it is said to be sinking current.
In this configuration the led is connected between a powersupply and the device . In this configuration a current limiting resistor is required as the device or devices in series might draw more power than the maximum of the LED which might blow out the LED
Refference
Pulse Width Modulation, or PWM, is a technique for getting analog results with digital means. The duration of ON time and the OFF time of the pulse . i.e if there is pulse with 2 sec duration . and if the ON time of the pulse is 1 sec ON and 1 sec OFF will be considered a 50% duty cycle . This is the duty cycle which is calculated in the percentage of the ON time and the OFF time .
Schematic of the hello-world schematic . Notice the external oscillator which was added . This was added just to generate the 3 pads to solder another another sensor there namely LM35 Temperature Sensor. But ultimately this board was converted to an output board .
Attiny 45 works on internal oscillator of 8 MHz .This clock frequency used is critical in making sure that the IC follows the real world clock precisely .
In the following schematic i have interfaced the LED with pin "PB4" which is designated by U$4 . The LED is interfaced in the sink configuration . In the above configuration , the necessary voltage required to operate the LED .
Image of the designed board file .In the following photo you can see dimensions making it just a ring of the pcb which was later deleted . Note when using the eagle make sure the dimension lines of the boar .
Image of the soldered board.
The board was programmed and flashed using Arduino IDE Following screenshot is the board programmed for LED .
Following images show the trials in programming and sensor testing .
Programming setup . As seen here i used Arduino as a programmer .
Screenshot indicating the successfull downloading the bootloader and code . This is the blink code which was uploaded
The code included in the varies the PWM cycle
Wrong Resistor solder instead of "4990" i.e 4.99K in soldered "4.99 M " the reason why LED is not lighting up . This is one of the small things which is oftenoverlooked . As soon as I changed this resistor the LED blinksed . The relief after finding this error is unspeakable .
Replacing the resistor fixed the issue . This is the photo when the LED started blinking .
Video of the fading LED
Output Device + FABISP (THe video can also be found in WEEK4-ElectronicsProduction )
THis week I started the survey about the various sensors i would need to implement the final project so far i have narowed dowm a Temperature sensor and a colour sensor . I tested the temperature sensor using arduino seperately . I could seperately measure temperature . Work on the color sensor is yet to be done . I will be doing this in the coming weeks . For next week i need to attach a servo and stepper motor for my final project .
This summarises the progress for this week in Output Devices
All original files can be found here
Electronics Design and Flashing the code on the Atiny45 chip