Archive

Archive for the ‘projects’ Category

Simple Analog to Digital Converter

June 20, 2011 Leave a comment

Simple Analog to Digital Converter       
 Normally analogue-to-digital con-verter (ADC) needs interfacing through a microprocessor to convert analogue data into digital format. This requires hardware and necessary software, resulting in increased complexity and hence the total cost.
The circuit of A-to-D converter shown here is configured around ADC 0808, avoiding the use of a microprocessor. The ADC 0808 is an 8-bit A-to-D converter, having data lines D0-D7. It works on the principle of successive approximation. It has a total of eight analogue input channels, out of which any one can be selected using address lines A, B and C. Here, in this case, input channel IN0 is selected by grounding A, B and C address lines.
Usually the control signals EOC (end of conversion), SC (start conversion), ALE (address latch enable) and OE (output enable) are interfaced by means of a microprocessor. However, the circuit shown here is built to operate in its continuous mode without using any microprocessor. Therefore the input control signals ALE and OE, being active-high, are tied to Vcc (+5 volts). The input control signal SC, being active-low, initiates start of conversion at falling edge of the pulse, whereas the output signal EOC becomes high after completion of digitisation. This EOC output is coupled to SC input, where falling edge of EOC output acts as SC input to direct the ADC to start the conversion.
As the conversion starts, EOC signal goes high. At next clock pulse EOC output again goes low, and hence SC is enabled to start the next conversion. Thus, it provides continuous 8-bit digital output corresponding to instantaneous value of analogue input. The maximum level of analogue input voltage should be appropriately scaled down below positive reference (+5V) level.
The ADC 0808 IC requires clock signal of typically 550 kHz, which can be easily derived from an astable multivibrator constructed using 7404 inverter gates. In order to visualise the digital output, the row of eight LEDs (LED1 through LED8) have been used, wherein each LED is connected to respective data lines D0 through D7. Since ADC works in the continuous mode, it displays digital output as soon as analogue input is applied. The decimal equivalent digital output value D for a given analogue input voltage Vin can be calculated from the relationship



Categories: projects

Control electrical appliances using PC

June 20, 2011 Leave a comment

Control electrical appliances using PC  

 Here is a circuit for using the printer port of a PC, for control application using software and some interface hardware. The interface circuit along with the given software can be used with the printer port of any PC for controlling up to eight equipment .
The interface circuit shown in the figure is drawn for only one device, being controlled by D0 bit at pin 2 of the 25-pin parallel port. Identical circuits for the remaining data bits D1 through D7 (available at pins 3 through 9) have to be similarly wired. The use of opto-coupler ensures complete isolation of the PC from the relay driver circuitry.
Lots of ways to control the hardware can be implemented using software. In C/C++  one can use the outportb(portno,value) function where portno is the parallel port address (usually 378hex for LPT1) and ‘value’ is the data that is to be sent to the port. For a value=0 all the outputs (D0-D7) are off. For value=1 D0 is ON, value=2 D1 is ON, value=4, D2 is ON and so on. eg. If value=29(decimal) =   00011101(binary)  ->D0,D2,D3,D4 are ON and the rest are OFF.
   

CLICK HERE


FOR DIRECT EXE FILE CLICK HERE:  portctrl.zip
 





 PROGRAM IN C

/*program to control devices using PC parallel port
The devices are controlled by pressing the keys 1-8
that corresponds to each of the 8 possible devices
*/

#include<dos.h>
#include<stdio.h>
#include<conio.h>
#define PORT 0x378 /* This is the parallel port address */

main()
{
char val=0,key=0;
char str1[]="ON ";
char str2[]="OFF";
char *str;
clrscr();
printf("Press the approriate number key to turn on/off devices:\n\n");
printf("Here Device1 is connected to D0 of parallel port and so on\n\n");
printf("Press \"x\" to quit\n\n");
gotoxy(1,8);
printf("Device1:OFF Device2:OFF Device3:OFF Device4:OFF\n");
printf("Device5:OFF Device6:OFF Device7:OFF Device8:OFF");

while(key!='x' && key!='X')
{
gotoxy(1,12);
printf("Value in hex sent to the port:");
key=getch();
switch(key){

case '1':

gotoxy(9,8);
val=(val&0x01)?(val&(~0x01)):val|0x01;
str=(val&0x01)?str1:str2;
printf("%s",str);
outportb(PORT,val);
gotoxy(1,13);
printf("%x",val);
break;

case '2':

gotoxy(21,8);
val=(val&0x02)?(val&(~0x02)):val|0x02;
str=(val&0x02)?str1:str2;
printf("%s",str);
outportb(PORT,val);
gotoxy(1,13);
printf("%x",val);
break;

case '3':

gotoxy(33,8);
val=(val&0x04)?(val&(~0x04)):val|0x04;
str=(val&0x04)?str1:str2;
printf("%s",str);
outportb(PORT,val);
gotoxy(1,13);
printf("%x",val);
break;

case '4':

gotoxy(45,8);
val=(val&0x08)?(val&(~0x08)):val|0x08;
str=(val&0x08)?str1:str2;
printf("%s",str);
outportb(PORT,val);
gotoxy(1,13);
printf("%x",val);
break;

case '5':

gotoxy(9,9);
val=(val&0x10)?(val&(~0x10)):val|0x10;
str=(val&0x10)?str1:str2;
printf("%s",str);
outportb(PORT,val);
gotoxy(1,13);
printf("%x",val);
break;

case '6':

gotoxy(21,9);
val=(val&0x20)?(val&(~0x20)):val|0x20;
str=(val&0x20)?str1:str2;
printf("%s",str);
outportb(PORT,val);
gotoxy(1,13);
printf("%x",val);
break;

case '7':

gotoxy(33,9);
val=(val&0x40)?(val&(~0x40)):val|0x40;
str=(val&0x40)?str1:str2;
printf("%s",str);
outportb(PORT,val);
gotoxy(1,13);
printf("%x",val);
break;

case '8':
gotoxy(45,9);
val=(val&0x80)?(val&(~0x80)):val|0x80;
str=(val&0x80)?str1:str2;
printf("%s",str);
outportb(PORT,val);
gotoxy(1,13);
printf("%x",(unsigned char)val);
break;

}

}


}






Categories: projects

Basic Electronics

June 19, 2011 Leave a comment

Basic Electronics   

    
The goal of this chapter is to provide some basic information about electronic circuits. We make the assumption that you have no prior knowledge of electronics, electricity, or circuits, and start from the basics. This is an unconventional approach, so it may be interesting, or at least amusing, even if you do have some experience. So, the first question is “What is an electronic circuit?” A circuit is a structure that directs and controls electric currents, presumably to perform some useful function. The very name “circuit” implies that the structure is closed, something like a loop. That is all very well, but this answer immediately raises a new question: “What is an electric current?” Again, the name current” indicates that it refers to some type of flow, and in this case we mean a flow of electric charge, which is usually just called charge because electric charge is really the only kind there is. Finally we come to the basic question:

What is Charge?

No one knows what charge really is anymore than anyone knows what gravity is. Both are models, constructions, fabrications if you like, to describe and represent something that can be measured in the real world, specifically a force. Gravity is the name for a force between masses that we can feel and measure. Early workers observed that bodies in “certain electrical condition” also exerted forces on one another that they could measure, and they invented charge to explain their observations. Amazingly, only three simple postulates or assumptions, plus some experimental observations, are necessary to explain all electrical phenomena. Everything: currents, electronics, radio waves, and light. Not many things are so simple, so it is worth stating the three postulates clearly.

Charge exists.   

We just invent the name to represent the source of the physical force that can be observed. The assumption is that the more charge something has, the more force will be exerted. Charge is measured in units of Coulombs, abbreviated C. The unit was named to honor Charles Augustin Coulomb (1736-1806) the French aristocrat and engineer who first measured the force between charged objects using a sensitive torsion balance he invented. Coulomb lived in a time of political unrest and new ideas, the age of Voltaire and Rousseau. Fortunately, Coulomb completed most of his work before the revolution and prudently left Paris with the storming of the Bastille.

Charge comes in two styles.

We call the two styles positive charge, + , and (you guessed it) negative charge, – . Charge also comes in lumps of 1.6 �10-19C , which is about two ten-million-trillionths of a Coulomb. The  discrete nature of charge is not important for this discussion, but it does serve to indicate that a Coulomb is a LOT of charge.

Charge is conserved.

You cannot create it and you cannot annihilate it. You can, however, neutralize it. Early workers observed experimentally that if they took equal amounts of positive and negative charge and combined them on some object, then that object neither exerted nor responded to electrical forces; effectively it had zero net charge. This experiment suggests that it might be possible to take uncharged, or neutral, material and to separate somehow the latent positive and negative charges. If you have ever rubbed a balloon on wool to make it stick to the wall, you have separated charges using mechanical action.
Those are the three postulates. Now we will present some of the experimental findings that both led to them and amplify their significance.

Voltage   

First we return to the basic assumption that forces are the result of charges. Specifically, bodies with opposite charges attract, they exert a force on each other pulling them together. The magnitude of the force is proportional to the product of the charge on each mass. This is just like gravity, where we use the term “mass” to represent the quality of bodies that results in the attractive force that pulls them together (see Fig. 4.1). 

  

Figure 4.1: Opposite charges exert an attractive force on each other, just like two masses attract. External force is required to hold them apart, and work is required to move them farther apart.
\begin{figure} \fbox {\centerline{\psfig{figure=basicelec/opp-charge.I}}}\end{figure}


Electrical force, like gravity, also depends inversely on the distance squared between the two bodies; short separation means big forces. Thus it takes an opposing force to keep two charges of opposite sign apart, just like it takes force to keep an apple from falling to earth. It also takes work and the expenditure of energy to pull positive and negative charges apart, just like it takes work to raise a big mass against gravity, or to stretch a spring. This stored or potential energy can be recovered and put to work to do some useful task. A falling mass can raise a bucket of water; a retracting spring can pull a door shut or run a clock. It requires some imagination to devise ways one might hook on to charges of opposite sign to get some useful work done, but it should be possible.
The potential that separated opposite charges have for doing work if they are released to fly together is called voltage, measured in units of volts (V). (Sadly, the unit volt is not named for Voltaire, but rather for Volta, an Italian scientist.) The greater the amount of charge and the greater the physical separation, the greater the voltage or stored energy. The greater the voltage, the greater the force that is driving the charges together. Voltage is always measured between two points, in this case, the positive and negative charges. If you want to compare the voltage of several charged bodies, the relative force driving the various charges, it makes sense to keep one point constant for the measurements. Traditionally, that common point is called ground.”
Early workers, like Coulomb, also observed that two bodies with charges of the same type, either both positive or both negative, repelled each other (Fig. 4.2). They experience a force pushing 

  

Figure 4.2: Like charges exert a repulsive force on each other. External force is required to hold them together, and work is required to push them closer.
\begin{figure}\fbox {\centerline{\psfig{figure=basicelec/like-charge.I}}}\end{figure}


them apart, and an opposing force is necessary to hold them together, like holding a compressed spring. Work can potentially be done by letting the charges fly apart, just like releasing the spring. Our analogy with gravity must end here: no one has observed negative mass, negative gravity, or uncharged bodies flying apart unaided. Too bad, it would be a great way to launch a space probe. The voltage between two separated like charges is negative; they have already done their work by running apart, and it will take external energy and work to force them back together.
So how do you tell if a particular bunch of charge is positive or negative? You can’t in isolation. Even with two charges, you can only tell if they are the same (they repel) or opposite (they attract). The names are relative; someone has to define which one is “positive.” Similarly, the voltage between two points A and B , VAB , is relative. If VAB is positive you know the two points are oppositely charged, but you cannot tell if point A has positive charge and point B negative, or visa versa. However, if you make a second measurement between A and another point C , you can at least tell if B and C have the same charge by the relative sign of the two voltages, VAB and VAC to your common point A . You can even determine the voltage between B and C without measuring it: VBC = VAC – VAB . This is the advantage of defining a common point, like A , as ground and making all voltage measurements with respect to it. If one further defines the charge at point A to be negative charge, then a positive VAB means point B is positively charged, by definition. The names and the signs are all relative, and sometimes confusing if one forgets what the reference or ground point is.

Current   

Charge is mobile and can flow freely in certain materials, called conductors. Metals and a few other elements and compounds are conductors. Materials that charge cannot flow through are called insulators. Air, glass, most plastics, and rubber are insulators, for example. And then there are some materials called semiconductors, that, historically, seemed to be good conductors sometimes but much less so other times. Silicon and germanium are two such materials. Today, we know that the difference in electrical behavior of different samples of these materials is due to extremely small amounts of impurities of different kinds, which could not be measured earlier. This recognition, and the ability to precisely control the “impurities” has led to the massive semiconductor electronics industry and the near-magical devices it produces, including those on your RoboBoard. We will discuss semiconductor devices later; now let us return to conductors and charges.
Imagine two oppositely charged bodies, say metal spheres, that are being held apart, as in Fig. 4.3

  

Figure 4.3: Two spheres with opposite charges are connected by a conductor, allowing charge to flow.
\begin{figure} \fbox {\centerline{\psfig{figure=basicelec/current.I}}}\end{figure}


There is a force between them, the potential for work, and thus a voltage. Now we connect a conductor between them, a metal wire. On the positively charged sphere, positive charges rush along the wire to the other sphere, repelled by the nearby similar charges and attracted to the distant opposite charges. The same thing occurs on the other sphere and negative charge flows out on the wire. Positive and negative charges combine to neutralize each other, and the flow continues until there are no charge differences between any points of the entire connected system. There may be a net residual charge if the amounts of original positive and negative charge were not equal, but that charge will be distributed evenly so all the forces are balanced. If they were not, more charge would flow. The charge flow is driven by voltage or potential differences. After things have quieted down, there is no voltage difference between any two points of the system and no potential for work. All the work has been done by the moving charges heating up the wire.
The flow of charge is called electrical current. Current is measured in amperes (a), amps for short (named after another French scientist who worked mostly with magnetic effects). An ampere is defined as a flow of one Coulomb of charge in one second past some point. While a Coulomb is a lot of charge to have in one place, an ampere is a common amount of current; about one ampere flows through a 100 watt incandescent light bulb, and a stove burner or a large motor would require ten or more amperes. On the other hand low power digital circuits use only a fraction of an ampere, and so we often use units of1/1000 of an ampere, a milliamp, abbreviated as ma, and even 1/1000 of a milliamp, or a microamp, �a . The currents on the RoboBoard are generally in the milliamp range, except for the motors, which can require a full ampere under heavy load. Current has a direction, and we define a positive current from point A to B as the flow of positive charges in the same direction. Negative charges can flow as well, in fact, most current is actually the result of negative charges moving. Negative charges flowing from A to B would be a negative current, but, and here is the tricky part, negative charges flowing from B to Awould represent a positive current from A to B . The net effect is the same: positive charges flowing to neutralize negative charge or negative charges flowing to neutralize positive charge; in both cases the voltage is reduced and by the same amount.

Batteries   

Charges can be separated by several means to produce a voltage. A battery uses a chemical reaction to produce energy and separate opposite sign charges onto its two terminals. As the charge is drawn off by an external circuit, doing work and finally returning to the opposite terminal, more chemicals in the battery react to restore the charge difference and the voltage. The particular type of chemical reaction used determines the voltage of the battery, but for most commercial batteries the voltage is about 1.5 V per chemical section or cell. Batteries with higher voltages really contain multiple cells inside connected together in series. Now you know why there are 3 V, 6 V, 9 V, and 12 V batteries, but no 4 or 7 V batteries. The current a battery can supply depends on the speed of the chemical reaction supplying charge, which in turn often depends on the physical size of the cell and the surface area of the electrodes. The size of a battery also limits the amount of chemical reactants stored. During use, the chemical reactants are depleted and eventually the voltage drops and the current stops. Even with no current flow, the chemical reaction proceeds at a very slow rate (and there is some internal current flow), so a battery has a finite storage or shelf life, about a year or two in most cases. In some types of batteries, like the ones we use for the robot, the chemical reaction is reversible: applying an external voltage and forcing a current through the battery, which requires work, reverses the chemical reaction and restores most, but not all, the chemical reactants. This cycle can be repeated many times. Batteries are specified in terms of their terminal voltage, the maximum current they can deliver, and the total current capacity in ampere-hours.
You should handle batteries carefully, especially the ones we use in this course. Chemicals are a very efficient and compact way of storing energy. Just consider the power of gasoline or explosives, or the fact that you can play soccer for several hours powered only by a slice of cold pizza for breakfast. Never connect the terminals of a battery together with a wire or other good conductor. The battery we use for the RoboBoard is similar to the battery in cars, which uses lead and sulphuric acid as reactants. Such batteries can deliver very large currents through a short circuit, hundreds of  amperes. The large current will heat the wire and possibly burn you; the resulting rapid internal chemical reactions also produce heat and the battery can explode, spreading nasty, reactive chemicals about. Charging these batteries with too large a current can have the same effect. Double check the circuit and instructions before connecting a battery to any circuit. More information on batteries can be found in Chapter 7.

Circuit Elements

Resistors   

  
We need some way to control the flow of current from a voltage source, like a battery, so we do not melt wires and blow up batteries. If you think of current, charge flow, in terms of water flow, a good electrical conductor is like big water pipe. Water mains and fire hoses have their uses, but you do not want to take a drink from one. Rather, we use small pipes, valves, and other devices to limit water flow to practical levels. Resistors do the same for current; they resist the flow of charge; they are poor conductors. The value of a resistor is measured in ohms and represented by the Greek letter capital omega. There are many different ways to make a resistor. Some are just a coil of wire made of a material that is a poor conductor. The most common and inexpensive type is made from powdered carbon and a glue-like binder. Such carbon composition resistors usually have a brown cylindrical body with a wire lead on each end, and colored bands that indicate the value of the resistor. The key to reading these values is given in Chapter 2.
There are other types of resistors in your robot kit. The potentiometer is a variable resistor. When the knob of a potentiometer is turned, a slider moves along the resistance element. Potentiometers generally have three terminals, a common slider terminal, and one that exhibits increasing resistance and one that has decreasing resistance relative to the slider as the  shaft is turned in one direction. The resistance between the two stationary contacts is, of course, fixed, and is the value specified for the potentiometer. The photoresistor or photocell is composed of a light sensitive material. When the photocell is exposed to more light, the resistance decreases. This type of resistor makes an excellent light sensor.

Ohm’s Law

Ohm’s law describes the relationship between voltage, V , which is trying to force charge to flow, resistance, R , which is resisting that flow, and the actual resulting current I . The relationship is simple and very basic: \begin{displaymath}V = I R \quad{\rm or}\quad I = {V \over R} \end{displaymath}.   Thus large voltages and/or low resistances produce large currents. Large resistors limit current to low values. Almost every circuit is more complicated than just a battery and a resistor, so which voltage does the formula refer to? It refers to the voltage across the resistor, the voltage between the two terminal wires. Looked at another way, that voltage is actually produced by the resistor. The resistor is restricting the flow of charge, slowing it down, and this creates a traffic jam on one side, forming an excess of charge with respect to the other side. Any such charge difference or separation results in a voltage between the two points, as explained above. Ohm’s law tells us how to calculate that voltage if we know the resistor value and the current flow. This voltage drop is analogous to the drop in water pressure through a small pipe or small nozzle.

Power   

Current flowing through a poor conductor produces heat by an effect similar to mechanical friction. That heat represents energy that comes from the charge traveling across the voltage difference. Remember that separated charges have the potential to do work and provide energy. The work involved in heating a resistor is not very useful, unless we are making a hotplate; rather it is a byproduct of restricting the current flow. Power is measured in units of watts (W), named after James Watt, the Englishman who invented the steam engine, a device for producing lots of useful power. The power that is released into the resistor as heat can be calculated as P=VI , where I is the current flowing through the resistor and V is the voltage across it. Ohm’s law relates these two quantities, so we can also calculate the power as\begin{displaymath}P = {V^2 \over R} \quad {\rm or}\quad P = I^2 R \end{displaymath}The power produced in a resistor raises its temperature and can change its value or destroy it. Most resistors are air-cooled and they are made with different power handling capacity. The most common values are 1/8, 1/4, 1, and 2 watt resistors, and the bigger the wattage rating, the bigger the resistor physically. Some high power applications use special water cooled resistors. Most of the resistors on the RoboBoard are 1/8 watt.

Combinations of Resistors   

Resistors are often connected together in a circuit, so it is necessary to know how to determine the resistance of a combination of two or more resistors. There are two basic ways in which resistors can be connected: in series and in parallel. A simple series resistance circuit is shown in Figure 4.4

  

Figure 4.4: Two Resistors in Series
\begin{figure}\fbox {\centerline{\psfig{figure=basicelec/resseries.PS}}}\end{figure}


Determining the total resistance for two or more resistors in series is very simple. Total resistance equals the sum of the individual resistances. In this case, RT=R1+R2 . This makes common sense; if you think again in terms of water flow, a series of obstructions in a pipe add up to slow the flow more than any one. The resistance of a series combination is always greater than any of the individual resistors.
The other method of connecting resistors is shown in Figure 4.5, which shows a simple parallel resistance circuit. 

  

Figure 4.5: Two Resistors in Parallel
\begin{figure}\fbox {\centerline{\psfig{figure=basicelec/resparallel.PS}}}\end{figure}


Our water pipe analogy indicates that it should be easier for current to flow through this multiplicity of paths, even easier than it would be to flow through any single path. Thus, we expect a parallel combination of resistors to have less resistance than any one of the resistors. Some of the total current will flow through R1 and some will flow through R2, causing an equal voltage drop across each resistor. More current, however, will flow through the path of least resistance. The formula for total resistance in a parallel circuit is more complex than for a series circuit:

RT={1{1R1}+{1R2}…+{1Rn}} (1)

Parallel and series circuits can be combined to make more complex structures, but the resulting complex resistor circuits can be broken down and analyzed in terms of simple series or parallel circuits. Why would you want to use such combinations? There are several reasons; you might use a combination to get a value of resistance that you needed but did not have in a single resistor. Resistors have a maximum voltage rating, so a series of resistors might be used across a high voltage. Also, several low power resistors can be combined to handle higher power. What type of connection would you use?

Capacitors   

  
Capacitors are another element used to control the flow of charge in a circuit. The name derives from their capacity to store charge, rather like a small battery. Capacitors consist of two conducting surfaces separated by an insulator; a wire lead is connected to each surface. You can imagine a capacitor as two large metal plates separated by air, although in reality they usually consist of thin metal foils or films separated by plastic film or another solid insulator, and rolled up in a compact package. Consider connecting a capacitor across a battery, as in Fig. 4.6

  

Figure 4.6: A simple capacitor connected to a battery through a resistor.
\begin{figure} \fbox {\centerline{\psfig{figure=basicelec/capacitor.I}}}\end{figure}


As soon as the connection is made charge flows from the battery terminals, along the wire and onto the plates, positive charge on one plate, negative charge on the other. Why? The like-sign charges on each terminal want to get away from each other. In addition to that repulsion, there is an attraction to the opposite-sign charge on the other nearby plate. Initially the current is large, because in a sense the charges can not tell immediately that the wire does not really go anywhere, that there is no complete circuit of wire. The initial current is limited by the resistance of the wires, or perhaps by a real resistor, as we have shown in Fig. 4.6. But as charge builds up on the plates, charge repulsion resists the flow of more charge and the current is reduced. Eventually, the repulsive force from charge on the plate is strong enough to balance the force from charge on the battery terminal, and all current stops. Figure 4.7 shows how the current might vary with 

  

Figure 4.7: The time dependence of the current in the circuit of Fig. 4.6 for two values of resistance.
\begin{figure} \fbox {\centerline{\psfig{figure=basicelec/decay.I}}}\end{figure}


time for two different values of resistors. For a large resistor, the whole process is slowed because the current is less, but in the end, the same amount of charge must exist on the capacitor plates in both cases. The magnitude of the charge on each plate is equal.
The existence of the separated charges on the plates means there must be a voltage between the plates, and this voltage be equal to the battery voltage when all current stops. After all, since the points are connected by conductors, they should have the same voltage; even if there is a resistor in the circuit, there is no voltage across the resistor if the current is zero, according to Ohm’s law. The amount of charge that collects on the plates to produce the voltage is a measure of the value of the capacitor, its capacitance, measured in farads (f). The relationship is C = Q/V , where Q is the charge in Coulombs. Large capacitors have plates with a large area to hold lots of charge, separated by a small distance, which implies a small voltage. A one farad capacitor is extremely large, and generally we deal with microfarads (�f ), one millionth of a farad, or picofarads (pf), one trillionth (10-12) of a farad.
Consider the   circuit of Fig. 4.6 again. Suppose we cut the wires after all current has stopped flowing. The charge on the plates is now trapped, so there is still a voltage between the terminal wires. The charged capacitor looks somewhat like a battery now. If we connected a resistor across it, current would flow as the positive and negative charges raced to neutralize each other. Unlike a battery, there is no mechanism to replace the charge on the plates removed by the current, so the voltage drops, the current drops, and finally there is no net charge left and no voltage differences anywhere in the circuit. The behavior in time of the current, the charge on the plates, and the voltage looks just like the graph in Fig. 4.7. This curve is an exponential function: exp(-t/RC) . The voltage, current, and charge fall to about 37% of their starting values in a time of R �C seconds, which is called the characteristic time or the time constant of the circuit. The RC time constant is a measure of how fast the circuit can respond to changes in conditions, such as attaching the battery across the uncharged capacitor or attaching a resistor across the charged capacitor. The voltage across a capacitor cannot change immediately; it takes time for the charge to flow, especially if a large resistor is opposing that flow. Thus, capacitors are used in a circuit to damp out rapid changes of voltage.

Combinations of Capacitors   

Like resistors, capacitors can be joined together in two basic ways: parallel and series. It should be obvious from the physical construction of capacitors that connecting two together in parallel results in a bigger capacitance value. A parallel connection results in bigger capacitor plate area, which means they can hold more charge for the same voltage. Thus, the formula for total capacitance in a parallel circuit is:

CT=C1+C2…+Cn , (2)

the same form of equation for resistors in series, which can be confusing unless you think about the physics of what is happening.
The capacitance of a series connection is lower than any capacitor because for a given voltage across the entire group, there will be less charge on each plate. The total capacitance in a series circuit is

CT={1{1C1}+{1C2}…+{1Cn}}. (3)

Again, this is easy to confuse with the formula for parallel resistors, but there is a nice symmetry here.

Inductors   

Inductors are the third and final type of basic circuit component. An inductor is a coil of wire with many windings, often wound around a core made of a magnetic material, like iron. The properties of inductors derive from a different type of force than the one we invented charge to explain: magnetic force rather than electric force. When current flows through a coil (or any wire) it produces a magnetic field in the space outside the wire, and the coil acts just like any natural, permanent magnet, attracting iron and other magnets. If you move a wire through a magnetic field, a current will be generated in the wire and will flow through the associated circuit. It takes energy to move the wire through the field, and that mechanical energy is transformed to electrical energy. This is how an electrical generator works. If the current through a coil is stopped, the magnetic field must also disappear, but it cannot do so immediately. The field represents stored energy and that energy must go somewhere. The field contracts toward the coil, and the effect of the field moving through the wire of the coil is the same as moving a wire through a stationary field: a current is generated in the coil. This induced current acts to keep the current flowing in the coil; the induced current opposes any change, an increase or a decrease, in the current through the inductor. Inductors are used in circuits to smooth the flow of current and prevent any rapid changes.
The current in an inductor is analogous to the voltage across a capacitor. It takes time to change the voltage across a capacitor, and if you try, a large current flows initially. Similarly, it takes time to change the current through an inductor, and if you insist, say by opening a switch, a large voltage will be produced across the inductor as it tries to force current to flow. Such induced voltages can be very large and can damage other circuit components, so it is common to connect some element, like a resistor or even a capacitor across the inductor to provide a current path and absorb the induced voltage. (Often, a diode, which we will discuss later, is used.)
Inductors are measured in henrys (h), another very big unit, so you are more likely to see millihenries, and microhenries. There are almost no inductors on the RoboBoard, but you will be using some indirectly: the motors act like inductors in many ways. In a sense an electric motor is the opposite of an electrical generator. If current flows through a wire that is in a magnetic field (produced either by a permanent magnet or current flowing through a coil), a mechanical force will be generated on the wire. That force can do work. In a motor, the wire that moves through the field and experiences the force is also in the form of a coil of wire, connected mechanically to the shaft of the motor. This coil looks like and acts like an inductor; if you turn off the current (to stop the motor), the coil will still be moving through the magnetic field, and the motor now looks like a generator and can produce a large voltage. The resulting inductive voltage spike can damage components, such as the circuit that controls the motor current. In the past this effect destroyed a lot of motor controller chips and other RoboBoard components. The present board design contains special diodes that will withstand and safely dissipate the induced voltages — we hope.

Combinations of Inductors

You already know how inductors act in combination because they act just like resistors. Inductance adds in series. This makes physical sense because two coils of wire connected in series just looks like a longer coil. Parallel connection reduces inductance because the current is split between the several coils and the fields in each are thus weaker.

Categories: circuit, projects

A very simple and easy simulator

May 29, 2011 Leave a comment
 A very simple and easy circuit simulator for beginners look here!

circuit simulator circuit simulator circuit simulator circuit simulator 

Categories: circuit, projects

Projects Bundle :)

May 29, 2011 Leave a comment
Categories: projects

Dummy Alarm Project

May 28, 2011 Leave a comment


Download PDF version of this page

Dummy AlarmThis Dummy Alarm project makes an LED flash briefly once every 5 seconds to imitate the indicator light of a real alarm. The circuit is designed to use very little current to prolong battery life so that it can be left on permanently. An on/off switch is not included, but could be added if you wish.
The 7555 timer IC used is a low power version of the standard 555 timer. A ‘superbright’ red LED is used because this provides a bright flash with a low current. The LED is off for most of the time so the average total current for the circuit is less than 0.2mA. With this very low current a set of 3 alkaline AA cells should last for several months, maybe as long as a year.
The circuit will work with a standard 555 timer IC (such as the popular NE555) but this will increase the average current to about 2mA and the battery life will be much shorter. You can use a greater supply voltage (15V maximum) for this circuit but the 1k resistor for the LED should be increased to keep the LED current low at about 3mA. For example to use a 9V PP3 battery change the 1k resistor to 3k3. Note that AA cells will last longer than a 9V PP3 battery.
This project uses a 555 astable circuit.


Parts Required

  • resistors: 1k, 10k, 680k
  • capacitor: 10µF radial
  • LED: red superbright, 5mm diameter
  • 7555 low power timer IC
  • 8-pin DIL socket for IC
  • battery clip
  • 4.5V battery box for 3 AA cells
  • stripboard: 8 rows × 16 holes


Stripboard Layout

Stripboard layout for Dummy Alarm project


Circuit diagram

Circuit diagram for Dummy Alarm project

Categories: projects

Flashing LED Project

May 28, 2011 Leave a comment

LED stands for Light Emitting Diode
.
Download PDF version of this page
This project is designed as an introduction to soldering, identifying common components, using the resistor colour code and placing components correctly on stripboard. The LED flashes at about 3Hz (3 flashes per second). This project uses a 555 astable circuit.


Parts Required

  • resistors: 470, 1k, 220k
  • capacitor: 1µF 16V radial
  • red LED (or orange, yellow or green if you prefer!)
  • 555 timer IC
  • 8-pin IC holder (a ‘DIL socket’) for the 555 IC
  • battery clip for 9V PP3
  • stripboard: 6 rows × 21 holes

Instructions

  1. Solder the 8-pin IC holder in the correct place on the stripboard.
  2. Break the 4 tracks under the IC holder with a track cutter tool. You can allow extra holes if your piece of stripboard is large enough.

    Stripboard with IC holder


  3. Use the resistor colour code to identify the resistors which are marked with coloured bands to show their value.
  4. Insert and solder the resistors in the correct position, they can be put in either way round, but you must line them up correctly with the IC holder.
  5. Identify the other parts, then solder them in the correct position and the right way round. To help you identify the parts please see our page on soldering.

    Stripboard layout for flashing LED


  6. Solder the 2 wire links in place around the IC holder, it is easier to use plastic-coated single-core wire. (The flexibility of stranded wire is not needed for connections like this and the strands can be difficult to push through the small hole).
  7. Finally insert the 555 timer IC and connect a battery!
Categories: projects

Water level buzzer

May 28, 2011 Leave a comment
Specifications

 
Water Level Buzzer is a simple kit which will buzz when water reaches the sensor level.
  • Input – 9 VDC @ 40 mA
  • Output ??? Buzzer
  • Terminal pins for Supply voltage
  • Power-On LED indicator
  • Four mounting holes of 3.2 mm each
  • PCB dimensions 32 mm x 35 mm
Schematic

Parts List

PCB

Download

Categories: projects

May 27, 2011 3 comments

2500W Phase Control
author: Hans-Juergen Zons [hjzelec @ freenet.de]


This circuit controls resistive and inductive loads up to 2,500W. Its main functional device is an integrated phase control circuit – Siemens TLE3103. It contains its own power supply, a zero voltage crossing detector circuit and a logic driver. An additional feature is the low voltage input to enable/disable triac firing enabling/disabling the logic driver. The function is as follows: pin13 TLE3103 open (floating), trigger output active, tied to ground trigger output disabled.


Description

An UP and a DOWN pushbutton control a 32-step digital potentiometer (IC2, AD5228) via the debouncer IC1 (MAX6817). The digital potentiometer has a power on reset pin which might be tied to ground causing the potentiometer to start at midscale, or to VCC causing it to start at zero scale. The desired function is selectable using jumper JP1. The triac (capable of driving 40A loads) is a bit overkill for the desired power but the BTA41 has an isolated body and therefore handling of the board under voltage is less dangerous as it is with phase on the package. The snubber circuit uses a 68μH inductance but this might be replaced with a 100 resistor. When replacing the inductance C5 should have a value of 47nF.
Board: Purely single sided, measurements: 3.54X2.15 inches (87.63X54.61mm)
Remark: The debouncer circuit is manufactured with a SOT23-6 package. It might be soldered directly onto the board (DIP-6 package) using thin wires or an adapter board.
Circuit designed by:
Hans-Juergen Zons
102 Moo 9 Lampasak
T. Dong Mon Lek
Mueang, Phetchabun
Phetchabun
67000 Thailand
Email: hjzelec@freenet.de

Parts List

Part Value Package
C1 100n C-5
C2 100n C-5
C3 100/16 ELC3,81
C4 22n C-5
C5 10n/250VAC C-15
D1 1N4005 DO41-10
IC1 MAX6817 AD-SOT23
IC2 AD5228 DIL08
IC3 TLE3103 DIL-14
J1 TE-03 TERMINAL 5.08
J2 TE-03 TERMINAL 5.08
J3 TE-03 TERMINAL 5.08
L1 68H/3A DS30A
Q1 BTA41-600 TOP3
R1 120R R-10
R2 18K/2W R-18
R3 820K R-10
R4 180K R-10
R5 56K R-10
S1 UP BUTTON-02
S2 DOWN BUTTON-02

PCB

Download

Categories: projects

Sound Level Indicator

May 27, 2011 Leave a comment
INTRODCTION:


This project uses an LM3915 bar-graph IC driving two sets of ten LEDs for a 30dB range. The circuit is unique because it has an additional range of 20dB provided by an automatic gain control to allow it to be very sensitive to low sound levels but it increases its range 20dB for loud sounds.


The LEDs are operating at 26mA each with the brightness control at maximum, which is very bright. The circuit has a

switch to select the modes of operation: a moving dot of light, or a bar with a changing length.

My prototype has a little 9V Ni-Cad rechargeable battery in it to be portable and the battery is trickle-charged when the project is powered by a 9V AC-DC adapter.

Circuit Description

1) The electret microphone is powered by and has a load of R1 from an LM2931 5V low-dropout regulator.


2) The 1st opamp stage is an audio preamp with a gain of 101.


3) The 2nd opamp stage is a single-supply opamp which works fine with its inputs and output at ground and is used as a rectifier driver with a gain of 1.8. It is biased at ground. Since it is inverting, when its input swings negative, its output swings positive.


4) Three 2N3904 transistors are used as emitter-followers:
a) Q1 is inside the negative feedback loop of the 2nd opamp as a voltage reference for the other two transistors. Hopefully the transistors match each other.
b) Q2 emitter-follower transistor quickly charges C8 which discharges slower into R13 and is used as a peak detector.
c) Q3 transistor is the automatic gain control. It is also a peak detector but has slower charge and discharge times. It drives the comparators’ resistor ladder in the LM3915 to determine how sensitive it is. R15 from +5V is in a voltage divider with the ladder’s total resistance of about 25k and provides the top of the ladder with about +0.51V when there is a very low sound level detected. Loud sounds cause Q3 to drive the top of the ladder to 5.1V for reduced sensitivity.


5) The LM3915 regulates the current for the LEDs so they don’t need current-limiting resistors. In the bar mode with all LEDs lit then the LM3915 gets hot so the 10 ohm/1W resistor R16 shares the heat.

Options

1) You could use a switch to change the brightness instead of a pot, or leave it bright.
2) You could use an LM358 dual opamp (I tried it) but its output drops above 4Khz. The MC33172 is flat to 20kHz with this high gain.
3) You could add a 1uF to 2.2uF capacitor across R5 so the indicator responds only to bass or “the beat” of music. Then an LM358 dual opamp is fine.

Construction
1) The stripboard layout was designed for a Hammond 1591B plastic box with space in the lower end for a rechargeable 9V battery. One bolt holds the circuit board and a second bolt was cut short as a guide.
2) A second piece of stripboard was used on a diagonal to space the LEDs closely together. A few LEDs needed their rim to be filed slightly to fit.
3) A third piece of stripboard was used as a separating wall for the battery and it interlocks with the LEDs stripboard to hold it in place.
4) 11-wire flexible ribbon cable connects to the LEDs.
5) Use shielded audio from the microphone and a rubber grommet holding it.

Parts List 
R1–10k
R2, R3, R5, R7, R8, R10–100k
R4–47k
R6–1k
R9–56k
R11–4.7k
R12, R14–100
R13–330k
R15–220k
R16–10/1W
R17, R19–390
R18–22k
P1–10k audio-taper (log) pot

C1, C4, C8–330nF
C2–47uF/10V
C3, C9–100uF/10V
C5–100nF
C6–470uF/16V
C7–10uF/16V
IC1–MC33172P
IC2–LM3915P
5V reg–LM2931AZ5.0

LEDs–MV8191 super-red diffused
Electret microphone–two-wire type Box–Hammond 1591B
Battery–9V Ni-Cad or Ni-MH
SW1–SPST switch
Adapter jack–switched

ENJOY.. SOUNDING…
Categories: projects