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 / 8051 measures opening and closing time for a switch

8051 measures opening and closing time for a switch

|

Microcontroller › 8051 › 8051 measures opening and closing time for a switch

  • This topic has 1 reply, 1 voice, and was last updated 12 years, 9 months ago by HallBrooks.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • May 10, 2013 at 6:45 pm #2393
    HallBrooks
    Participant

    Hello everyone,

     

    I’m learning the 8051 microcontroller and i want to do a small project.

    What i want is to connect a N.C switch to a port fro example P1.1.

    When i press the switch, it will open and when i press for a second time the switch will close.

     

    So i want the 8051 calculate the time during the switch was opened and vice et versa for closing.

     

    Can someone guide me how can i start this small example.

    I want to do it in embedded c.

     

    Thank yo for your support

    HallBrooks

     

    May 14, 2013 at 1:35 pm #9749
    HallBrooks
    Participant

    Thank you for your reply.

    i recognize for a beginner it’s very difficult.

    So i will try to explain this project:

     

    it can be used as door sensor monitoring.

    So when the door is open 8051 must start a timer and count in seconds or ms etc…

    and when the door is closed 8051 must stop the timer and in the LCD the time can be displayed.

     

    that’s all for this moment.

     i’m trying to study this….

     

    Thank you

  • 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

  • RC Electronic Speed Control Capacitors February 17, 2026
  • Annex32 / Annex RDS For ESP Micros - A Quick and Dirty Example February 16, 2026
  • Convenient audio FFT module? February 16, 2026
  • CR2/CR123A Batteries In Projects February 16, 2026
  • Harman Kardon radio module BMW noise February 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