Posts

Alien attack alarm 2

Image
By Sony Sodikin www.sodikinsony.blogspot.com This simple project is same with alien attack alarm 1 project before, but in this project a long-varied tones output is produced longer than project before. Circuit Diagram Program Listing /*********************************************************** Title : Alien attack alarm 2 Author : Sony Sodikin : http://www.sodikinsony.blogspot.com Date : February,2009 Processor : AT89C51 ***********************************************************/ #include #define SPEAKER P1_7 #define ON 0 #define OFF 1 void delay(int z) { unsigned int x; for(x=0;x } main() { int z; for(;;) { for(z=1;z { SPEAKER=ON; delay(z); SPEAKER=OFF; delay(z); } for(z=1000;z>=1;z--) { SPEAKER=ON; delay(z); SPEAKER=OFF; delay(z); ...

Alien attack alarm 1

Image
By Sony Sodikin www.sodikinsony.blogspot.com Have we, the human race back-engineered alien technology as a ways of ensuring that we would, at least, have a fighting chance if we were invaded by alien beings? Although we don’t have anti gravity technology, superior technology, and so on, don’t worry, I have made an Alien attack alarm to warn to you about it. This simple project is same with projects before. Circuit Diagram Program Listing /*********************************************************** Title : Alien attack alarm Author : Sony Sodikin : http://www.sodikinsony.blogspot.com Date : February,2009 Processor : AT89C51 ***********************************************************/ #include #define SPEAKER P1_7 #define ON 0 #define OFF 1 void delay(int z) { unsigned int x; for(x=0;x } main() { int z; for(;;) { for(z=1;z { SPEAKER=ON; delay(z); ...

Multi-Tones Simple Speaker Interface 2

Image
By Sony Sodikin www.sodikinsony.blogspot.com *****““Our main business is not to see what lies dimly at a distance, but to do what lies clearly at hand”****** This project shows how we can interface AT89C51 to a small speaker. In this project a continuous multi tones output are produced on the speaker. The speaker normally operates when an alternating signal is applied with the frequency in the audible range. The speaker is connected to bit 7 of port 1 via a PNP transistor and the speaker is ON when the output of the port is at logic HIGH. The program is written in SDCC. Circuit Diagram Program Listing /*********************************************************** Title : Multi-Tone Simple Speaker Interface Author : Sony Sodikin : http://www.sodikinsony.blogspot.com Date : February,2009 Processor : AT89C51 ***********************************************************/ #include #define SPEAKER P1_7 #define ON 0 #define...

Simple Speaker Interface 2

Image
By Sony Sodikin www.sodikinsony.blogspot.com *****““Our main business is not to see what lies dimly at a distance, but to do what lies clearly at hand”****** This project shows how we can interface AT89C51 to a small speaker. When a push-button switch is pressed, the speaker will turn on and off 3000 times (about 19 second) and then stop. The speaker normally operates when an alternating signal is applied with the frequency in the audible range. The speaker is connected to bit 7 of port 1 via a PNP transistor and the speaker is ON when the output of the port is at logic HIGH. The push-button switch is connected to bit 0 of port 3. The program is written in SDCC. Circuit Diagram Program Listing /*********************************************************** Title : Simple Speaker Interface 2 Author : Sony Sodikin : http://www.sodikinsony.blogspot.com Date : February,2009 Processor : AT89C51 ***************************...

Simple Speaker Interface 1

Image
By Sony Sodikin www.sodikinsony.blogspot.com *****““Our main business is not to see what lies dimly at a distance, but to do what lies clearly at hand”****** This project shows how we can interface AT89C51 to a small speaker. In this project a continuous single tone output is produced on the speaker. The speaker normally operates when an alternating signal is applied with the frequency in the audible range. The speaker is connected to bit 7 of port 1 via a PNP transistor and the speaker is ON when the output of the port is at logic HIGH. The program is written in SDCC. Circuit Diagram Program Listing /*********************************************************** Title : Simple Speaker Interface 1 Author : Sony Sodikin : http://www.sodikinsony.blogspot.com Date : February,2009 Processor : AT89C51 ***************...

3-10ms/step Stepper Motor Controller

Image
By Sony Sodikin www.sodikinsony.blogspot.com This is a simple stepper motor controller project. A stepper motor is connected to bit 0, 1, 2, and 3 of port 1 via four BD677 transistors. Eight push-button switches are connected to port 2 to select the required time per step (3 mili second per step – 10 mili second per step). Timer 0 is used to generate time delays. The program is written in MCS-51 family macro assembler. Circuit Diagram Program Listing ;*********************************************************** ; Title : 3-10ms/step Stepper Motor Controller ; Author : Sony Sodikin ; : http://www.sodikinsony.blogspot.com ; Date : April,2004 ; Processor : AT89C51 ;*********************************************************** org 0h mov tmod,#01H start: jnb P2.0,step_3ms ...

Red Cyclon Eye

Image
By Sony Sodikin http://www.sodikinsony.blogspot.com/ This project turns on the LEDs connected to port 0 of the microcontroller in sequence, making like a Cylon with the light bouncing back and forth. The data is displayed with about 1/2 second delay between each output pattern. If you don’t know what a Cylon is, try Googling Battlestar Galactica. Circuit Diagram Program Listing /*********************************************************** Title : red cyclon eye Author : Sony Sodikin : http://www.sodikinsony.blogspot.com Date : September,09,2008 Processor : AT89C51 ***********************************************************/ #include void delay(void) { int i; for(i=-32768 ; i } void main(void) { while(1) { int j; for(j = 1; j {P0 ...

Bouncing LED

Image
By Sony Sodikin http://www.sodikinsony.blogspot.com/ This project turns on the LEDs connected to port 0 of the microcontroller in sequence, making the led bouncing back and forth from low speed to high speed. The process is repeated indefinitely with variable delay time. Circuit Diagram Program Listing ;****************************************************************** ;* Title : Bouncing LED * ;* Author : Sony Sodikin * ;* : http://www.sodikinsony.blogspot.com * ;* Date : May 28,2008 * ;* Processor : AT89C51/AT89S51 (AT89CXXXX/AT89SXXXX) * ;****************************************************************** ...

Variation Blinking LED

Image
By Sony Sodikin http://www.sodikinsony.blogspot.com/ This project turns on the LEDs connected to port 0 of the microcontroller in sequence such that first only a led are off, bouncing back and forth, then only a led are on bouncing back and forth. The process is repeated indefinitely with 1 second delay between each output pattern. Circuit Diagram Program Listing /*********************************************************** Title : variation blinking led Author : Sony Sodikin : http://www.sodikinsony.blogspot.com Date : September,09,2008 Processor : AT89C51 ***********************************************************/ #include void delay(void) { int i; for(i=-32768 ; i } void main(void) { while(1) { int j; for(j = 1 ; j {P0 = j; ...

LED Chasing to Right

Image
By Sony Sodikin http://www.sodikinsony.blogspot.com/ This project turns on the LEDs connected to port 0 of the microcontroller in sequence, resulting in a chasing LED effect to right. The data is displayed with about 1 second delay between each output pattern. Circuit Diagram Program Listing /*********************************************************** Title : led chasing to right Author : Sony Sodikin : http://www.sodikinsony.blogspot.com Date : September,09,2008 Processor : AT89C51 ***********************************************************/ #include void delay(void) { int i; for(i=-32768 ; i } void main(void) { while(1) { int j; for(j = 128; j>1 ; j-=j/2) {P0 = ~j; delay(); } } ...

LED Chasing to Left

Image
By Sony Sodikin http://www.sodikinsony.blogspot.com/ This project turns on the LEDs connected to port 0 of the microcontroller in sequence, resulting in a chasing LED effect to left. The data is displayed with about 1 second delay between each output pattern. Circuit Diagram Program Listing /*********************************************************** Title : led chasing to left Author : Sony Sodikin : http://www.sodikinsony.blogspot.com Date : September,09,2008 Processor : AT89C51 ***********************************************************/ #include void delay(void) { int i; for(i=-32768 ; i } void main (void) { while(1) { int j; for(j = 1; j {P0 = ~j; delay(); } } ...

LED Binary Counter 2

Image
By Sony Sodikin http://www.sodikinsony.blogspot.com/ This project counts down in binary and displays the result on eight LEDs connected to port 0 of the microcontroller. The program written in SDCC is required to decrement a value and then output to port 0 of the microcontroller. The data is displayed with about 1 second delay between each output. Circuit Diagram Program Listing /*********************************************************** Title : led binary counter2 Author : Sony Sodikin : http://www.sodikinsony.blogspot.com Date : September,09,2008 Processor : AT89C51 ***********************************************************/ #include void delay(void) { int i; for(i=-32768 ; i } void main(void) { while(1) { int j; for(j = 255 ; j >= 0 ; j--) ...

LED Binary Counter 1

Image
By Sony Sodikin http://www.sodikinsony.blogspot.com/ This project counts up in binary and displays the result on eight LEDs connected to port 0 of the microcontroller. The program written in SDCC is required to increment a value and then output to port 0 of the microcontroller. The data is displayed with about 1 second delay between each output. Circuit Diagram Program Listing /*********************************************************** Title : led binary counter1 Author : Sony Sodikin : http://www.sodikinsony.blogspot.com Date : September,09,2008 Processor : AT89C51 ***********************************************************/ #include void delay(void) { int i; for(i=-32768 ; i } void main(void) { while(1) { int j; for(j = 0 ; j {P0 ...

CW-CCW-RUN-STOP controls with 4 LEDs (2)

Image
By Sony Sodikin http://www.sodikinsony.blogspot.com/ This project schematic is same with CW-CCW-RUN-STOP controls with 4 LEDs project schematic, but at this project, you are possible to change CW/CCW button have pressed as you want before RUN button to be-on (motor isbutton run). Example: You have pressed CW button, but you want By the motor run counter clockwise. So, you just press CCW button and then press RUN . Hardware Software Software flow chart Source code file in Full Step Mode ;**************************************************************** ;* Title : CW-CCW-RUN-STOP controls with 4 LEDs (2)* ;* in Full Step Mode * ;* Author : Sony Sodikin * ;* Last updated : 04. 03.14 * ;* Target : AT89C51/AT89S51 (AT89CXXXX/AT89SXXXX) * ;***********************************...

CW-CCW-RUN-STOP controls with 4 LEDs (1)

Image
By Sony Sodikin www.sodikinsony.blogspot.com This project is same with CW-CCW-RUN-STOP controls project, but it was added four LEDs. LEDs provide visual indication that are used to indicate clockwise, counter clockwise, run, and stop controls. Hardware Software Software flow chart Source code file in Full Step Mode ;**************************************************************** ;* Title : CW-CCW-RUN-STOP controls with 4 LEDs * ;* in Full Step Mode * ;* Author : Sony Sodikin * ;* Last updated: 04.03.14 * ;* Target : AT89C51/AT89S51 (AT89CXXXX/AT89SXXXX) * ;**************************************************************** org 0h start: ...

CW-CCW-RUN-STOP controls

Image
By Sony Sodikin http://www.sodikinsony.blogspot.com/ To run the motor in clockwise rotation, first step is press the CW switch and then press the RUN switch. To stop the motor, press the STOP switch. And so do in counterclockwise rotation, first step is press the CCW switch and then press the RUN switch. When we want to change direction while the motor is running, press the STOP switch, and then select the CW or CCW switch. Hardware Software Software flow chart Source code file in Full Step Mode ;**************************************************************** ;* Title : CW-CCW-RUN-STOP controls * ;* in Full Step Mode * ;* Author : Sony Sodikin * ;* Last updated: 04.03.14 * ;* Target : AT89C51/AT89S51 (AT89CXXXX/AT89SXXXX) * ;**************************************************************** org 0h start: jnb P2.0,start_cw ; cw option jnb p2.1,start_ccw ; ccw option sjmp start start_cw: jnb p2.2,step_cw ; run step cw sjmp start_cw start_ccw: jnb p2.2,step_ccw ; run step ccw sjmp start_cc...

Clockwise/counterclockwise direction control with 2 switch (2)

Image
By Sony Sodikin http://www.sodikinsony.blogspot.com/ In this project, the CW switch used to control CW rotation is connected to P2.0 and the CCW switch used to control CCW rotation is connected to P2.1. When the CW switch is pressed, the motor will run in clockwise rotation and when its switch is released (not pressed) the motor still run. When the CCW switch is pressed, the motor will run in counter clockwise rotation and when its switch is released (not pressed) the motor still run. If the motor is running in clockwise rotation, by pressing CCW switch will make the motor runs in counterclockwise rotation. If the motor is running in counterclockwise rotation, by pressing CW switch will make the motor runs in clockwise rotation. Hardware Software Software flow chart Source code file in Full Step Mode ;**************************************************************** ;* Title : CW/CCW direction control with 2 sw (2) * ;* ...

Clockwise/counterclockwise direction control with 2 switch (1)

Image
By Sony Sodikin http://www.sodikinsony.blogspot.com/ In this project, the CW switch used to control CW rotation is connected to P2.0 and the CCW switch used to control CCW rotation is connected to P2.1. When the CW switch is pressed, the motor will run in clockwise rotation and when its switch is released (not pressed) the motor will stop. When the CCW switch is pressed, the motor will run in counter clockwise rotation and when its switch is released (not pressed) the motor will stop. Hardware Software Software flow chart Source code file in Full Step Mode ;**************************************************************** ;* Title : CW/CCW control with 2 sw (1) * ;* in Full Step Mode * ;* Author : Sony Sodikin * ;* : www.sodikinsony.blogspot.com * ;* Last updated : 04.03.14 * ;* Target : AT89C51/AT89S51 (AT89CXXXX/AT89SXXXX) * ;**************************************************************** org 0h start: jnb P2.0,step_cw jnb p2.1,step_ccw sjmp start step_cw: mov P1,#11111110b ; CW step...

Clockwise/counterclockwise direction control with 1 switch

Image
By Sony Sodikin http://www.sodikinsony.blogspot.com/ This is the project for the clockwise rotating or the counter clockwise rotating a unipolar stepper motor. One push button switch connected to P2.0 is used to control clockwise or counter clockwise rotation. Clockwise rotation occurs when P2.0 input is a logic “high” level, and counterclockwise rotation occurs when it is “low”. These mean when switch is pressed the motor will run in clockwise rotation and when switch is released (not pressed) it will run in counter clockwise rotation. Hardware Software Software flow chart Source code file in Full Step Mode ;****************************************************************** ;* Title : Clockwise and counter clockwise control * ;* with 1 switch in full step mode * ;* Author : Sony Sodikin * ;* www.sodikinsony.blogspot.com * ;* Last updated : 04.03.15 * ;* Target : AT89C51/AT89S51 (AT89CXXXX/AT89SXXXX) * ;****************************************************************** org 0h start: jb...

Simple program to control Unipolar Stepper Motor

Image
By Sony Sodikin http://www.sodikinsony.blogspot.com/ 1. Full Step mode 1.1 Software flow chart 1.2 Source code file 2. Alternate Full Step mode 2.1 Software flow chart 2.2 Source code file 3. Half Step Mode 3.1 Software flow chart 3.2 Source code file