# Push button, start motor, turn off, start timer... Help with circuit and programming

Status
Not open for further replies.

#### Novaso

Apr 12, 2017
1
Hello, I just recently got into electronic stuff. I've gotten an Arduino starter kit. And things are still a bit complicated for me.

So I just came up with a project that I would really love some help with. Hopefully, this will help me understand a bit more.
I'm calling this project a "fish timer" since I have a big family and since no one actually ever knows if the fish has been fed or not. I know there is an automatically fish feeder to buy. But nah.
Anyways, so I came up with this design, I'll try to explain my design, the picture is also available. I made it on Sketchup. And I'm thinking about to moving on to Solidworks. Sorry, back to explaining...
Imagine a rectangle box stand, and inside it, there is an another rectangle box attached to the midpoint. it has four faces and can be rotated 360° degrees inside. But in my design I want it to rotate only 90° degrees because to view the face instead of the corner or any other odd position. It has four faces, two faces say "Feed Me" and the other two says "Satisfied".
Now it stands "feed me", I give the fish food and now they've been fed so I push the button, and it will eventually turn 90° degrees, showing the other face with "Satisfied". Now comes the help I need.

Push button = starts motor for an amount of time
(I don't know the RPM of the motor yet. My RPM meter will come soon. So I'll calculate it with no problem.)

Calculated time = which will make 90° degrees turn and then the motor turns off.
Start the 12h timer
12h timer is over
start motor = 90° degree
motor turn off

And the process will start all over once I push the button again.

I did also put some thoughts on the "Servo Motor" and I believe it's a lot easier with it and much more precise angle than a regular dc motor.

I don't know what to type in programming, and I don't know what things I need for the circuit. Is it possible to have a microcontroller on this project? So I don't have to need a big Arduino next to the model and sucking in all of the battery. If you guys could make or explain the schematic of the circuit and programming lines of the idea of my model it would be fantastic. Or even make some change on the model, if it's an improvement.

Note:
The picture is just to show my thought.
I do have a 3D printer, one of the reasons I came up with this project.
This project is not for advertisement, it's just my own personal hobby.
I'm from Sweden and I'm 15 years old, so I pardon for my English and a lot of the help I need. Since our school does not teach us a single thing about electronic stuff. So I mostly have to find facts on websites which is in English.

Anyways, have a good day.
Best regards Simon.

Those blurred things are "Lightup" Plugin on SketchUp for rendering. It's trial, that's why.

Last edited:

#### Bluejets

Oct 5, 2014
6,196
Use a small motor gearbox.
The way you have it drawn it will spin so fast you will not get consistent results from the rotation.

Second.... no real need for Arduino but you could do it that way.

Third.... instead of time, use a position switch like an opto or hall effect.

#### BobK

Jan 5, 2010
7,682
As Bluejets said, rotating by time will not work, it will get out of sync eventually and be in between the two messages.

A servo would work. These rotate to a specific angle based on the signal sent to them, and they already have the gearing that Bluejets mentioned you would need.

Using a Arduino is not unreasonable, especially if you are going to use a servo motor. It is a fairly complicated circuit to do without a microcontroller, but fairly simple with one.

Bob

#### bob monsen

Jan 18, 2010
8
One other way to do this that would be somewhat easier, and wouldn't require motors would be to use two different colored LEDs to project through different messages onto a white screen, or maybe even the wall. Just 3d print rectangles with both 'feed me' and 'satisfied' cut out, so an LED behind each of them will project the words onto the wall, and use the arduino to select either one or the other LED based on time and button pushes.

Your arduino sketch looks for the button push, turns on the 'satisfied' LED, and waits 12 hours. Once 12 hours are up, just turn off the 'satisfied' LED, turn on the 'feed me' LED, and wait for the button push. You don't even need to 'debounce' the button. You can use internal pullups, and just have the button close a path to ground on the logic input. Very simple, no real moving parts except the button, and you get to use your 3d printer to build the enclosure, signs, and such!

#### Mouthpear

Jul 20, 2020
24
What did you go with? Did you get it done?

I would have just use a 4 line LCD and made it display current time and the next time they need to be fed. Maybe added a countdown.

But to do it the way you wanted, all you really needed was to use an IR Infrared Sensor Module and put a spot, on the underside of inner cube, at each stopping point. (each side of cube, center).

To be more "certain" use two sensors staggered. Put a spot, on the underside of inner cube, at each stopping point for "Feed Me Please". Then put a spot, on the underside of inner cube, at each stopping point for "Satisfied". However these spots are set staggered offset.

No need for timing the motor. Although timing can get off, it is not hard to set a point at which the timing resets. Use one of the IR sensors, mentioned, and every time it passes a single spot (one full rotation) it resets the time.

One last thing. If you use a motor shield that can run 2 servos and 4 dc motors or 2 stepper motors. I like these shields and their upgraded versions because you don't have to program the ONs and OFFs like you have to do with the smaller offboard drive controllers. Install the library, assign name to motor, and tell it what to do. Motor1 forward. Motor1 reverse. Motors one speed 255 (100%) 0 - 255..

Motor1 run(FORWARD);
Motor1 run(REVERSE);
Motor1 run(RELEASE);

Motor1 setSpeed(255);

#### Attachments

• 1666955258444.png
16.8 KB · Views: 2

#### Bluejets

Oct 5, 2014
6,196
What did you go with? Did you get it done?
Post is over 5.5 years old......look at dates before posting reply.

#### Mouthpear

Jul 20, 2020
24
Post is over 5.5 years old......look at dates before posting reply.
Then why did you reply. You could have just have just ignored. I wasn't speaking to you.

Also I know it is old. Are you implying that a person can't read? Are you deliberately trying to be rude? "look at dates before posting reply." Why are you trying to tell people what to do? Especially when it was unsolicited. I wanna know what the OP went with and how it held up.

Plus if old posts are so old and shouldn't be interacted with then why did the site bother suggesting it? Why are they still open?

So you can ignore, not respond and let the OP respond if they so desire

Or you can respond and not follow, what seems like some unwritten rule, you decided not follow already.

Or you can complain to the mods, that someone followed one of the links the site suggested, was curious of what the OP ended up doing and you can see if they will close the thread.

Either way if you ever see me or my posts again, reframe from interacting with me. I do not wish to converse with you or to be bothered by you. All the "questions" I posed are rhetorical, that means they are statements and are not realy posed as an actual question. I won't be replying back to you after this. Don't take my ignoring you as if you made some comment that I could not rebuttal (a gotcha moment), I am simply choosing not to waste any more time on comments that are snarky and not constructive.

You have good life, goodbye.

#### Bluejets

Oct 5, 2014
6,196
Then why did you reply. You could have just have just ignored. I wasn't speaking to you.
Now now.....responses like that will get you banned.

Last edited:
Status
Not open for further replies.

Replies
3
Views
2K
Replies
2
Views
11K
Replies
2
Views
379
Replies
14
Views
2K
Replies
8
Views
2K