LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Uni project-Help

IMG_3624.png

Hello everyone,

I’m working on a project where I need to build a smart trash bin. The lid should open using a servo motor whenever an ultrasonic sensor detects motion. When the lid is open, a green LED should turn on, and when the lid is closed, a red LED should be lit.

 

There are two conditions for opening the lid:

 

  1. The detected object must be within 10 cm of the ultrasonic sensor.
  2. During a specific time window, the lid must remain closed regardless of any other conditions. For example time betweeen 12:15-12:30h. In my case that is 12x60+15 and 12x60+30. 

 

For some reason, I can’t get the time-based condition to work properly. Could someone help me figure out what I’m doing wrong?

0 Kudos
Message 1 of 14
(315 Views)

I would recommend to isolate the problem to a very simple VI where you have a timestamp control and a boolean output in a small loop and test your algorithm.

 

You need to be careful when the time rolls over, for example if you try a range of 11pm to 1am, you will deal with two different days.

 

Also note that if you are operating on the current time, you don't need to wire a timestamp to :"seconds to time/date", that is the default.

 

(Typically we cannot really debug pictures and trying to recreate code from a picture is too tedious and error prone, We prefer if you could attach your VI, preferably saved in a common version such as LabVIEW 2020)

0 Kudos
Message 2 of 14
(286 Views)

Here's a quick harness where you can test your time range algorithm for all possible minutes of the day. I also show one possible solution. Modify as needed.

 

altenbach_0-1764524783043.png

 

altenbach_1-1764524837841.png

 

 

0 Kudos
Message 3 of 14
(267 Views)

Please help me connect the conditions correctly. I'm not very experienced with LabVIEW, and this is my project for the final exam at university. Thank you for your previous suggestions, I’ll try to follow the approach you recommended. Thank you so much!

0 Kudos
Message 4 of 14
(245 Views)
  • You did not "save for previous, 2020 or below. Few here can open VIs save in version 2025.
  • There is no need to place a singe VI in a zip archive, just attach it directly.
0 Kudos
Message 5 of 14
(224 Views)

I hope it's okay now.

0 Kudos
Message 6 of 14
(201 Views)

Thanks. So far you did not implement any of my suggestions.

 

 

Here's a quick draft that you probably need to tweak here and there.

 

altenbach_0-1764605831094.png

 

 

Also:

  • if the sensor=10, both open and close LEDs are lit in your version. Seems confusing. Only one should be lit at any given time.
  • If the cases of a case structure only differ by a few constants, only the parts that differ should be inside the case structure. no need for all that code duplication
  • It helps to keep a clean diagram. Fewer wire bends and fewer places for bugs to hide.
  • I don't have your hardware and cannot comment on your hardware IO and thus left it as-is.

 

0 Kudos
Message 7 of 14
(171 Views)

@dal7800 wrote:

Please help me connect the conditions correctly. I'm not very experienced with LabVIEW, and this is my project for the final exam at university. Thank you for your previous suggestions, I’ll try to follow the approach you recommended. Thank you so much!


If we take your final exam for you, you need to put our names on the Exam Paper.  The purpose of a Final Exam is to help both the Student and the Instructor "measure" the effectiveness of the learning (that's your part) and the teaching (that's the Professor's part).  Anyone who cannot pass the final exam should probably not pass the course.  I certainly expect my students to approach me if my presentations of LabVIEW are not "learnable".

 

Bob Schor

 

 

0 Kudos
Message 8 of 14
(162 Views)

Thank you very much, I'll try to implement your advice and get back to you with feedback asap.

0 Kudos
Message 9 of 14
(160 Views)

Thank you for your reply Bob Schor, but I have to point out that the tone of your message was unnecessary and inappropriate. I asked a technical question because I want to understand LabView and complete the project properly, not because I expect anyone to “take the exam for me.” Those assumptions and comments about who should or shouldn’t pass a course are unhelpful, especially considering that our LabView instruction at the university has been minimal and students are left to figure things out on their own...

I was expecting constructive guidance, not sarcasm.

If you have actual technical advice or insight to offer, I would appreciate it. If not, then personal remarks are neither relevant nor needed.

Wish u all the best!

0 Kudos
Message 10 of 14
(159 Views)