Posted on Leave a comment

Power Bipolar Transistors are limited by DC operations.

Power transistors are big bulky because they have to deal with a large amount of current in a very short amount of time. They are the fastest of all the transistors.

Heat is the biggest enemy of the transistor. As silicon is heavily dependent on temperature. As the die temperature increases the more sensitive it becomes. And at a certain point, it burns out. At the moment of burning there is a short which generates so much heat that the silicon just burns itself off.

Even the TIP3055 can only handle instantaneous current pulses for a very short amount of time. If that same transistor is put under a continuous load it will burn out in a few instances.

If we look at the derating curve of any power transistor. We will find out that they are only good for up to 1Amps of DC operation. And even at 1 Amp, it will need a sizeable amount of aluminium heatsink.

Posted on Leave a comment

How to set up UART of ATmega328pb in Atmel Studio 7.0

To set up uart in Atmel studio 7.0.

Firstly you will need a common baud rate.

Then you go to section 24.11 of the datasheet. You will find common calculated values for the UBRRn register.

UBRRn register is comprised of high and low registers.

First, you have to initialise the Data direction registers for the RX and Tx Pins. Then you initialise the UART peripheral.

DDRD &= ~(1 << DDD0);				// PD0 - Rx Input
DDRD |= (1 << DDD1);				// PD1 - Tx Ouput
USART_Init();					// UART intialise

Here is the basic UART library code.

/*
* Name: UART library Code
*/
void USART_Init( )
{
	/*Set baud rate */
	
	UBRR0L = 103;
	/* Enable receiver and transmitter */
	UCSR0B = (1 << RXCIE0)|(1<<RXEN0)|(1<<TXEN0);
	/* Set frame format: 8data, 1stop bit */
	UCSR0C = (3<<UCSZ00);
}

void USART_Transmit(uint8_t data )
{
	
	/* Wait for empty transmit buffer */
	while ( !( UCSR0A & (1<< UDRE0 )) )
	;
	/* Put data into buffer, sends the data */
	UDR0 = data;
	
}

unsigned char USART_Receive( void )
{
	/* Wait for data to be received */
	while ( !(UCSR0A & (1<<RXC0)) )
	;
	/* Get and return received data from buffer */
	return UDR0;
}

void USART_SendString(char *str)
{
	unsigned char j=0;
	
	while (str[j]!=0)		/* Send string till null */
	{
		USART_Transmit(str[j]);
		j++;
	}
}
Posted on Leave a comment

How to ATMega328PB to avrdude.conf

I recently bought a few Arduino Uno clones. They were not cheap. They utilise the ch34 IC, which is a USB to UART solution. They all have SMD atmega328pb soldered on them.

The problem is that two of them stopped working with the Arduino ide. On inspection, i found out that my software was not updated so firstly I updated the software which now includes a configuration for the atmega328pb.

But somehow the internal bootloader in these SMD chips got corrupted and it stopped working. I then probed the chip with AVRdude prograamer.

Found that the chip is atmega328pb. The configurations were not included at the time of installation. But the avrdude program allows you added other avr parts from Atmel.

For Windows 10

  1. Go to
C:\WinAVR-20100110\bin

2. Then open

Posted on Leave a comment

LM317 Adjustable Voltage Regulator

This is a very inexpensive voltage regulator IC. Which can be either used as a fixed voltage regulator or variable voltage regulator.

It just needs only two resistors for setting the output voltage.

LM317 is made by different companies. ST, Ti, On Semi, CDIL, HTC Korea etc.

For setting the output voltage

V(output) = [ V(reference) * ( 1 + R2/R1) ] + [ I(adjustment) * R2 ]

Vref = 1.25V

I(adj) = 50 uA

For setting 5 V at the output

R2 = 2.2k + 680 ohm

R1 = 1k ohm

There are many version of this chip

Lm317M for 500mA maximum current

LM317T for 1.5A max current

LM317L for 100mA max current

Posted on Leave a comment

Blown LM358P due to transients

An LM358p is a dual opamp IC which I used in a single supply configuration. I drive the LM358 just shy of its absolute maximum voltage which is +30V. So I gave I supplied 28.8V (+-0.1V). It works flawless but the power supply is a Meanwell switching supply which introduces transient when plugging into the mains supply.

The transient arise when I was plugging in the AC wire to the mains. I used an anchor 6A 3-pin male plug for connection. It was at the brief moment when the transient arise.

The transient which arises apparently has enough power that it blew the epoxy off the silicon and it did with a loud bang.

Blown LM358P due to transients

Doing rough calculation at the moment this happened

Let’s say the transient is double the supply voltage of = 2 x 28.9 V= 57.8V

let’s say the current drawn by the IC is 40mA which is its absolute maximum.

power = voltage x current = 57.8V x 40mA = 2.312W

so for a brief moment, this 2W is radiated by the silicon chip. Which caused the heating up of the epoxy and generating enough expanding force which blew out like that.

but let’s take a more reasonable transient voltage(ISO 7637-2: 2011) of approximately 110V at a rise time of 0.5uS.

so power = 110V x 40mA = 4.4W .

Posted on Leave a comment

FAKE BD139 NPN transistors

I have recently found out that there are FAKE transistors in the market. I have a built a circuit design and when I bought the transistor from the Lajpat rai market in Delhi; I assembled the circuit on a test bench for measurements. But I was surprised that the BD139 did not work with 10mA at 30V and they began overheating. They heat up so much that bubbles appear on the front epoxy and it cracked. I thought that maybe it was damaged so I replaced the whole circuit with a new transistor set. But they also didn’t hold and this time they burnt a resistor along with them. I saw flames engulfing the 1/4 Watt resistors.

So I again made the circuit using the minuscule BC546B. Which neither get warm nor went into thermal runaway.

on the BD139 it was marked that it was manufactured by NXP. And I then checked the NXP website and found out that the NXP closed its manufacturing of this transistor in 2001.

There are a lot of BD139 transistors circulating in the market. It is essential that you must buy from a good source.

Posted on 2 Comments

Custom Aluminum Heatsink for Raspberry Pi

Raspberry Pi is good a single-board Linux based computer system. But it runs OK for the most part and does not heat up if you’re not doing CPU hogging tasks.

I use my raspberry pi for watching videos. Which heats up the CPU to about 60 degrees celsius.

In Delhi, in the summer the ambient temperature is around 30 degrees celsius to about 34 degrees celsius.

In the past, I have placed a small TO-220 package heatsink on it. By placing it sideways.

I used fevicol which is a synthetic craft glue as I don’t have proper heat sink paste. But I found that fevicol glue works good and the heatsink stays quite firmly attached to the CPU.

After Placing the Heatsink the CPU temperature never goes above 50 degrees celsius. Which is a 10-degree improvement.

Posted on Leave a comment

15V Unregulated DC Power Supply using 12Vrms step-down transformer

There are two ways to make DC power supply

  1. Linear
  2. Switching

Linear Power Supply
Continous control of voltage is done at any instance of time. It uses a pass transistor with an error amplifier to regulate the voltage supply.
example: 7805, 7905, LM317 etc

Switching Power Supply
It also uses the pass transistor along with an inductor and a capacitor to store the energy and release the energy. By controlling the switching of the pass transistor, the Voltage is regulated. It is more complex than the linear power supply.
The advantage of switching is that the transformer size gets reduced. Which reduced the cost of the power supply. The Reduced size also reduced the weight; which further increases the portability of the power supply.

[ A C Mains ] -> [StepDown Transformer] -> [Bridge Rectifier] -> [Filter] -> [Unregulated DC]

I am using a step-down transformer. Which transformer 220V 50Hz AC to 12 Vrms AC.

The Vrms is converted to Vdc which is dc equivalent voltage.

So, 12 Vrms = 12 x 1.414 Vdc

= 16.968 (approx.) Vdc

this Vdc is passed through the bridge rectifier which drops 1.5V to 1.8V

= 16.968 – 1.8

= 15.168 V

which is then filtered through the Capacitor filter

C = ( I x t ) / V

I is the amount of current passing through the capacitor at maximum load.

Let I = 1A

t is the ripple time which is taken 10 mS if using 50Hz cycles.

C = [1 x 10 x 10^(-3) ] / 15.168

= 6.59 x 10^(-4) F

= 659 micro Frad

So we will use a standard capacitor that is either equal to or bigger than the above value i.e 1000uF will OK.

Posted on Leave a comment

STM32F429I-DISC1

Datasheet for stm32F429ZI https://www.st.com/en/microcontrollers-microprocessors/stm32f429zi.html

This board have a 2.4 Resistive touch TFT LCD. which uses the ILI9341  controller.

The touch screen which I got with this display is very bad. you have to press down on the screen before you power ON the device.

The microcontroller is based on the ARM CORTEX M4F which can be clocked up to 180MHz. This particular board has an 8Mbyte of SDRAM included which is basically useless with this screen. If you want to see the full potential you have to use the LTDC peripheral which when configured with DMA2D gives you a very powerful development board with multimedia capabilites.

Posted on Leave a comment

STM32F746IGT6 – An ARM CORTEX M7 Based Microcontroller

Datasheet

It’s an ARM Cortex M7 based microcontroller which has a maximum clock speed of 216Mhz.

Well, it has a few peripherals which when combined with its CPU, makes it a very powerful controller.

Those peripherals are LTDC, SDRAM Controller.

It also has the usual set of peripherals from the ST. But these in particular makes it a very powerful microcontroller.