EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / LASER SECURITY USING LM339

LASER SECURITY USING LM339

|

Projects › Projects › LASER SECURITY USING LM339

  • This topic has 2 replies, 3 voices, and was last updated 12 years, 1 month ago by Ashutosh Bhatt.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • March 30, 2014 at 4:57 pm #3001
    basharat
    Participant

    Sir,
     I have made laser security system using LM339(comprator) with AT89S51 but problem is that the when interrupt is accure the alram on for short time
     pls send me c code in which alram will on until manualy reset it

    I am using following code

     

    #include<reg51.h>
    sbit alram=P2^2;
    sbit ldr =P3^2;
    void delay (unsigned char msec)
    {
    unsigned int i,j;
    for(i=0;i<msec;i++)
    for(j=0;j<1275;j++);
    }
    void main(void)
    {

    if(ldr==1)
    {
    alram=0;

    }
    else
    {
    alram=1;
    delay(2000);
    }
    }

                                                                                         

                                                                           Thank you

    March 30, 2014 at 5:34 pm #11422
    Ganesh Selvaraj
    Participant

    Please post your C code here so that we can suggest the necessary edits. Loooking from your problem, u have to change the delay time or add an infinite while loop in you interrupt service routine. For eg:

     

    ISR_function()

    {

       <switch on alarm>;

       while(1);

    }

     

    The above function will switch ON the alarm and go into and infinite loop out which the controller comes only after reset button is pressed.

    March 31, 2014 at 4:53 am #11427
    Ashutosh Bhatt
    Participant

    its very simple

    in main function switch off buzzer initially.

    in ur ISR just switch it ON. dont switch off.

    when reset is pressed manually again main function is called so buzzer will be off.

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • Phone Charger 5v to 12v May 17, 2026
  • reviving old swordfish program but? May 17, 2026
  • Assistance locating a 'trail' camera gadget, please ? May 16, 2026
  • Analog multiplexer has gone obselete May 16, 2026
  • Difference between TTL, RS232 and RS485 May 16, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise