Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Automatic room light controller

Status
Not open for further replies.

ycho

New Member
Hi All,

I need a help here. I am doing automatic room light controller as my fyp.
The circuit i got is using microcontroller and i plan to change it to PIC.
Can i change to PIC without modify the original circuit?
Another thing is i plan to change the two 7segments to a LCD.
Which part i should remove?
below is the circuit diagram
https://www.electro-tech-online.com/attachments/room-gif.38076/
thanks for the reply
 
Hi All,

I need a help here. I am doing automatic room light controller as my fyp.
The circuit i got is using microcontroller and i plan to change it to PIC.
Can i change to PIC without modify the original circuit?
Another thing is i plan to change the two 7segments to a LCD.
Which part i should remove?
below is the circuit diagram
https://www.electro-tech-online.com/attachments/room-gif.38076/
thanks for the reply

hi,
The program will have to be rewritten to suit a PIC.
The LED circuitry will have to be replaced using an LCD [ the re-written programme will require the LCD driver routines]

The IR detection circuit and the relay drive could be the same, make sure that the input pins match the PIC pins and program also the AT to PIC pin numbers/assignments need changing.

You are basically starting from the beginning, you could still use the AT algorithms but their coding will have to be changed to suit the PIC.
 
Last edited:
Hi ericgibbs

Thanks for the reply.
Basically i will rewrite the program.
For now i need to make sure my connection is correct before i write the program.
u said "The IR detection circuit and the relay drive could be the same, make sure that the input pins match the PIC pins " mean that there are specific pin for them?
cannot connect to any open port?
As for the LCD, can i remove pin27,32-37 and replace it to LCD?
And for the pin28 which is the connection for relay. Can i use back the same circuit?
Thanks again
 
Hi ericgibbs

Thanks for the reply.
Basically i will rewrite the program.
For now i need to make sure my connection is correct before i write the program.
u said "The IR detection circuit and the relay drive could be the same, make sure that the input pins match the PIC pins " mean that there are specific pin for them?
cannot connect to any open port?
You could any suitable port pin, providing that the re written program uses that port.
The AT pin assignment numbers may not match the PIC pin numbers.

As for the LCD, can i remove pin27,32-37 and replace it to LCD?
That again depends upon how you assign the PIC I/O pins in the PIC program

And for the pin28 which is the connection for relay. Can i use back the same circuit?
A PIC output pin could drive the transistor.
Thanks again

hi,
I would suggest that you draw out the circuit showing which PIC type and pin usage you plan to use, its difficult to comment until we know what you have in mind.

Which PIC programming language will you be using.?
 
An LED display and an LCD display are two completely different technologiew. Your final design will have to accommodate those differences. That means both in hardware and software (firmware). COMPLETELY DIFFERENT.
An LCD character display does not use the same circuitry as an LED display, so you will have to start from scratch with the display. You should first identify the LCD display that you want to use and then design the circuitry around its requirements. Without knowing the display's requirements, no one can say how to connect it to a PIC or microcontroller.

Cheers,
Dave M
 
Hi

I had draw out the circuit.
**broken link removed**
The part i not sure is about the receiver sensor. Can it connect to pin2 and pin3 of PIC?
Please help check the connection from LCD to PIC. The LCD pin match the PIC pin?
And lastly anyone of you familiar with relay circuitry? Below is the relay circuit that i designed
**broken link removed**.
Please have a look whether it can work on this project or not.
And i plan to connect the input to pin7 which is RA5. Can it work?

and for ericgibbs
I will be using C programming for the PIC.

thanks again for the reply
 
Last edited:
A couple of observations.
You could probably skip the 555 part and use the pair of comparators built into the 16F877A
Upgrade to a 16F887 and you can also skip the crystal.
Your relay driver looks fine, just be really careful when dealing with mains power.
 
I wouldn't be so quick to approve of the relay circuit.. While the circuit diagram itself looks OK, the transistor driving the LED and relay is a wimp, being rated at only 100ma. Best to use a transistor having (much) higher collector current rating, something around 1A or so. Just be sure that it has ample capability to drive both the relay coil and the LED.

Cheers,
Dave M
 
Hi

For Oldtechie
How about if i replace BC107 with a 2N2222? which having 800mA for collector current.

Basically my project worked like this,
when there is no people in the room, the light bulb will always off (Is that mean the (relay) common is point to NC? Since i connected light bulb to NO)
when there are people in the room, the receiver will sense it and send command to relay to light up the light bulb (For this state, the (relay) common will point to NO).
lastly, just wanna confirm that whether the fuse should connect like that (in between (relay) NO pin and light bulb)?
Or can i just remove the fuse? Straight away connect pin NO to light bulb? Is that work?



Thanks again for the reply
 
Last edited:
why get so complex?

if all you want to do is turn on a light using an IR sensor then just buy a IOR sensor light relay. no need for an LCD display (have yet to figure out why the display?)
I must have missed something??
a simple IR sensor is available from SURE ELECTRONICS. DC-SS015
I use thyis module in my CRITTER RIDDER for scaring away deer from ones garrden.
Very easy to include an LCD display but suggest using say an 18F1320
as for relay control, watch your relay coil draw and inmclude a diode to control coil flux but an FET would be my choice for switching dc.
 
I looked at you schematic. the LCD only needs 6 connections plus Vcc and Vdd
why the 55? not needed
 
another curious question ? why the two 555's
why the max232?
would help if you could explain in complerte detail what your end tresult is supposed to be???
also your schematic does not show, althought not required in finished project but makes life easier, is an ICSP header
 
here this should get you started

you can eliminate the 555's. may cause false triggering as the 555 is not a stable output frequency.
using the IR circuits in this link will limprove the circuit as well as simplify. go with the KISS method. will save lots of debuging headachs.
Infrared circuits for remote control by Peter JAKAB


now using two transmitters/ receivers for counting people in / out. first circuit that comes to mind - rotary encoder

can be very easy to use a pic (a pic is a micro controler)
using an 18F series pic then you have plenty of pins to use.
suggest using SWORDFISH to generate a code as there is lots of support on this site as well as digital-diy.com.
Swordfish has modules of code that make writing code pretty easy once you understand the basics.
and including a ICSP header will make programing easier. Saves pulling the chip each time you need to tweek the code.
I hopefully can post a suggested schematic by the weekend. my main computer with schematic/pcboard software as well as comp[lier are on my dead computer. parts are on their way (tracking says Salt Lake but 4 days later on a 3 day shipping I need to apply for a refund)
 
hi MrDEB,

May i ask about how far the transmitter can transmit for the transmitter that you provided. (i need at lease 1meter, for a person to pass through)
Infrared circuits for remote control by Peter JAKAB

And for the rotary encoder, i am not really sure how the thing works.
I plan to use PIC16F877A, the micro controller has 40pins. That more than enough for my project.
I am still no plan regarding the coding part. Will think about it once my hardware is done. (Will look for Swordfish as you recommend)
I think the idea of adding ICSP header is good.
I am looking forward for your suggested schematic.
Thanks a lot.
 
Last edited:
I still recommend using an 18Fxxxx pic as the 16F are not new plus Swordfish will only work on the newer than 16F pics, 18Fxxxx chips
the distance between transmitter to receiver is based on the distance the IR LED transmitter can transmit.
1 meter is ? how many feet. a door way is usually 3 feet or less.
another suggestion is to obtain an old tv remote then salvage parts for transmitter like the IR LED. if the beam is wide enought then only one LED may work.
 
hopefully decipher this

two IR sensors (in & out) named 1 & 2
if 1 and 2 are HIGH = no people in or out
if 1 goes LOW then 2 goes LOW while 1 goes back HIGH then person entering room, counter = 1
if 2 goes LOW then 1 goes LOW while 2 goes back HIGH then person leaving room counter = -1
if counter is <= 0 then lights out
if counter is >= 1 then lights on. read over the links I posted
all data is transmitted via UART or rs232 possably even the USB?
this project is really pretty simple. Once I get my main computer up again I will draw a schematic.
read up on using a pic micro controler..
parts needed= 2 - IR LEDs, 2 - IR detectors (see link I posted for part #'s)
an 18F1320, an 18 pin socket, 5 pin male header, couple of .01 capacitors, several 20k resistors (resistor assortment from rat shack, 1/4 watt) perfboard. chip for rs232 or just use the uart but not sure if uart can store data in pc?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top