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 / how to control room lights via pc and microcontroller

how to control room lights via pc and microcontroller

|

Microcontroller › AVR › how to control room lights via pc and microcontroller

  • This topic has 13 replies, 3 voices, and was last updated 14 years, 11 months ago by romel emperado.
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • May 7, 2011 at 9:36 am #908
    Aina
    Participant

    Hi,

     I am computer science student and i want to control the room lights via sms sent from remote mobile through gsm modem AT commands  sent to pc and is further forwarded to microcontroller. I want to use ATMEGA8 microcontroller that will switch lights on and off using one relay, but i have no idea how to interface relay and pc with microcontroller via serial port. Can any one send me the circuit diagram. Any kind of help will be appreciated.

     

    Thanks for help in advance.

    Regards,
    Aina

    May 8, 2011 at 3:36 am #6112
    dagakshay
    Participant

    link for serial interfacing in AVR

    http://www.engineersgarage.com/embedded/avr-microcontroller-projects/serial-communication-atmega16-usart

     

    Atmega8 interfacing with relay ckt

    wysiwyg_imageupload:1029:

     

    when you send logic low at PC0 the LED will be OFF and when you send logic high at PC the relay switch and the LED will glow. In your case instead of LED you can connect bulb/ tube light/ fan , etc. 

     

    nice project all the best

    May 8, 2011 at 6:09 am #6113
    Aina
    Participant

    Thanks for the help. The circuit diagram you sent for relay interfacing is clear  but serial interfacing circuit is bit confusing to me. Can you send me the schematic diagram of that?

     

    Regards,

     

    Aina

    May 9, 2011 at 5:13 am #6114
    dagakshay
    Participant

    i have pasted one link above… That link has given a nice explanation, code, video and ckt diagram too… which part has confused you in ckt diagram…..

    May 9, 2011 at 12:35 pm #6119
    Aina
    Participant

    yes its fine but i have never worked with circuits sort of things before this. So, i want to follow simplest approach for getting my work fulfilled. I have come to know that lights can be controlled  via pc by just using the circuit based on relays without microcontroller. Is it possible to interface this kind of circuit serially to control light??

    May 10, 2011 at 5:05 am #6124
    Aina
    Participant

    ok thanks. Can you send me some source codes??

    May 10, 2011 at 5:56 am #6127
    dagakshay
    Participant

    hello Aina,

    you can do that via a simple C programe too…. you just need to send the value on the parallel port  address using a outport function… do a bit of googling you will get it

    May 10, 2011 at 6:04 am #6128
    dagakshay
    Participant

    include

    #include<dos.h>

     

    in your hedder file…

     

    function to send value on parallel port

     

    outportb(0x378, <value>);

     

    <value> = is that value what you need to send on parallel port address… is should not be grater than a Byte

     

    ex: 

    outportb(0x378, 0x80);

     

    0x378 is the prallel port address and 0x80m is the hex value i need to send on parallel port

    May 10, 2011 at 1:13 pm #6134
    Aina
    Participant

    ok.thanks dagakshay can i use the following circuit diagram regarding my project?

     

    Here is the link:

     

    http://michael.hinespot.net/circuit.php

    May 10, 2011 at 1:41 pm #6137
    dagakshay
    Participant

    yes, you can. here i am pasting a ckt (edited on the link you send)….

    wysiwyg_imageupload:1037:

    here i had eliminated the need of diode, resistance and the NPN tansistor … instead of thatconncet a direct wire as i had did by using a green colour one… and above one a switch, instead of that use ULN 2003/ ULN 2008 IC… it a buffer IC as you cannt interface the peripherials directly to PC’s parallel port.. just for protection porpose…. and connect the diode in reverse fasion… make The ULN and prallel port ground common….don’t use the Vcc pin from prallel port.. apply VCC = relay voltage… the lengh of wire fron Parallel should not be greater then 1.4 meter… for safty keep it as 1.2m only…

     

    let me know till where you have completed

     

    May 11, 2011 at 7:08 am #6148
    Aina
    Participant

    Ok thanks a lot, it proved to be very helpful for me. I will try this but i have to ask one more thing that is it possible to attach sensor by modifying the given circuit for future work?? For example smoke sensor sensing whether there is smoke in surrounding environment or not??

    May 11, 2011 at 2:16 pm #6152
    romel emperado
    Participant

    actually you can by pass the use of PC if you have gsm modem and microcontroller… that two components will do your desired application

    May 12, 2011 at 7:13 am #6167
    dagakshay
    Participant

    @ Aina,

    yes you can. use status pins of parallel port

    May 13, 2011 at 12:23 am #6174
    romel emperado
    Participant

    paralled port is much easy that serial interfacing… go for it

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

RSS Recent Posts

  • SDCC Array Access In Timer 0 Interrupt Handler April 14, 2026
  • Voltage comparator circuit verification April 13, 2026
  • EasyEda program has a major bug April 13, 2026
  • Chatter April 13, 2026
  • understanding transmission line properties from TDR plot April 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