Tuesday, 12 August 2014

Phone Busy Indicator
Have you ever been using the modem or fax and someone else picks up the phone, breaking the connection? Well, this simple circuit should put an end to that. It signals that the phone is in use by lighting a red LED. When the phone is not in use, a green LED is lit. It needs no external power and can be connected anywhere on the phone line, even mounted inside the phone. Note: This circuit may cause problems for some when used. You may want to build a different circuit.
Schematic




Parts:

Part
Total Qty.
Description
Substitutions
R1
1
3.3K 1/4 W Resistor
R2
1
33K 1/4 W Resistor
R3
1
56K 1/4 W Resistor
R4
1
22K 1/4 W Resistor
R5
1
4.7K 1/4 W Resistor
Q1, Q2
2
2N3392 NPN Transistor
BR1
1
1.5 Amp 250 PIV Bridge Rectifier
LED1
1
Red LED
LED2
1
Green LED
1. This is a very simple circuit and is easily made on a perf board and mounted inside the phone.
2. LED1 and LED2 flash on and off while the phone is ringing.
3. Do not worry about mixing up the Tip and Ring connections.
4. The ring voltage on a phone line is anywhere from 90 to 130 volts. Make sure no one calls while you are making the line connections or you'll know it. :-)
5. In some countries or states you will have to ask the phone company before you connect this to the line. It might even require an inspection.
6. If the circuit causes distortion on the phone line, connect a 680 ohm resistor in between one of the incoming line wires and the bridge rectifier.


http://www.hubcity.net





Nite Rider Lights




As a keen cyclist I am always looking for ways to be seen at night. I wanted something that was a novelty and would catch the motorists eye. So looking around at my fellow cyclists rear lights, I came up with the idea of 'NITE-RIDER'. NINE extra bright LED's running from left to right and right to left continuously. It could be constructed with red LEDs for use on the rear of the bike or white LED's for an extra eye catcher on the front of the bike.

All IC's are CMOS devices so that a 9V PP3 battery can be used, and the current drawn is very low so that it will last as long as possible.


The circuit comprises of ...

1 555 timer IC4.
1 4027 flip flop IC1.
2 4017 Decade Counter IC2 and IC3.
3 4071 OR gate IC5, IC6 and IC7.
1 470 Ohm resistor 1/4 watt R3.
2 10K resistors 1/4 watt R1 and R2.
1 6.8UF Capasitor 16V C1.
9 Super brght LED's 1 to 9.
1 9V PP3 Battery.
1 single pole switch SW1.
1 Box.

How The Circuit Works.

IC4, C1, R1 and R2 are used for the clock pulse which is fed to both the counters IC2 and IC3 Pin 14.

IC1 is a Flip Flop and is used as a switch to enable ether IC2 or IC3 at pin 13.

IC7a detects when ether IC2 or IC3 has reached Q9 of the counter pin 11.

IC5, IC6 and IC7a protects the outputs of the counters IC2 and IC3 using OR gates which is then fed to the Anodes of the
LED's 1 to 9.















http://www.hubcity.net

Motorola Hi-Fi power amplifier
This is a very simple, low cost, Hi-Fi quality power amplifier. You can build it 5 ways, like its shown in the table (from 20 W to 80 W RMS).
Some comments:
- The first thing that you must do, is to measure the end transistors (T3 and T4) amplifying coefficient, the hfe or β. If their disagreement is bigger than 30 %, the amplifier would not give a clear sound. I used MJ3001 and MJ2501 transistors, and this disagreement was around 5%.
- Before the first “turning on” you must short circuit the inputs of the amp, and put a mA-meter on the output, than turn the amplifier on, and tune the R13 pot, to decrease the DC current on the output, to some uA-s, or in a lucky situation to zero. I was able to decrease it to 10 uA.



 
This amplifier can be used as a stereo or mono power amplifier. Used as a stereo amplifier this will deliver a solid 60 Watts per channel or in mono mode will deliver 110 Watts (8 ohms). With PSX-R up...
Our monobloc power amp provides the ultimate system performance. Cyrus designed Zero-feedback technology and bespoke power supply componentry provides a massive 150watt burst power for truly enthralli...
<sub3< sub="">
</sub3<>
-
It gives a very good sound quality.


http://www.hubcity.net




Motorcycle Universal Gear Indicator
This is a new design for a universal gear indicator that can be fitted to any motorcycle as an aftermarket accessory. Its main advantage is that its operation depends entirely on the gear shift lever movement, instead of connecting to speedometer and tachometer sensors (found in expensive commercial devices), which are rarely available in older motorcycles. It consists of a main circuit including a 7‑segment LED indicator, two Hall sensors that are attached to the motorcycle frame, and a small magnet placed on the gear shift lever.
The main circuit is based on an AVR ATTINY25/45/85 microcontroller, which reads the signals of the two Hall sensors and the neutral switch and outputs the current gear number to a 7‑segment LED indicator, through a 4026 counter/decoder.
At maximum output power there is significant heat produced by IC1 and for that reason we mounted it directly on the ground plane to achieve maximum heat radiation.


Source Code
The source code is written in AVR-GCC (WinAVR) and can be programmed with the default fuses using an AVR programmer (default : ATTINY25 microcontroller and USBTiny programmer). Moreover, the constant TOP_GEAR 5 should be changed to 6 for six-gear motorbikes.
PCB Design
The suggested implementation for the main circuit is a small size, double-sided PCB, with SMD packages for the microcontroller and the decoder ICs. The 7-segment LED is placed in a secondary PCB, connected vertically to the main one in a modular fashion (see pictures). Two PCBs for different Kingbright LED footprints (red and blue) are also provided.
Parts List
Part
Value
Comments (for suggested PCB)
R1
10 to 220 Ω ½W
Depending on preferred LED brightness
R2, R3
10 ΚΩ ¼W

C1
220 μF / 35V
Electrolytic capacitor
C2
100 nF
MKT/polyester capacitor
MCU
ATTINY25/45/85
Mouser Part 556-ATTINY25-20SU
COUNTER
4026
Mouser Part 595-CD4026BPWE4
IC1, IC2
Hall sensor
Melexis US5881LUA (available from adafruit)
IC3
7805
5V Regulator TO-220
BLUE
Kingbright 0.3"
Mouser part 604-SC03-11PBWA/A
RED
Kingbright 0.3"
Mouser part 604-SC03-12EWA
JPx
Pin connectors
As shown in silkscreen and pictures

Possible improvement
In the current design, when the neutral switch is open (there is a gear on), there appears to be a very small current (< 0.5 mA) sinking through R3, due to the voltage difference between the neutral switch connection (TO_POWER-4) and the microcontroller. If the neutral indicator is of LED type (not a resistor bulb), there is a possibility that it stays dimmed, instead of being completely off. In that case, a small switching diode (1N4148) can nicely replace R3 (on the same PCB) in order to block this small incoming current when the neutral switch is open, as shown in the figure below :
http://www.electronics-lab.com/projects/automotive/006/Image_15.png
$ 1 5.0E-6 10.20027730826997 62 5.0 50
R 192 96 192 48 0 0 40.0 5.0 0.0 0.0 0.5
R 512 96 512 48 0 0 40.0 12.0 0.0 0.0 0.5
r 192 96 192 176 0 10000.0
x 231 142 309 145 0 12 internal pullup
x 125 25 277 31 0 24 Gear Indicator
x 456 26 571 32 0 24 Motorcycle
M 192 176 96 176 0 2.0
x 65 157 118 160 0 12 AVR Input
w 192 176 192 256 0
162 512 96 512 160 1 2.1024259 1.0 0.0 0.0
r 512 160 512 256 0 470.0
d 512 320 512 400 1 0.805904783
x 413 388 499 391 0 12 protective diode
s 512 400 640 400 0 1 false
g 640 400 640 448 0
x 539 422 615 425 0 12 neutral switch
x 309 240 391 246 0 24 1N4148
x 132 377 269 380 0 12 in place of R3, and watch
d 304 256 400 256 1 0.805904783
r 304 336 400 336 0 10000.0
x 337 371 367 377 0 24 R3
S 192 320 272 320 0 1 false 0
w 192 256 192 320 0
w 304 256 272 256 0
w 272 256 272 304 0
w 304 336 272 336 0
w 400 256 400 304 0
w 400 304 448 304 0
w 400 336 400 304 0
w 448 304 512 304 0
w 512 304 512 320 0
w 512 304 512 256 0
x 131 359 276 362 0 12 flip switch to insert a diode
x 134 394 272 397 0 12 current drop to zero when
x 134 412 254 415 0 12 neutral switch is open
Connections
A successful circuit build will do a self-test when connected solely to 12V power (pins TO_POWER_1 and TO_POWER_2), by cycling through all digits on the 7-segment display (see video below). After the self-test, the current gear will be shown and can be changed by the shift lever movement. Note that a gear is changed when the magnet's south pole is drawn away from the sensor (north pole will not work). Moreover, if a neutral gear is detected (from the neutral switch connected to TO_POWER_4), the display resets to zero (also acting as a self-calibrating feature if anything goes wrong). Finally, when the power is turned off, the last shown gear is stored in the MCU's flash EEPROM and restored when the device is turned on again.






Interfacing hex keypad using 8051


x keypad.
Hex key pad is essentially a collection of 16 keys arranged in the form of a 4×4 matrix. Hex key pad usually have keys representing numerics 0 to 9 and characters A to F. The simplified diagram of a typical hex key pad is shown in the figure below.
Hex keypad
The hex keypad has 8 communication lines namely R1, R2, R3, R4, C1, C2, C3 and C4.  R1 to R4 represents the four rows and C1 to C4 represents the four columns. When a particular key is pressed the corresponding row and column to which the terminals of the key are connected gets shorted. For example if key 1 is pressed row R1 and column C1 gets shorted and so on. The program identifies which key is pressed by a method known as column scanning. In this method a particular row is kept low (other rows are kept high) and the columns are checked for low. If a particular column is found low then that means that the key connected between that column and the corresponding row (the row that is kept low) is been pressed. For example if  row R1 is initially kept low and column C1 is found low during scanning, that means key 1 is pressed.

Interfacing hex keypad to 8051.
The circuit diagram for demonstrating interfacing hex keypad to 8051 is shown below.Like previous 8051 projects, AT89S51 is the microcontroller used here. The circuit  will display the character/numeric pressed on a seven segment LED display. The circuit is very simple and it uses only two ports of the microcontroller, one for the hex keypad and the other for the seven segment LED display.



Interfacing hex keypad to 8051
 The hex keypad is interfaced to port 1 and seven segment LED display is interfaced to port 0 of the microcontroller. Resistors R1 to R8 limits the current through the corresponding segments of the LED display. Capacitors C1, C2 and crystal X1 completes the clock circuitry for the microcontroller. Capacitor C3, resistor R9 and push button switch S1 forms a debouncing reset mechanism.
Program.
ORG 00H
MOV DPTR,#LUT // moves starting address of LUT to DPTR
MOV A,#11111111B // loads A with all 1's
MOV P0,#00000000B // initializes P0 as output port

BACK:MOV P1,#11111111B // loads P1 with all 1's
     CLR P1.0  // makes row 1 low
     JB P1.4,NEXT1  // checks whether column 1 is low and jumps to NEXT1 if not low
     MOV A,#0D   // loads a with 0D if column is low (that means key 1 is pressed)
     ACALL DISPLAY  // calls DISPLAY subroutine
NEXT1:JB P1.5,NEXT2 // checks whether column 2 is low and so on...
      MOV A,#1D
      ACALL DISPLAY
NEXT2:JB P1.6,NEXT3
      MOV A,#2D
      ACALL DISPLAY
NEXT3:JB P1.7,NEXT4
      MOV A,#3D
      ACALL DISPLAY
NEXT4:SETB P1.0
      CLR P1.1
      JB P1.4,NEXT5
      MOV A,#4D
      ACALL DISPLAY
NEXT5:JB P1.5,NEXT6
      MOV A,#5D
      ACALL DISPLAY
NEXT6:JB P1.6,NEXT7
      MOV A,#6D
      ACALL DISPLAY
NEXT7:JB P1.7,NEXT8
      MOV A,#7D
      ACALL DISPLAY
NEXT8:SETB P1.1
      CLR P1.2
      JB P1.4,NEXT9
      MOV A,#8D
      ACALL DISPLAY
NEXT9:JB P1.5,NEXT10
      MOV A,#9D
      ACALL DISPLAY
NEXT10:JB P1.6,NEXT11
       MOV A,#10D
       ACALL DISPLAY
NEXT11:JB P1.7,NEXT12
       MOV A,#11D
       ACALL DISPLAY
NEXT12:SETB P1.2
       CLR P1.3
       JB P1.4,NEXT13
       MOV A,#12D
       ACALL DISPLAY
NEXT13:JB P1.5,NEXT14
       MOV A,#13D
       ACALL DISPLAY
NEXT14:JB P1.6,NEXT15
       MOV A,#14D
       ACALL DISPLAY
NEXT15:JB P1.7,BACK
       MOV A,#15D
       ACALL DISPLAY
       LJMP BACK

DISPLAY:MOVC A,@A+DPTR // gets digit drive pattern for the current key from LUT
        MOV P0,A       // puts corresponding digit drive pattern into P0
        RET

LUT: DB 01100000B // Look up table starts here
     DB 11011010B
     DB 11110010B
     DB 11101110B
     DB 01100110B
     DB 10110110B
     DB 10111110B
     DB 00111110B
     DB 11100000B
     DB 11111110B
     DB 11110110B
     DB 10011100B
     DB 10011110B
     DB 11111100B
     DB 10001110B
     DB 01111010B
     END
About the program.
Firstly the program initializes port 0 as an output port by writing all 0′s to it and port 1 as an input port by writing all 1′s to it. Then the program makes row 1 low by clearing P1.0 and scans the columns one by one for low using JB instruction.If column C1 is found low, that means 1 is pressed and accumulator is loaded by zero and DISPLAY subroutine is called. The display subroutine adds the content in A with the starting address of LUT stored in DPTR and loads A with the data to which the resultant address points (using instruction MOVC A,@A+DPTR). The present data in A will be the digit drive pattern for the current key press and this pattern is put to Port 0 for display. This way the program scans for each key one by one and puts it on the display if it is found to be pressed.

http://www.hubcity.net






Interfacing dot matrix LED display to 8051Using microcontroller.

LED dot matrix display.
An LED dot matrix display consists of a matrix of  LED’s arranged in a rectangular configuration. The desired character or graphics can be displayed by switching ON /OFF  a desired configuration of LED’s. Common display configurations available are 7×5, 8×8, 7×15, etc. LED dot matrix can be used in simple display applications where the resolution is not a big concern.  The figure below shows the arrangement of LEDs in a typical 7×5 dot matrix display.
7x5 Led dot matrix display
Any individual LED or a group of LEDs in the matrix can be activated by switching the required number of rows and columns. For example, in the above figure if  Row1 is made high and Column1 is made low, the top left LED (address R1C1) will glow. As a demonstration, lets see how we can display letter “A” using the display. The tables given below shows the logic levels at each pin  for displaying A.

In the above diagram you can see that only one LED in a row will be ON at a time but any number of  LEDs in a column can be ON at a time.  That means the microcontroller’s port pin can directly drive a row but it requires  additional circuit for driving the column lines.  The circuit diagram for interfacing dot matrix display and 8051 microcontroller is shown below.
Circuit diagram.


ULN2003A driver IC.
The purpose of ULN2003A here is to drive the column lines of the display. ULN2003A is a high voltage (50V), high current (500mA per channel) darlington transistor array. Each IC has 7 channels with individual output clamp diodes. ULN2003A  an active high device, which means a logic high must be applied to the input  to make the corresponding output high. The input pins are designated as 1B, 2B, 3B, 4B, 5B, 6B, 7B while corresponding output pins are designated as 1C, 2C, 3C, 4C, 5C, 6C, 7C.  The pin configuration and simplified internal logic of ULN2003A is shown in the figure below.
Program
ORG 00H
MOV P3,#00000000B        // initializes port 3 as output port
MOV P1,#00000000B        // initializes port 1 as output port
MAIN: MOV P3,#01111110B
      MOV P1,#11111110B
      ACALL DELAY
      MOV P3,#00010001B
      MOV P1,#11111101B
      ACALL DELAY
      MOV P3,#00010001B
      MOV P1,#11111011B
      ACALL DELAY
      MOV P3,#00010001B
      MOV P1,#11110111B
      ACALL DELAY
      MOV P3,#01111110B
      MOV P1,#11101111B
      ACALL DELAY
      SJMP MAIN         // jumps back to the main loop
DELAY: MOV R6,#255D     // 1ms delay subroutine
HERE: DJNZ R6,HERE
      RET
END


http://www.hubcity.net