ni.com is currently experiencing unexpected issues.

Some services may be unavailable at this time.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help creating a school project

I have to create a project about traffic lights on the crossroad. The crossroad consists of two streets, one is busier than the other, as you can see in the picture, therefore the cars in the A lane have bigger priority. 

grillmillivanilli_0-1650992227401.png

The A lane has green diode and B lane has red diode. When the green diode is on, the cars in the A lane are allowed to pass, and when the diode is off, the cars are not allowed to go. When the red diode is on, the cars in the B lane are not allowed to go. In the normal settings, the green and red diode are both on until a car in the B lane comes nearby. The car in the B lane is detected by a photoresistor. When the car is detected the timer starts, and after t1 seconds both green and red light go off (that means that the car in the B lane can pass). That setting lasts for t2 seconds and after that lights go back to their normal settings.

I hope you can help me, because our teacher didn't teach us anything but want us to do the project, and I don't know how to start.

I will have more questions because it's a long project but I need you to help me start.

Thank you in advance.

0 Kudos
Message 1 of 6
(2,048 Views)

Did your teacher explicitly say that you have to use LabVIEW for this?

If so, do you have it installed and are able to use it?

Is the "photoresistor" a real component that exists in physical space or is it meant to be a virtual one?

Do you understand the problem enough to even write pseudocode to mock up how you will solve it later?

Message 2 of 6
(2,034 Views)

We have to use LabView.

Yes, the photoresistor is a real component that we will have with some NI-DAQ stuff, I understand the problem but I don't know much about LabView to start a project.

0 Kudos
Message 3 of 6
(2,027 Views)

So what exactly are you supposed to do? What is your starting point?

 

  • Did you get a fully working simulation and you just need to implement the traffic control.
  • Do you need to write an entire simulation, randomly generating cars and read simulated sensors and change the LED accordingly?

 

Have you had any basic LabVIEW training?

Message 4 of 6
(2,021 Views)

OK, so that's a really simple simulation and as a first step, all you need is a front panel with two LEDs, a Boolean control for the sensor, and two numeric controls (t1 and t2. Could even be diagram constants if they are always the same). The rest is a simple state machine that changes state based on timing and sensor state. Nothing else.

 

Write down all possible states that can occur and what the indicators should show for each:

 

  1. Default
  2. Sensor triggered
  3. Waiting for t1 to elapse
  4. Waiting for t2 to elapse
  5. etc.

 

Once this works fine, it is easy to replace the LEDs and sensor with their hardware equivalent.

 

Start with the learning resources listed at the top of the forum. Look at the design templates.

 

 

Message 5 of 6
(1,991 Views)

A very simple program to change state based on timing can be found here. Study it! Once you fully understand every detail, It should be easy to modify it to suit your purpose.

 

 

Message 6 of 6
(1,977 Views)