Im totaly new to this, and I don't wanna be rude just jumping in here asking questions. I am building a bypass valve on my car, to bypass the rear silencer. The kit I'm going to buy is an electric motor that opens and closes the valve, it comes with a crappy remote that I'm not gonna use, instead I would like to use a very sexy push button that I laying around, the problem is that the electric valve is not a servo, it's just a simple electric motor with ground and power.
So I figure that the smallest Arduino should be able to help me out.
When I push the push button, it will run the electric motor for about 3 seconds, that will open the valve. The next time I push it, it should run the electric motor for 3 seconds in the other direction, the Arduino should change the current direction making the electric motor go the other way, so the Arduino is basically an operator that handles my request, this should be fairly simple to code from what I've seen the Arduino do on YouTube, the problem is that I know squat about it, so I was hoping that someone could code this as simple as possible for me and I'll pay for it!
I hope this is not viewed as rude or anything, I just dont see any other option, unless there's premade Relays that do this exact thing(?)
Really appreciate any response, and I hope you guys understand what I'm after, here's a link and image to the electric valve just so you can get an idea: Valve Image
So, I need the code, as simple as possible, no need for it to look sexy, and I need a simple explanation of which pins to connect the stuff to. The electric motor is 12v and draws almost no power. I would liek to do this with the smallest Arduino chip as possible. Thanks!
Even with small power, you will need a power transistor (or at least a transistor that can handle that motor) and a few components to drive the motor. I think that will better too add some switches at the end positions (open and closed) instead of running for some time.
The sketch, for one or other option (switches or time) is very easy.
The state change detection example does 90+% of what you want. What you need to realize is that the Arduino will NOT run the electric motor. It CAN drive a motor driver shield that can drive an electric motor. That shield takes care of the reversing current, etc. The rest is just a matter of setting the direction pin HIGH or LOW, and setting the speed pin to the appropriate value, twiddling your thumbs for a while, and setting the speed pin to a different value.
Okay so what you guys are saying is that I'm better with a 3 stage switch? Sure, that would be the easiest way to do this, the problem is that a 3 way switch will not fit in the ash tray, and it will not look as neat.
It takes about 3 seconds for the valve to open and the same to close it, so I figure that the Arduino could be programmed to just run the motor for as long as it takes to open and close it. The end question is if it's even possible and what parts would I have to buy? Thanks!
Hi,
Have you connected the kit up to a battery and see if the motor stops at the open and closed points automatically if you hold the switch in open or closed?
I have not bought the kit yet. But from a YouTube video it seems to just stop at the end position, the big question is if the motor is still running. Check this video, it's the same kit the only diff is that there is 2 valves.
Video: VIDEO
The guy in the video hold the button much longer then needed, pay attention to that.
But I just have to use my iPhone and time how long it takes for the valve to open, then program that into Arduino, so every time I press the button the Arduino will run the cycle as programmed. A DPDT would be the easiest way ofc, but it will not work as good as I want it to.
AWE tuning have a complete system for this but it costs a fortune and I already got an exhaust system that I'm happy with. Their open-close solution is so nice and I would basically like to copy it, they use a Momentary button and probably an electric box or micro controller to open and close the valve. Take a look at this image (This is also the exact same car as I have, so it looks exactly the same, and as you can see, there are not allot of space when you close the ash tray lid.
The website says the motor has "over torque protection" the only way to find out what this means in practice is to actually buy the unit and connect it to a battery, you need to do this anyway to measure how much current the motor draws, then you (or someone here) can work out what needed on the arduino side (H-bridge shield at minimum).