Pages

Monday 30 June 2014

How to Create Effective Tiled Watermark over Images using GIMP ?

             Watermarking images is important to protect images from unauthorized users. Watermarking can be done in different ways. If your watermarking is in corners of image, unauthorized users will eliminate the watermark by cropping your image and then they will use the image as their own. So it's better to put a tiled watermark as shown in the following image.

Tiled watermark can be given using G'MIC plugin in GIMP. So G'MIC plugin must be installed initially. Use synaptic package manager to install G'MIC.

After installing the G'MIC plugin, open your image using GIMP image editor. Now open G'MIC from
Filters => G'MIC

A new window will appear. Select Visible watermark under Degradations. Now options of Visible watermark will appear at the right side of the window. There you can change the watermark text, opacity, font size, angle, smoothness and lightness. Preview of watermark is available at the left side of the window. If you are satisfied in preview, press OK button at right side bottom.

Watermarked image will be displayed in the GIMP window.

Now export your image giving a suitable filename ( File => Export ). Click here to see all GIMP tutorials.

Saturday 28 June 2014

Simple Tips for Efficient use of 78xx Linear Voltage Regulators

78xx is a series of linear voltage regulator integrated circuits. These integrated circuits are commonly used in circuits that require a regulated power supply. It is very cheap and is easy to use. These two factors make them special in voltage regulators. 78xx series have a complementary negative voltage regulator series and is designated by 79xx. In these series of ICs, xx indicates the output voltage from the regulator ( Eg: 7805 have an output voltage of 5V, 7812 have an output voltage of 12V ). Combination of 78xx and 79xx series is used to create positive and negative voltage in the same circuit.

Features of 78xx regulators.

1. Three terminal regulators.
2. Internal Short-Circuit Current Limiting.
3. Output Current up to 1.5 A.
4. Output Transistor Safe-Area Compensation.
5. Internal Thermal-Overload Protection
6. High Power-Dissipation Capability

Pin out diagram of 78xx Series Integrated Circuits.

Following table shows the part number, output voltage and input voltage range of 78xx series voltage regulators.

Circuit diagram to build a fixed-output regulator using 78xx is given below.
Capacitors should be included in the input and output side of the voltage regulator circuit. Because all characteristics are measured with a 0.33 µF capacitor across the input and a 0.1 µF capacitor across the output.


Advantages of 78xx Series

1. Don't require any external device to supply constant, regulated power. It is very cheap and is very easy to use.
2. They have protection against drawing too much power, overheating and short circuits. Current limiting features of 78xx not only protect the regulator, but also protect the other parts of circuit in some situations.

Disadvantages of 78xx Series

1. Input voltage must always greater than the output voltage.That is, for 5V output from 7805, input voltage must be greater than 7.5V. So these devices cannot be powered from certain power sources. That is 7805 cannot be powered from a 6V battery.

2. Input current required and the output current of 78xx series is same. But the output voltage is always less than the input voltage which means some amount of power is dissipated as heat inside the regulator. So proper heat sinking mechanism must be implemented. This loss of power also decreases the efficiency of regulator. This inefficiency become more significant if the input voltage is very higher than the output voltage.( Eg: Powering 7805 using 24V supply )

Friday 27 June 2014

What is Pull Down resistor ? How does Pull Down Resistor Works ?

        Working of pull-down resistor is almost similar to that of pull up resistor. Pull down resistor is always connected to ground as shown in the following image. It helps to keep logic level near zero, when no other active devices are connected.

         In the following image, switch is kept open and hence active devices are disconnected from the system. So the logic gate input get connected to ground through a 10 K pull down resistor and the input of the logic gate will remain at LOW level.


If the switch is closed, voltage Vin get dropped across the 10 K pull down resistor. So voltage across the gate input will be the voltage drop across the pull down resistor ( Vin ). This voltage will keep the gate input at HIGH level.

Wednesday 25 June 2014

What is Pull Up Resistor ? How Does Pull Up Resistor Works ?

Pull up resistors are resistors used in electronic logic circuits to maintain the inputs to logic gates at expected logic levels, if external devices are disconnected or high impedance is introduced. They may also be used at the interface between two different types of logic devices, possibly operating at different power supply voltages. Pull up resistor is connected as shown in the following image.

Pull Up resistor operation

When the switch is open, current will flow from the source to the logic gate shown by a red arrow and the voltage at the gate input is pulled up to the level of  Vin. That is, if  external devices are disconnected or high impedance is introduced, pull up resistor will pull the logic gate input voltage to HIGH level.

Similarly, if the switch is closed, current will flow from source to ground through the pull up resistor and the logic gate input voltage will be pulled to ground or LOW level
Applications of pull up resistors.

1. Used in electronic logic circuits to maintain the inputs to logic gates at expected logic levels, if external devices are disconnected or high-impedance is introduced.

2. In open collector circuits, by changing the value of pull up resistance, it can be used either for General Purpose Input/Output (GPIO) or can be used for Inter-Integrated Circuit (I2C). Value of pull up resistance will be 10K, if it is used for General Purpose Input/Output (GPIO) and the value of pull up resistance will be 2K, if it is used for Inter-Integrated Circuit (I2C).

Disadvantages of pull up resistors.

1. Extra power consumed, when current is drawn through the pull up resistor.
2. Speed of pull up resistor is less compared to active current source.

Monday 23 June 2014

Circuit Diagram to Supply Steady 5V DC Power Supply to Microcontroller

Constant power supply is an important factor for the proper working of Microcontrollers. Voltage is commonly regulated using 7805 Voltage regulator.


Features of 7805 regulator.

1. Three terminal regulators.
2. Internal Short-Circuit Current Limiting.
3. Output Current up to 1.5 A.
4. Output Transistor Safe-Area Compensation.
5. Internal Thermal-Overload Protection
6. High Power-Dissipation Capability

Positive line of the regulator output is given to the VCC ( Pin 7 ) of the microcontroller and negative line of the regulator output is given to the GND pin ( Pin 8 ) of microcontroller. Pinout diagram of ATMega328 is given below.

Don't forget to put a .33micro Farad capacitor at input side and a .1 micro Farad capacitor at the output side of the regulator.

If your circuit is correct, then your microcontroller will working on a constant 5 voltage. Circuit will work even if the capacitors are not connected. But its better to add capacitors for the longer life of your voltage regulator and microcontroller.

Sunday 22 June 2014

Circuit to Connect External Crystal Oscillator to ATMega328

Oscillator is an important component for all devices, which works based on clock frequency. In general oscillators are used to generate clock signals. Apart from these, if you want to use ATMega328 microcontroller that programmed using Arduino Board, on a circuit without using Arduino board, an external crystal oscillator of 16MHz should be connected. Clock signals generally changes between two states. Transition between these two states is very short and is called Edge.


Purpose of Clock in Microcontroller.
1. Helps all parts of microcontroller to work together.
2. By increasing the Clock speed, we can increase the speed of micrcontroller.
3. Parts of microcontroller is made of components that changes their state at Edges of the Clock Pulses.     By knowing the frequency of oscillator and the number of clock pulses that each operation needed to     accompolish, we can easily predict, "Which operation will take place at a particular clock cycle".
ATMega ICs have a built in 1 MHz oscillator. By increasing the Oscillator speed, we can increase the speed of the microcontroller operations. External oscillator is normally connected to the XTAL pins ( Pin 9 and Pin 10 ) of ATmega Microcontrollers. 


External crystal oscillator is connected to the microcontroller as shown in the following circuit diagram. Oscillator connected here is a 16MHz oscillator. If the capacitors are not connected as shown in figure, Crystal oscillator will not oscillate properly.
If all goes well, then your microcontroller will work on 16MHz. 

Friday 20 June 2014

What does HC and LS in 74HCxxx and 74LSxxx Indicates ?

For a long period, after I had started my electronics carreer, I was not aware about the importance of HC and LS in IC names ( Eg : 74HC595  and 74LS595 ). But nowadays I felt some problems in my circuit. I purchased these ICs without specifying the category HC or LS. I think this may be the problem.

Then I searched for the difference between 74HC chips and 74LS chips. Then I found that 74LS chips are made of bipolar transistors ( TTL) and there is a pull up resistor at the input. But 74HC chips are made of CMOS transistors and there is no resistance at the input. In an electronic circuit, all the components must be either LS or HC. Combination of HC and LS in the same circuit will result in Voltage level difference and the circuit will not work properly.


You might also like.

Why CMOS Devices should be used in Locations where Power Dissipation should be Kept Minimum ?.
Difference Between CMOS and TTL Signals.

Thursday 19 June 2014

How Electrostatic Discharge ( ESD ) Damages ICs?

Electrostatic Discharge is an important fact that should be considered while packaging and assembling ICs. For the longer life of ICs, electrostatic discharge must be considered at the construction stage itself. Main cause of Electrostatic discharge is Static Electricity.


What is Static Electricity ?.

Static electricity is the electricity at rest. Static electricity is generated due to friction and seperation. Friction generates heat, that excites the molecular particles in the materials. When these materials are seperated, a transfer of electrons from one material to another will takes place, generating static electric fields. Amount of static electric field depends on the nature of materials, friction and seperation between materials and the relative humidity of the environment.

Many of the human activities in our daily life will generate static electricity on our body.

Some of the activities include:

a) Walking across a carpet will generate 1,500 to 35,000 volts
b) Walking over untreated vinyl floor will generate 250 to 12,000 volts
c) Worker at a bench will generate 700 to 6,000 volts
d) Vinyl envelope used for work instructions will generate 600 to 7,000 volts
e) Picking up a common plastic bag from a bench will generate 1,200 to 20,000 volts

What is Electrostatic Discharge ?.

Electrostatic discharge (ESD) is the sudden flow of electricity between two electrically charged objects caused by contact, an electrical short, or dielectric breakdown. A buildup of static electricity can be caused by tribocharging or by electrostatic induction.

How Electrostatic Discharge affects the ICs ?.

If a person having static electricity on his body touches the IC Chip, then electrostatic discharge will takes place. Electrostatic Discharge is an important problem since the beginning of production of ICs. Chips works on small voltages whereas Electro-Static Discharge will be thousands of volts. Chips should be capable for absorbing these high voltages and handling them harmlessly without damaging the chip.

If ESD is incorrectly handled, discharge will reach the gates and will damage the thin oxide underneath the gate. This may make entire IC inoperable. Electro Static Discharge can also occur during packaging, assembling and testing of the ICs.  Internal charge build-up from in-package capacitors and on-chip memories will also results in Electrostatic Discharge.

How to protect ICs from Electrostatic Discharge ?.

ICs can be protected from ESD by placing Clamp circuits in appropriate locations. Clamp circuit provides a low impedance discharge path for the ESD and clamp the signal voltage at a level that avoids dielectric breakdown.

Tuesday 17 June 2014

Why CMOS Devices should be used to Reduce Power Dissipation?

Switching time of CMOS devices are lower, so that CMOS devices will remain in the active region for lesser time. So the power dissipation will be minimum because power disspipation is maximum when the device is operating in the active region.

In bipolar devices, even if the device is not doing anything, there will be a small base current. Collector current depends on base current and there will be a small collector current, even if the device is not doing anything. This will result in more power dissipation. But in CMOS devices, GATE is insulated and hence there is no flow of current when the device is not doing anything. ie power dissipation will be minimum. 

What is an Open Collector or Open Drain in a Transistor ?

An open collector or open drain output is an output from a transistor with no connection on collector as shown in the following image. 

This circuit will work. only if an external pull up resistor is added. One end of the resistor is connected to the collector and the other end is connected to the positive voltage.
When the transistor is on( Control Signal is HIGH ), it puts ground on the output (Vout = 0 ). When the transistor is off ( Control Signal is LOW ), since one end of pull up resistor is connected to the positive voltage, output will be 1 ( Vout = 1 ). Main advantage of the open collector circuit is, by varying the value of resistance, we can change the output current. Also it is compatible with I2C communication protocol. Usually the pull up resistance will be 10K, if it is used for General Purpose Input/Output (GPIO) and the pull up resistance will be 2K, if it is used for Inter-Integrated Circuit (I2C).

Monday 16 June 2014

How to Redirect blogspot Address (Eg : blogspot.in) to blogspot.com?

                When I created my blog http://myfunnyelectronics.blogspot.com/, I found that, my site is automatically redirecting to http://myfunnyelectronics.blogspot.in/, since I had created my blog from India. When I searched for a solution to redirect my blog to http://myfunnyelectronics.blogspot.com/, I found that a simple JavaScript code is enough to redirect my site from http://myfunnyelectronics.blogspot.in/ to http://myfunnyelectronics.blogspot.com/. Following method illustrates the same solution.

Go to Blogger Dashboard. Click on Template.



Now click on Edit HTML button.

Search for </head> tag ( CTRL + F ). Now paste the following JavaScript code just above the </head> tag as shown in the following image.

<script type="text/javascript">
var blog = document.location.hostname;
var slug = document.location.pathname;
var ctld = blog.substr(blog.lastIndexOf("."));
if (ctld != ".com")
{
var ncr = "http://" + blog.substr(0, blog.indexOf("."));
ncr += ".blogspot.com/ncr" + slug;
window.location.replace(ncr);
}
</script>


Save your template. Now your blogspot web address will be redirected to blogspot.com.

Thursday 12 June 2014

Program to Copy a Multi Dimensional JavaScript Array to Another Similar Array

In certain situations, we have to copy contents from an array to an empty array. Empty array, as it's name indicates, will have no size limit and should be extendable. Declaration of empty arrays and copying contents from one array to empty array is simple. But it has some confusing syntaxes. Following program is a simple demonstration of these confusing tasks. To run this code, copy the program given below to an HTML file. Then open this HTML file in a web browser.



<script type="text/Javascript">

var empty_multi_dim_array=[[]];             // Declare empty array
var multi_dim_array_with_contents = [

['mango'   ,'orange' ,'banana'  ],
['ford'    ,'audi'   ,'benz'    ],
['control' ,'alt'    ,'delete'  ]

];                                                              // Declare array having contents

/** PRINT CONTENTS OF multi_dim_array_with_contents ARRAY **/

for(var i=0;i<multi_dim_array_with_contents.length;i++)
{
for(var j=0;j<multi_dim_array_with_contents[i].length;j++)
{
document.write(multi_dim_array_with_contents[i][j]);
document.write("  ,  ");
}
document.write("<br></br>");
}

/** COPY CONTENTS OF multi_dim_array_with_contents ARRAY TO empty_multi_dim_array ARRAY **/

for(i=0;i<multi_dim_array_with_contents.length;i++)
{
empty_multi_dim_array[i] = multi_dim_array_with_contents[i];
}

/** PRINT CONTENTS OF empty_multi_dim_array ARRAY **/

document.write("<br></br>");

for(i=0;i<empty_multi_dim_array.length;i++)
{
for(j=0;j<empty_multi_dim_array[i].length;j++)
{
document.write(empty_multi_dim_array[i][j]);
document.write("  ,  ");
}
document.write("<br></br>");
}

</script>

Output of the above program is given below. First one is the original array and the second one is the copied array.

Get the Number of Rows and Columns of Single and Multidimensional JavaScript Arrays

To get the number of elements in a single dimensional array.

var single_dim_array_with_contents = [  'control' ,'alt'    ,'delete'  ];  

To get the number of elements in this array  :  single_dim_array_with_contents.length ;
This function will return 3 from this array.

To get the number of rows and columns in a two dimensional array.

var multi_dim_array_with_contents = [

 [  'mango'   , 'orange'  , 'banana'  ],
 [  'ford'    ,   'audi'   ,  'benz'    ],
 [  'control' ,  'alt'    ,  'delete'  ]

  ]; 

To get the number of rows  :  multi_dim_array_with_contents.length;
This function will return number 3 which is the number of rows.

To get the number of columns in each rows  :   multi_dim_array_with_contents[i].length ;
' i ' stands for the row number.

How To Declare an Empty Multi - dimensional JavaScript Array ?

JavaScript arrays is an interesting topic. Arrays can be declared in different ways. If we don't know the number of elements that will be entered to the array, then the size of the array cannot be declared during the declaration of the array. In such situations, array can be declared as given below.

var empty_multi_dim_array = [[]];

In such declaration, size of the array will not be declared initially. Instead an empty square bracket inside another square bracket will be declared as shown above. 

CLICK HERE TO SEE JAVASCRIPT 2D ARRAY OPERATION