lighting control (help plaese) to every one

Post your requests and ideas on the future development of mikroC.
Author
Message
morad21_9
Posts: 8
Joined: 09 Jun 2008 13:33

lighting control (help plaese) to every one

#1 Post by morad21_9 » 06 Sep 2008 08:35

Hi , How are you every body, I need your helps please. I have small project and this the first time use PIC and I realy need your helps to program the PIC16F84 by C language. I'll be appreciate for this help.

Disceiption:
I want to control 3 lamps inside a room according to the number of the person who enters or exit from the room,I have 2 infrared sensors, when someone cut one of the two signals the microcontroller will account how many time the signal already cut. one IR will be to account how many person entered to the room and the other IR to account how many person exit of the room.

Methodology:
1- enter the room
1 person to 3 persons: turn on 1 lamp
4 persons to 5 persons: turn on 2 lamps
6 persons and above : turn on 3 lamps
2- exit of the room
for example the current state is 6 persons inside the room
1 t0 2 persons exit: turn on 2 lamps
3 to 5 persons exit: turn on 1 lamp


I'm waiting your reply as soon as posible
thank you

Morad

vukboban
Posts: 7
Joined: 27 Sep 2007 20:05

#2 Post by vukboban » 27 Sep 2008 10:27

just out of curiosity,how would IR sensor know if a person entered or left the room?

morad21_9
Posts: 8
Joined: 09 Jun 2008 13:33

#3 Post by morad21_9 » 28 Sep 2008 21:21

when someone cut the signal

ascomm
Posts: 129
Joined: 30 Mar 2005 18:28
Location: Finland

#4 Post by ascomm » 29 Sep 2008 17:27

morad21_9 wrote:when someone cut the signal
Yes but how it can separate the situations when someone is
a) Entering the room
b) Leaving the room?
char *signature;
signature = "MikroC Pro and EasyPIC 2";

morad21_9
Posts: 8
Joined: 09 Jun 2008 13:33

#5 Post by morad21_9 » 30 Sep 2008 21:16

when the output of the sensor become Zero, so the situation changed from 1 to 0.

idakota
Posts: 334
Joined: 27 Sep 2006 08:07
Location: Pretoria/South Africa
Contact:

#6 Post by idakota » 01 Oct 2008 07:21

but how do you tell if a 1 is someone entering or leaving?

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

#7 Post by Dany » 01 Oct 2008 08:11

idakota wrote:but how do you tell if a 1 is someone entering or leaving?
Are the "Enter" and "Exit" points of the room not separated? If not, you can not tell the difference.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

arcom
Posts: 271
Joined: 07 Dec 2007 17:00
Location: Rijeka/Croatia
Contact:

#8 Post by arcom » 01 Oct 2008 14:50

With 2 IR sensors you can easily find out if someone has entered or left the room. Say you have sensor A and sensor B:

- a person enetring the room will first set off sensor A and then B
- a person leaving the room will first set off sensor B and then A

Quadrature encoding comes to mind :)

morad21_9
Posts: 8
Joined: 09 Jun 2008 13:33

#9 Post by morad21_9 » 02 Oct 2008 06:19

thanks Arcom this is my idea you got it, but can you make a program to do it?

idakota
Posts: 334
Joined: 27 Sep 2006 08:07
Location: Pretoria/South Africa
Contact:

#10 Post by idakota » 02 Oct 2008 07:29

I can make a program that can do it quite easily.

The question is: Can you (morad21_9) make a program that can do it? We won't write one for you.

morad21_9
Posts: 8
Joined: 09 Jun 2008 13:33

#11 Post by morad21_9 » 02 Oct 2008 18:43

can I know why plz?

piort
Posts: 1379
Joined: 28 Dec 2005 16:42
Location: Laval,Québec,Canada,Earth... :-)
Contact:

#12 Post by piort » 02 Oct 2008 19:10

morad21_9 wrote:can I know why plz?
because few ppl here earn his life doing that ;-)

lot of ppl ready to help you here but, no one want make your job )))

do your homework and come back with some code if you still have problem and im sure you will receve a lot of help ;-)

idakota
Posts: 334
Joined: 27 Sep 2006 08:07
Location: Pretoria/South Africa
Contact:

#13 Post by idakota » 02 Oct 2008 20:21

morad21_9 wrote:can I know why plz?
Because we are here to help you if you get stuck. We are not here to spoon feed code to you, or to do your work/homework for free.

morad21_9
Posts: 8
Joined: 09 Jun 2008 13:33

#14 Post by morad21_9 » 03 Oct 2008 13:31

I thought this forum to share knowledge and help people not to sale it. but!! how does it cost ?

anton
Posts: 807
Joined: 23 Sep 2004 09:16
Location: South-Africa
Contact:

#15 Post by anton » 03 Oct 2008 13:57

Hi morad21,
morad21_9 wrote:I thought this forum to share knowledge and help people not to sale it. but!! how does it cost ?
That is correct. The forum is here to help people when they get blocked by a problem and to share ideas. When you post some code so that they (we) can see what you did or didn't understand, we can then they to help you.

Anton
Another proud user of LV 24-33A Development System and mikroPascal PRO for dsPIC :)
PortA not working? Add CMCON := 7; PortD not working? Add ADCON1 := 6;
To paste code on the forum, please use the [b] Code [/b] button !! ;)

Post Reply

Return to “mikroC Wish List”