Hi guys,
I want to control a 5V heater with a PNP power transistor, controlling it with an ATTiny using PWM, load hooked up between collector and ground.
When i connect a small load to it, it works fine. But as the load gets up, there is little current flow through the transistor and i would need to pass more current from the base to the ATTiny pin. But as i do so, the ATTiny jacks up and does strange things like resetting itself or repeating parts of the program that it shouldn't repeat.
Is the problem caused by the ATTiny not handling reverse current (around 30mA) on an OUTPUT digital pin with PWM used?
I suspect you are not properly driving the transistor. Posting an annotated schematic showing how you wired it would help a lot. Post links to technical information on each of the hardware devices including the power supply(s). Be sure the current requirements for the heater are included. You are using a "PNP power transistor", which one there are thousands to pick from.
Looking at the datasheet its Hfe at 3A (max rated current) is only 30, so to get that you would have to source it's base with 100mA. I suspect you get about 1A current from it realistically.
Hi,
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.
Can you also please post some images of your project?
So we can see your component layout.
Oh and to be clear, if i dont use a resistor in place of R1, the ATTiny jacks up and does funny stuff when it opens the transistor. It does same stuff whether i put a 220R or up to a 10K in there.
i changed the IC for a different 85, programmed the same thing onto it (to check if it wouldnt be bricked) and it does the same funny stuff. resets, skips delays, even before it reaches like 3mA. If it manages to overcome that and do atleast one normal program cycle, the base current maxes out at 36.