Wednesday, June 8, 2011

pic programming tutorial

Introduction :
Welcome to the start of the PIC. These pages will form the basic structure of the device, right through methods and programming techniques. In addition, there will be suggestions on how to modify the code so you can adapt the PIC to suit your applications within Cybot. I will not be including internal architecture diagrams, as this can only lead to confusion. To view the data sheet, then this can be downloaded from the website of microchips.

For starters, let's look at the PIC.


Microchip PIC 16F84 Microcontroller

Microchip manufacture a series of PIC microcontrollers called. You can see the range of microcontrollers here. There are many different flavors available, some basic types of short memory, go straight through those who have analog - digital converters to the PWM even built in. I'm going to concentrate on the PIC 16F84. Once you have learned to program a PIC type, learning the rest is easy.

There are several ways to program the PIC - using BASIC, C or assembly language. I'll show you the assembly language. Do not be intimidated by this. There are only 35 instructions to learn, and is the cheapest way to program the PIC, as it requires no additional software beyond the gifts. 

Ther is a Pin configuration of PIC 16f84 and its Detail.











To RA0 RA4
RA is a bidirectional port. Ie can be configured as input or output. RA The next number is the number of bits (0-4). Thus, we have an address of 5 bits, where each bit can be configured as input or output.

RB0 to RB7
RB is a second bidirectional port. It behaves exactly the same way as RA, except that it is 8 - bits involved.

VSS and VDD
These are the power pins. VDD is the positive supply and VSS is the negative supply or 0V. The maximum voltage that can be used is 6 V, and the minimum is 2V

OSC1/CLK AND OSC2/CLKOUT
These pins are where we connect an external clock, so that the microcontroller has some kind of calendar.

MCLR
This pin is used to erase the memory locations inside the PIC (ie, when we return to the programs.)In normal use, is connected to the positive supply rail.

INT
This is an input pin that can be controlled. If the pin is high, we can make the program to restart, stop, or any other unique feature that we want. We will not use this one much.

T0CK1
This is another clock input, which operates an internal timer. Works in isolation from the main clock. Again, do not use this much

 How to Program The Pic
 Now, you want to know how to program the PIC, but apart from learning the instructions of assembly code, how you go about actually programming the information? Well, there are two ways - the easy way, and how to DIY. The easiest way is to buy a PIC programmer (about £ 35), which connects to the PC and you can program the PIC using the supplied software. The DIY way is to build your own programmer (cheaper is less than £ 20) and the use of Internet and free software program that way.

Go to next Section http://electro-computerprojects.blogspot.com/p/pic-programer-software-free-download.html

Sunday, June 5, 2011

12v 4amp Speed Control

A continuously working wiper in a automobile may show to be a nuisance, when it is not raining heavily. By using the circuit described here can vary sweeping rate of the wiper from one times a second to one times in0 seconds. The circuit comprises timer NE555 ICs, CD4017 decade counter, TIP32 driver transistor, a 2N3055 power transistor (or TIP3055) as well as a few other discrete parts. Timer IC1 is configured as a mono- stable multivibrator which produces a pulse when presses switch S1 momentarily. This pulse acts as a clock pulse for the decade counter (IC2) which advances by count on each successive clock pulse or the push of switch S1.0 presets (VR1 through VR10), set for different values by trial and error, are used at the0 outputs of IC2. But since output of IC2 is high at a time, preset (at selected output) effectively comes in series with timing resistors R4 and R5 connected in the circuit of timer IC3 which functions in astable mode. As presets VR1 through VR10 are set for different values, different time periods (or frequencies) for astable multivibrator IC3 can be selected. The output of IC3 is applied to pnp driver transistor T1 (TIP32) for driving the final power transistor T2 (2N3055) which in turn drives the wiper motor at the selected sweep speed. The power supply for the wiper motor as well as the circuit is tapped from the vehicle's battery itself. The period of monostable multivibrator IC1 is set for an very second period.

light dimmer for Cars

This matchless circuit makes your dome light look cold. Usually when the automobile door is closed, the dome light goes OFF. With this circuit, you can have our dome light fade slowly in brightness & finally go OFF. This slow dimming of the light gives an excellent feeling at night. It looks romantic!
The circuit can be explained as follows: When the automobile door is open, the push to off switch of the door is ON & hence it charges the 22uF capacitor fully. The opamp is acting as a voltage follower & its output is same as the voltage across the capacitor, which is 12V when the capacitor is fully charged. Due to a high voltage at the output of the IC, the transistor saturates, turning ON the bulb to full brightness.

Now when the door is closed, the door switch is pushed in & hence the switch goes OFF. When the switch is OFF, the capacitor starts discharging slowly through VR1 & the 10K resistor & the voltage across it decreases slowly. Hence at the output of IC 741 also the voltage decreases gradually, hence decreasing the base current to the transistor. This produces a slowly decreasing current through the bulb & the bulb fades out & finally when the capacitor is fully discharged, the bulb goes OFF.

After building the circuit, with the push-to-off switch in ON position (not pushed in) i.e. the automobile door open, fine-tune the preset VR2 to the necessary preliminary brightness of the bulb. Then push the switch in to turn it OFF(or close the door) & fine-tune VR1 for the time to bring the bulb from full brightness to OFF.
I would recommend you set VR1 & VR2 to their maximum values.




Charging Monitor for 12V lead acid battery

A battery is a vital element of any battery-backed method. In plenty of cases the battery is more pricey than the method it is backing up. Hence they must adopt all practical measures to preserve battery life.
As per manufacturer's information sheets, a 12V rechargeable lead-acid battery ought to be operated within ten. IV and 13.8V. When the battery charges higher than 13.8V it is said to be overcharged, and when it discharges below ten.IV it can be deeply discharged. A single event of overcharge or deep discharge can bring down the charge-holding capacity of a battery by 15 to twenty per-cent.
It is therefore necessary for all concerned to monitor the charge level of their batteries continuously. But, in practice, plenty of of the battery users are unable to do so because of non-avail­ability of reasonably-priced monitoring equipment. The circuit idea introduced here will fill this void by providing a circuit for monitoring the charge level of lead-acid batteries continuously. The circuit possesses vital features:
First, it reduces the requirement of human attention by about 85 per-cent.
Second, it is a highly correct and sophisticated system.
Input from the battery under check is applied to LM3914 1C. This applied voltage is ranked anywhere between 0 and ten, depending on its magnitude. The lower reference voltage of ten.IV is ranked '0' and the upper voltage of 13.8V is ranked as '10.' (Outputs 9 and ten are logically ORed in this circuit.) This calibration of reference voltages is explained later.
1C 74LS147 is a decimal-to-BCD priority encoder which converts the output of LM3914 in to its BCD complement. The true BCD is obtained by using the hex inverter 74LS04. This BCD output is displayed as a decimal digit after con­version using IC5 (74LS247), which is a BCD-to-seven-segment decoder/driver. The seven-segment LED display (LTS-542) is used because it is simple to read compared to a bar graph or, for that matter, an analogue meter. The charge status of the battery can be quickly calculated from the display. For example, if the display shows two, it means that the battery is charged to 40 per-cent of its maximum value of 13.8V.
The use of digital principles lets us employ a buzzer that sounds whenever there is an overcharge or deep discharge, or there is a necessity to preserve battery charge. A buzzer is wired in the circuit such that it sounds whenever battery-charge falls to0 per-cent. At this point it is recommended that unnecessary load be switched off and the remaining charge be conserved for more important purposes.
Another simple combination logic circuit may even be designed that will sound the buzzer when the display shows 9. Further charging ought to be stopped at this point in order to preventive overcharge.
The circuit is powered by the battery under check, by a voltage regulator 1C. The circuit takes about 100 MA for its operation.
For calibrating the upper and lower reference levels, a digital multimeter as well as a variable regulated power supply source are necessary. For calibrating the lower reference voltage, follow the steps given below:
Set the output of power supply source to ten. IV.
Connect the power supply source than the battery.
Now the display will show some reading. At this point vary preset VR2 until the reading on the display changes from one to 0.
The higher reference voltage is calibrated similarly by setting the power supply to 13.8V and ranging preset VR1 until reading on the display changes from 8 to 9.
















Key word:


charging monitor for 12v
12v motor
12v charging circuit
12v monitor
12v generator
solar regulator
12v car
lead acid
solar regulator 12v
solar 12v
12 volt monitor
12v voltmeter
digital voltmeter 12v
12v to 12v regulator
brunton solar
regulator 12v
12v charge regulator
lead acid charging
voltmeter 12v
12 volt charging system
charging circuit diagram
charging regulator
marine charging systems
12 volt computer monitor
solar charging system
marine charging system
12v battery charge monitor
charge monitor
12 volt charging
12v solar regulator
equus 3721
12v car regulator
12 volt solar regulator
solar charging systems
automotive charging system
generator charging system



Inrared headphone circuits

Using this low-cost project can reproduce audio from TV without disturbing others. It does not use any wire connection between TV and headphones. than a pair of wires, it makes use of invisible infrared light to transmit audio signals from TV to headphones. Without using any lens, a range of up to 6 metres is feasible. Range can be extended by using lenses and reflectors with IR sensors comprising transmitters and receivers.
IR transmitter makes use of two-stage transistor amplifier to drive series-connected IR LEDs. An audio output transformer is used (in reverse) to couple audio output from TV to the IR transmitter. Transistors T1 and T2 amplify the audio signals received from TV through the audio transformer. Low-impedance output windings (lower gauge or thicker wires) are used for connection to TV side while high-impedance windings are connected to IR transmitter. This IR transmitter can be powered from a 9-volt mains adapter or battery. Red LED1 in transmitter circuit functions as a zener diode (0.65V) as well as supply-on indicator.
IR receiver makes use of 3-stage transistor amplifier. The first transistors (T4 and T5) form audio signal amplifier while the third transistor T6 is used to drive a headphone. Adjust potmeter VR2 for max. clarity.
Direct photo-transistor towards IR LEDs of transmitter for max. range. A 9-volt battery can be used with receiver for transportable operation.

Infrared Head Rings

Use the CD-ROM drive as a audio CD player without the computer

Most of the CDROMS obtainable have an Audio-Out Output to either plug in the headphones or connect it to an amplifier.
This circuit allows to make use of the CDROM as a stand alone Audio CD player without the computer.
This circuit is nothing but a power supply which supplies +5v, +12V & Ground to the CDROM drive &
hence can be used without the computer.
You ought to buy a D-type power connecter to connect this circuit's outputs to the CDROM.
The details of the D connector are shown along with the circuit diagram.
Note that the D-connector goes in to the CDROM in way & hence prevents any destroy due to wrong connection.
Make positive that the 12V(yellow) wire is connected to the right of the D-connector(as seen from behind ,i.e the connector holes away from you with the bowed portion of the connector upwards)
As soon as an Audio CD is inserted, the CD begins to play. To move to the next track, press the Skip-Track button on the CDROM front Panel.

Stereo Channel

The add-on circuit introduced here is useful for stereo systems. This circuit has provision for connecting stereo outputs from different sources/channels as inputs & of them is selected/connected to the output at any time.
When power supply is turned �on', channel A (AR & AL) is selected. If no audio is present in channel A, the circuit waits for some time & then selects the next channel (channel B). This search operation continues until it detects audio signal in of the channels. The inter-channel wait or delay time can be adjusted with the help of preset VR1. If still longer time is necessary, may replace capacitor C1 with a capacitor of higher value.
Suppose channel A is connected to a tape recorder & channel B is connected to a radio receiver. If initially channel A is selected, the audio from the tape recorder will be present at the output. After the tape is played , or if there is pause between consecutive recordings, the circuit automatically switches over to the output from the radio receiver. To by hand skip over from (selected) active channel to another (non-selected) active channel, basically push the skip switch (S1) momentarily one time or more, until the desired channel input gets selected. The selected channel (A, B, C, or D) is indicated by the glowing of corresponding LED (LED11, LED12, LED13, or LED14 respectively).
IC CD4066 contains analogue switches. These switches are connected to separate channels. For stereo operation, similar CD4066 ICs are used as shown in the circuit. These analogue switches are controlled by IC CD4017 outputs. CD4017 is a 10-bit ring counter IC. Since of its outputs is high at any instant, switch will be closed at a time. IC CD4017 is configured as a 4-bit ring counter by connecting the fifth output Q4 (pin ten) to the reset pin. Capacitor C5 together with resistor R6 forms a power-on-reset circuit for IC2, so that on preliminary switching �on' of the power supply, output Q0 (pin four) is always �high'. The clock signal to CD4017 is provided by IC1 (NE555) which acts as an astable multivibrator when transistor T1 is in cut- off state.
IC5 (KA2281) is used here for not only indicating the audio levels of the selected stereo channel, but also for forward biasing transistor T1. As soon as a specific threshold audio level is detected in a selected channel, pin 7 and/or pin ten of IC5 goes �low'. This low level is coupled to the base of transistor T1, through diode-resistor combination of D2-R1/D3-R22. As a result, transistor T1 conducts & causes output of IC1 to stay �low' (disabled) as long as the selected channel output exceeds the preset audio threshold level.
Presets VR2 & VR3 have been included for modification of individual audio threshold levels of left & right stereo channels, as desired. One time the multivibrator action of IC1 is disabled, output of IC2 does not modify further. Hence, searching through the channels continues until it receives an audio signal exceeding the preset threshold value. The skip switch S1 is used to skip a channel even if audio is present in the selected channel. The number of channels can be basically extended up to0, by using additional 4066 ICs.

intercom using transistors

The circuit comprises a 3-stage resistor-capacitor coupled amplifier. When ring button S2 is pressed, the amplifier circuit formed around transistors T1 & T2 gets converted in to an asymmetrical astable multivib-rator generating ring signals. These ring signals are amplified by transistor T3 to drive the speaker of earpiece.
Current consumption of this intercom is ten to 15 mA only. Thus a 9-volt PP3 battery would have a long life, when used in this circuit.
For making a two-way intercom, identical units, as shown in figure, are necessary to be used. Output of amplifier unit goes to speaker of the other unit, & vice versa. For single-battery operation, join corresponding supply & ground terminals of both the units together.
The entire circuit, along with microphone & earpiece etc, can be housed inside the plastic body of a cell phone toy, which is basically obtainable in the market. Suggested cell phone cabinet is shown.


Audio level meter

Audio level meter makes use of IC as well as a only a few number of outside parts. It displays the audio level in terms of ten LEDs. The input voltage can vary from 12V to 20V, but suggested voltage is 12V.

The LM3915 is a monolithic integrated circuit that senses analog voltage levels and drives0 LEDs providing a logarithmic seven dB/step analog display.(Audio level meter) LED current drive is regulated and programmable, eliminating the necessity for current limiting resistors.



The IC contains an adjustable voltage reference and an correct ten-step voltage divider.in Audio level meter The high-impedance input buffer accepts signals down to ground and up to within one.5V of the positive supply. Further, it needs no protection against inputs of ±35V. The input buffer drives ten individual comparators referenced to the precision divider.Audio level meter Accuracy is usually better than one dB.Audio level meter also.


 Audio level circuit meter is simple as it show.