I have ATMEGA328 (running on 5V) connected to a C4793 NPN transistor which controls the TEC1-12706 thermal component.
I'm using the code below to turn the transistor on and off:
#define F_CPU 8000000UL
#include <avr/io.h>
#include <util/delay.h>
void delayms( uint16_t millis )
{
while ( millis )
{
_delay_ms( 1 );
millis--;
}
}
int main( void )
{
DDRD = 0b00000001;
while ( 1 )
{
PORTD = 0b00000001;
delayms( 10000 );
PORTD = 0b00000000;
delayms( 10000 );
}
return 0;
}
simulate this circuit – Schematic created using CircuitLab
Everything is working great, except that the thermal module only gets 0.6A of current, even though the datasheet of the C4793 transistor states that it can handle 1A of current.
If I connect the base of the transistor directly to the VCC, I get 1.07A to the thermal module, which is exactly what I need.
I can't understand why I only get 0.6A when doing the same thing from the ATMEGA328. I thought maybe it's because ATMEGA328 puts out only 20mA from the PIN, but isn't the transistor triggered by the voltage instead of current? Any suggestions please? Thanks!