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 / IR sensor not working as expected in atmega 32

IR sensor not working as expected in atmega 32

|

Microcontroller › AVR › IR sensor not working as expected in atmega 32

  • This topic has 2 replies, 3 voices, and was last updated 13 years, 7 months ago by AJISH ALFRED.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • July 11, 2012 at 2:03 pm #1873
    SHUBHAM AGIWAL
    Participant

    hey friends i am trying to interface an ir sensor wih atmega 32 which gives a ttl output such that when an obsatcle is detected it glow the led. but sadly the led glows all the time. i want it to glow only when the obstacle is detected.

    here is the code

    #include
    #include

    void main()
    {
    DDRA=0xf0;// PA0 is the input
    // PA7 is the led pin

    while(1)
    {
    if(PINA & 0b00000001)
    {
    PORTA=0x80;
    _delay_ms(10);
    PORTA=0x00;
    _delay_ms(10);
    }
    }
    }

    July 11, 2012 at 3:25 pm #8238
    Amrith
    Participant

    Hi Subham,

    Kindly share your schematics to verify.

    July 11, 2012 at 8:38 pm #8247
    AJISH ALFRED
    Participant

     

    Please post your circuit diagram also.

  • 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

  • CR2/CR123A Batteries In Projects February 14, 2026
  • Integrating 0–5V ECU Signals into a Double-DIN Setup – Module vs Custom Head Unit? February 14, 2026
  • Puzzled about a relay February 13, 2026
  • Switch Circut February 13, 2026
  • RC Electronic Speed Control Capacitors February 13, 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