Visitor Detection system - that controls lighting

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
xix19
Posts: 4
Joined: Mon Feb 17, 2020 5:10 pm
Has thanked: 1 time

Visitor Detection system - that controls lighting

Post by xix19 »

I want to design a system that detects a user entering a building and is able to identify which room (out of 3) the user has entered and whether the lights are needed (detected via LDR). I intend to display how many people are in each room on an LCD - however I am new to flowcode so was wondering if anyone had suggestions about how to approach this

Thanks

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: Visitor Detection system - that controls lighting

Post by medelec35 »

What I would do is mount the two LDR's horizontally a few 10's of cm apart.
One one the left say LDR1 and one to the right LDR2.
If the room entrance is on the left then LRD2 will be triggered first then LDR1 will be triggered. That would be an incremented of one.
However if LDR1 was triggered before LDR2 then that would be a decremented count of one.
If count is 1 or more then lights on Else lights off.
I would recommend learning the basics first by going to Support, Learning Centre at the top of this website.
Change Product Range drop down to Flowcode.
Select What view course for both.
Or You can go to the Resource Centre & select Flowcode on the far left.
You may find this of great interest?

You will need to bare in mind that Flowcode 6 is no longer supported due to the age.
Or are you using Flowcode V8 and just posted in the wrong section?
Martin

xix19
Posts: 4
Joined: Mon Feb 17, 2020 5:10 pm
Has thanked: 1 time

Re: Visitor Detection system - that controls lighting

Post by xix19 »

Thanks for getting back to me, that’s very helpful I’ll look into it now, and I just have flowcode V6 downloaded from a while back

Best Regards

xix19
Posts: 4
Joined: Mon Feb 17, 2020 5:10 pm
Has thanked: 1 time

Re: Visitor Detection system - that controls lighting

Post by xix19 »

Hi, I have developed a program, with the aim to simulate my circuit design - I do not it to program the real circuit, therefore I have used buttons to represent the PIR sensors, one click means 1 entry into room one 2 means two entries and so on...

The problem I have hit is figuring out the correct way to implement calculations, for room one the system prints however many people have entered, based off the number of presses, however when I am pressing the 'leave'' button, i do not how to make this correspond to the total number of people in the room. (It's not as just printing a message, i presume there is a calculation I can enter using my variables, I have just been struggling to find a way to do this).

I cannot currently upload my program as I do not have access to flowcode, however any help would be much appriciated

Thanks

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: Visitor Detection system - that controls lighting

Post by medelec35 »

It would be better if you can upload flowchart as soon as you have access.
We can then help you further.
Martin

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: Visitor Detection system - that controls lighting

Post by medelec35 »

xix19 wrote:Hi Medelec35
Appreciate your help so far, I am designing this program to assist along side a piece of coursework, so did not want to upload it publicly.
Hi.
I can't help too much as its for coursework.
The only thing I can suggest is if left button then right button is pressed and a variable e.g called count is less than 255, increment count variable by 1.
If right button is pressed then left button and Count variable is greater than 0 then decrement by 1.
As its for coursework, are there specific instructions in addition to what you posted.
As there are three rooms you will need either three variables (one for each room), or a three byte array.
I would recommend finding out how to use arrays.
Martin

xix19
Posts: 4
Joined: Mon Feb 17, 2020 5:10 pm
Has thanked: 1 time

Re: Visitor Detection system - that controls lighting

Post by xix19 »

okay, thanks for your help

Post Reply