now i ported the same code to an ATTiny85 Micro controller with PIN 0 being the output for PWM. All the remaining circuit remains same with the IRZF44N Mosfet and the wiring.
problem now is the blinking is not as per the code which was written and working fine with the Arduino. the blinking is single but when the IRZF44N is removed from the circuit the blinking resumes to the original double flashes but with much less brightness.
i suppose the IRZF44N is helping in improving the brightness of the LED but why would the circuit give single flashes with an ATTiny85?
We can't answer your question. We would need much more and better information from you.
Please add your code, a schematic of your circuit and links to the specs of the components you are using, including the led, the PSU, and so on. IMPORTANT: please read the forum guide in the sticky post so that you know how to post code and images correctly on this forum.
But thanks for posting clickable links. The WordPress page was written by someone who is not expert in electronics, they made a bad choice of transistor. The YouTube link does not work.
saintofinternet:
all the components are there on the Schematic.... are they? ( MOSFET IRZF44N, ATTiny85, 1W LED, 5V Supply)
Need detailed specs, not just a generic symbol. You never said it was a 1W led, for example. What current does it require? What is the current capability of the 5V supply?
saintofinternet:
also i tried putting a resistor before the LED but that is reducing the brightness.
A 1W led needs a constant-current driver to limit the current to the safe level when the led gets warm and its forward voltage changes. A simple resistor will not protect it.
saintofinternet:
i am somehow loosing the LED brightness significantly with the ATTiny85.
on Arduino UNO the brightness is phenomenal.
Try removing the 1W led and transistor and use an ordinary 5mm led and 200~300R series resistor connected directly to the tiny's pin. Does it flash in the correct/expected way?
I forgot to say before, you should have a 0.1uF bypass cap close to the 5V pin on the tiny, connecting it to ground. This is not needed with the Uno because the Uno board has these built-in, but with any stand-alone chips, you should always have a bypass cap. I have certainly seen tiny85 behave very strangely without a bypass cap.
The IRZF44N is not a good choice. It will have a high gate threshold, so the Arduino may not switch it fully on, resulting in loss of brightness and a hot mosfet. A "logic-level" mosfet is more appropriate. However, as I said, you need a constant current driver circuit for your high power led.