11-30-2025 05:19 AM
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:
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?
11-30-2025 10:35 AM - edited 11-30-2025 10:36 AM
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)
11-30-2025 11:48 AM
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.
11-30-2025 03:55 PM
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!
12-01-2025 12:50 AM
12-01-2025 03:28 AM
I hope it's okay now.
12-01-2025 10:18 AM - edited 12-01-2025 10:19 AM
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.
Also:
12-01-2025 10:44 AM
@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
12-01-2025 10:53 AM
Thank you very much, I'll try to implement your advice and get back to you with feedback asap.
12-01-2025 10:56 AM
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!