Thursday, July 26, 2012

Random number generator using 8051

Random number generator using 8051.

A  random number generator using 8051 that  displays a random number between 0 & 99 is shown in this article. The circuit it self is very simple and may not find any applications in serious embedded projects and this article is just an illustration. The circuit is based on AT89S51 microcontroller, two seven segment LED displays, two transistors and few passive components.

Circuit diagram.

random number generator using 8051

Random number generator using 8051

The two seven segment LED displays are multiplexed together and their data lines are connected to Port0  of the microcontroller. Transistors Q1 and Q2 drives the corresponding displays D1 and D2. The driving signals for there transistors are obtained from P1.1 and P1.2. Push button switch S1,capacitor C1 and resistor R10 forms a debouncing reset circuit. Resistor R9, capacitor C2 and pushbutton switch S2 will provide an active low harware  interrupt signal at INTO (pin12) when ever S2 is pressed. Here also R9 and C2 are meant for debouncing. After power ON the display will show blank and when push button S2 is pressed the display will show a random number between 0 and 99. For another try you have to press the reset switch and then switch S2. If you need a single digit setup only, the remove display D2 and its associated components. Everything else is same.


ORG 000H
ORG 003H // sets the starting address for the ISR
ACALL ISR // calls the ISR subroutine when S2 is pressed
RETI // return from interrrupt

MAIN:SETB IP.0 // this part sets the initial conditions
MOV P0,#00000000B
MOV P1,#00000000B
MOV DPTR,#LUT // moves the starting address of LUT to DPTR

LABEL:MOV R6,#99D // this part generates the random number

ISR: MOV A,R6 // Subroutine ISR displays the current random number
MOV B,#10D
CLR P1.2
CLR P1.1

DELAY: MOV R3,#02H // this subroutine creates 1mS delay for switching the displays

DISPLAY: MOVC A,@A+DPTR // produces the digit drive pattern for the current digit in A

LUT: DB 3FH // Look up table
DB 06H
DB 66H
DB 07H

About the program.

The first part of the program is the portion labelled MAIN which sets the initial conditions and the interrupt parameters. The next part is the loop named LABEL which loads 99D to register R6  then decrements it by 1 until 0 and then repeats the cycle again. This is the part which generates the random number. Every time R6 is decremented the resultant value is moved to accumulator A. Next part is the interrupt service routine which is written as a subroutine named ISR. When ever there is an interrupt at INT0 (push button S2 is pressed), the ISR is called. The ISR perfoms necessary mathematical manipulations on the content of A in order to split out the two digits and then proceeds to show it on the display. Subroutine DELAY produces roughly 1ms delay for switching the displays. Subroutine DISPLAY adds the current value in A with the address stored in DPTR (starting address of LUT) and moves the target content to A. The result will be the digit drive pattern for the current digit in A.
read more

Wednesday, July 18, 2012

Amplifier audio small to use with 9V battery operated

This is an audio amplifier that can be used with a small 9 volt Battery Operated,Current use as little as 5 milliamps.And amplification up to 500 mW.
Which is sufficient to expand the sound from a sound about or the CD Walk Man out to the small speakers clearly.
When entering the power supply 9-volt circuit IC1 number LM386 amplifier IC size is 300-800 mW, Depending on the power supply circuit with,This is from 4-15 volts.

Once entered into the input pin 3,The non inverting pin to amplifier non-return phase.C1 will be served cut out the noise input to ground.And C2 increases the rate of amplifier,C2 is to add more value.But if the C2 Too much distortion (the C2 should not exceed 100uF).The output of IC1 is out of the pin 5 through C4 coupling audio signals to better and DC block and not passed to the speaker.For the audio portion will also be fed back through R2 and C3 to the high frequency response better.
Next circuit ideals that use LM386 IC.

Amplifier 500 mW with ic LM386N

This circuit number LM386 IC is used as the IC, which is popular is that it has. It is a simple circuit. Less equipment items. Suitable for use or used in small trials.
The properties of the IC can be used from 4V-12V power supply for low current at 50 mA only. And the frequency response from 40Hz รข€“ 100 kHz rate of expansion of 46 dB and distortion.
Less than 1%.
Amplifier 500 mW with ic LM386N
When entering the power supply light LED1 circuit to tell the operating environment of the circuit. C6 and C7, with a page filter to smooth then be entered through one input sound signal.
C1 coupling signal protection dc voltage noise in circuit to the sound signal that is transmitted through VR1 for controller level reputation of sound signal and then sent to the input to pin 3 of IC1.
boost up output at pin 5 through C5 for protection dc voltage and meet the low frequency better and send out put speakers. The C4 and R1 is acting eliminate noise signal out and the pin 1 of IC will have a jumper for. to access the C3 to boost up rate increase in case the circuit to be used to boost up signal is very small.

Small audio amplifier IC 7w using lm383

This circuit, will help expand the sound small. such as radio, sound out, including CD WALKMAN. To the more powerful sound.The amplifier circuit can be up to 7 watts. Enough to use a good listening room.And most importantly is a very simple circuit.
Small audio amplifier IC 7w using lm383
Operation of the circuit. be Input signal is coupling with the C1.Passed into the pin 1 of IC1 number LM383. Amplifier output from the pin 4.Through C3 increase in low frequency stability better, before leaving to the speaker. The R2 and R3 set the gain 100 times. Which is calculated from the (R3/R4) +1.The C2 functions help in frequency response.
read more

Friday, July 6, 2012

1 Watt QRP Power Transmitter

1 Watt QRP Power Transmitter

The 1 watt 20 meter QRP transmitter with VXO. This is a nice QRP transmitter that can be used in combination of one of the simple receivers. Normally these designs have only two transistors: one is the X-tal oscillator and the second the final amplifier. A good example is my first QRP rig that is also described somewhere on this site. Here the VXO (Variabele X-tal Oscillator) has a tuning range of 16 kHz. This VXO is buffered with an extra driver stage for a better frequency stability and a varicap diode is used instead of a variabele capacitor. An extra transistor is added for keying the transmitter with a low keying current. What you can do with such a simple 1 watt QRP power transmitter. This is a real low power transmitter, so do not expect that you can do everything with it but... When conditions are normal, you can easily make many QSO's during one afternoon with stations with distances upto 2000 km with a simple inverted V wire dipole antenna! From Europe, I did even make QSO's across the Ocean!
read more

Automatic detectors water tank pump circuit

This is a circuit detectors on the water pump. This circuit works automatically when the water is discharged to storage tanks or redundant. If the storage tank water runs out then the circuit will work running the pump, and an excess of water this circuit will automatically stop the pump working. Below the detection circuit:

Automatic detectors water tank pump
Automatic detectors water tank pump schematic diagram

R1                   10K ohms resistor
R2                   10K ohms resistor
R3                   10K ohms resistor
R4                   1K ohms resistor
R5                   10K ohms resistor
R6                   1K ohms resistor
C1                   100nF cap
Led1                5mm green led
Led2                5mm red led
D1                   4V7 zener diode
Piezo               Piezo HPE-120
VR1                78L05 regulator
IC1                  12F683 SOIC microcontroller from Microchip
S1                    Push button
9V battery
Metal strips
Hex program for the microcontroller
read more