A conveyor belt that changes direction after 3 objects pass

Thread Starter

Esteban Verduzco Raggio

Joined Jun 6, 2019
3
Greetings!
.
I have to make a conveyor belt that, using flip-flops and logic gates, changes direction.
The circuit detects the objects passing by using an optic sensor which I already have set with a phototransistor and an IR LED. I'm also using the 74ls74 dual flip-flop, and a bunch of 74lsXX AND, OR and NOT gates. These are the only ICs I have available and I have no idea how to make it because I have to know the actual spin direction of the motor to change it.

Any help will be appreciated, I'm about to close my semester.
 

bertus

Joined Apr 5, 2008
20,053
Hello,

What have you done upto now to count the objects?
I see you have an opto interrupter set-up.
How many flip-flops are needed to count 3?

Bertus
 

djsfantasi

Joined Apr 11, 2010
5,603
I don’t think anyone will provide you with a wiring diagram, as this is Homework Help (not Homework Done for You). Some replies will be much more to the point than mine. But if you want to learn more than how to solve this problem, I encourage you to read what I have to say.

So, first forget about what ICs you have to use. Then, you have to write out what you have to do. In words.

Don’t try to think how you’re going to do it.

Each step should be a single sentence.

Now you have a high level system design.

For each sentence, decide how you’re going to do what it says. Again, in words only. Each step will have input conditions and output signals.

Now with detailed steps is the first time you consider what electronics (ICs) you might use. Use the inputs to connect to the ICs and use the outputs to connect to the next step.

The first time you do this, you’ll run into problems. Write out each problem in words only.

Go back to defining each step. Modify the word description based on what you learned.

Redesign the wiring for each step. Repeat the process.

Once each step does what you want, wire your design together, each steps output to the next steps input.

By following this process, the solution will be staring you in the face. With more experience, it will become simpler and perhaps you can skip writing everything out in words. But until you can tell that you understand a design, this is the best approach.
 

drc_567

Joined Dec 29, 2008
714
... a circuit called an H-Bridge can reverse the rotational direction of a DC motor. The control for that circuit might be described as having two transistors on and two transistors off for each given direction. Actually, relays might be used instead of transistors. Also, you would require a counter circuit of some sort.
...
 

Thread Starter

Esteban Verduzco Raggio

Joined Jun 6, 2019
3
Hello,

What have you done upto now to count the objects?
I see you have an opto interrupter set-up.
How many flip-flops are needed to count 3?

Bertus

I had a logical circuit that counted using Gray code with the 2 flip-flops from the switch and had motor feedback so it knows from which state to change. I got a little confused developing it from the truth table but in the end I got the attached diagram. My thing is that now I don't know what will go in the A and B inputs of the H-Bridge moving the motor because I can't wrap my head around to which things will switch as I need them (being one always on HIGH and the other one in LOW, then switching). It would be easier to just code it but I have to do it using flip-flops and gates because of the course so I got worked up and bought a lot more ICs. It's due tomorrow.

X and X! are the input signal on the H-Bridge. This isn't a paradox, it would be a feedback that I don't know where I'll get it and me being 36 hours awake isn't helping but I can't sleep due to everything else I have to do.

Not asking to get it made but I need to know what can I add to make it work.
 

Attachments

djsfantasi

Joined Apr 11, 2010
5,603
Anyone besides me wondering why Gray code is necessary?

States? Are there really so many states needed that a truth table is needed?

Why is motor feedback necessary? The drive signal should tell you the motor state.

At most, this should not be a complex problem. Two flip flops, an inverter, a few miscellaneous components and an H-bridge. Maybe three ICs?

This is a bunch of solutions looking for a problem.

It’s why I proposed the process earlier. I don’t think that if it was followed, we’d now have a bunch of solutions looking for a problem. The process would have taken maybe 10 minutes on paper. Without it, I guarantee that you’ll spend many times that on a design and more time than necessary debugging.

Or, it’s entirely possible I completely missed the requirements. If so, just ignore me.

I don’t think so.

UPDATE: another IC is necessary to decode the position. I forgot that. Four gates. However, using a universal gate, you get the inverter and the logic to decide the position, so my rough estimate is back to three chips.
 

Thread Starter

Esteban Verduzco Raggio

Joined Jun 6, 2019
3
Anyone besides me wondering why Gray code is necessary?

States? Are there really so many states needed that a truth table is needed?

Why is motor feedback necessary? The drive signal should tell you the motor state.

At most, this should not be a complex problem. Two flip flops, an inverter, a few miscellaneous components and an H-bridge. Maybe three ICs?

This is a bunch of solutions looking for a problem.

It’s why I proposed the process earlier. I don’t think that if it was followed, we’d now have a bunch of solutions looking for a problem. The process would have taken maybe 10 minutes on paper. Without it, I guarantee that you’ll spend many times that on a design and more time than necessary debugging.

Or, it’s entirely possible I completely missed the requirements. If so, just ignore me.

I don’t think so.

UPDATE: another IC is necessary to decode the position. I forgot that. Four gates. However, using a universal gate, you get the inverter and the logic to decide the position, so my rough estimate is back to three chips.
Thanks for your advice, just some few points and an apology.
There's not actually a truth table but more of a possible cases table for me to try and understand how the logic circuit will work (which I couldn't understand since I didn't make it, it's a teamwork and we just went doing things and now nobody knows what to do).
Gray code is used because I need to put the amount of items in a 7 segments display and Gray seems easier (also class requirement).

I know how you think all of this is like a bunch of things to solve a basic thing, but I think it's my fault not being able to express myself in English. The reason for it looking like a mess is that it is, I have parameters and methods I need to follow but I cannot get my head around them.

I think I'll be closing this since I can't find help, not that I want it made for me but an explanation of what I'm supposed to do would be nice.
 

djsfantasi

Joined Apr 11, 2010
5,603
  1. Count to three
  2. When count is three, toggle a signal and output it
  3. Reverse the motor
That’s the first step in the process I described earlier. That post was my attempt at telling you what to do.
 

djsfantasi

Joined Apr 11, 2010
5,603
Here’s the second step. I’ve added notes marked as “added later” to show the iterative process I described.
  1. Count to three. Two bits are needed to count to three, so you need two flip flops. The input is your sensor. The outputs are the two bits of the count. Added later, you also have a reset input.
  2. And the two bits together. When the two bits are both high, the count is three. The inputs are the two bits. The output is the result of an And gate of the two bits. This output is the motor state as well.
  3. Reverse the motor can be done by creating two signals from the motor state. One is the raw state and the other is it’s inverse. An H-bridge can be controlled by these two signals. Added later: additional circuitry is needed to delay one of the H-bridge inputs to prevent shoot through.
DONE! As far as your original post, this completes the process. There are missing features, but they weren’t stated in your original post. For example, when reversed, does the belt ever stop or go forward again. Your problem statement provided no clue.
 
Top