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

LASER SECURITY

|

Microcontroller › 8051 › LASER SECURITY

  • This topic has 1 reply, 2 voices, and was last updated 11 years, 2 months ago by Ashutosh Bhatt.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • April 4, 2014 at 12:22 pm #3017
    basharat
    Participant

    Sir,
     I have made laser security system using LM339(comprator) with AT89S51 but problem is that the when interrupt is accure to controller then the alram is 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);
    }
    }

    April 5, 2014 at 1:30 pm #11471
    Ashutosh Bhatt
    Participant

    first make alarm=0

    then when ur ldr becomes 0 – make it alarm = 1.

    dont make alarm = 0 aferwards

     

    when anyone presses manual reset the alarm will be 0 again

    #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)
    {

    alarm = 0

    while(ldr==1);

     

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

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

     

     

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

RSS Recent Posts

  • Behlke swich June 21, 2025
  • Simple LED Analog Clock Idea June 21, 2025
  • using a RTC in SF basic June 21, 2025
  • Can I make two inputs from one?? June 21, 2025
  • Help with finding unique wire lug(s) June 21, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 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