I'm here to ask for help
I've prepared a project to automate the opening and closing of my garage doors.
I've got 2 Servo Motors that runs at 12V so I bought a transformer ( 220V to 12V ) to power them,
between the transformer and the servos there is an inverter ( done with 3 relays ) to invert the current flow
This transformer power also an external board with an antenna to give my board the signals from the remote-controller.
While the 2 servo motors are unattached everything works properly, when I attach even only one servo the board receive signals from the antenna even if I don't use the remote
Is there an Arduino involved in this anywhere? A circuit diagram/schematic would help and details of the components (I've never seen servos that run on 12V AC from a transformer).
And I guess you must have some code. It would be good to see that too.
What are your "servos", are they just DC motors?
Can you post a link to specs/data please?
Can you please post a picture of your project so we can see your component layout?
What size is your 12V power supply?
How are you powering your controller?
What model Arduino are you using?
Are your relays modules with relay drivers on board?
What are the specs of the power supply and what are the specs of the "motor"?
What is written on them about there working parameters?
Using the DuPont type jumpers is also not a good idea for this situation.
They are good for experimenting and POC, but in the real world they are not suitable for reliable long term connectivity.
Your remote receiver and antenna needs to be kept away for many power AC or DC cables.
What do you mean, what happens, does the relay on the Receiver chatter or click, or does the UNO behave as though the relay is activated, even though its not?
You have the receiver relay switching between gnd and 3V3, the UNO is a 5V logic controller, you should be switching between gnd and 5V.
Hi,
Looking at your circuit diagram, if you have gnd connected to NC, Normally Closed, then the input pin should be at GND.
Have you got GND and 5V connected to the correct terminals?
There are a number of concerns with your construction.
A UNO is a poor choice for a practical project such as this, the "Dupont" jumpers are not really appropriate for long-term operation and vibration could be a concern. Using them in screw connectors is a bit odd but I suppose if that is all you have on hand it is understandable.
For such projects, we would prefer to have almost all soldered connections - a Nano is appropriate for this as you can obtain them without the pin headers mounted. A "screwshield" as mentioned is however a good alternative.
The major problem here is the scrambled wiring. To avoid interference between different parts, it is essential to keep all connections between one part and another tightly bundled either by using ribbon-type wire, or tying with cord (nylon fishing line is convenient) so that there are no open loops in the wiring between a power or signal line and its matching ground return as such open loops function as little coupling transformers. It is necessary to understand that these microcontrollers operate at "RF" - radio frequencies - and the principles of radio transmission apply.
And note this especially applies to the wiring to motors, solenoids etc.
Your title was slightly puzzling, referring to "interrupts". "Newbies" frequently misunderstand the purpose of interrupts in computers, so this attracted my attention but fortunately you do not appears to have fallen into this trap. I am however puzzled by finding in your code:
and
which makes no sense. From where did you get this code?
thanks for the various suggestions I'll try to apply them
About the code
Due to the issue mentioned that even if I didn't use the remote to fire the interrupt I've tried to add this piece of code to have a slight delay in the reenabling of them giving time to "excess current" on the pin to flow to ground. I hope this could solve my problem of missfiring but as said before it solved it only when the "motor" is not attached.
Here the delay is more no sense but without created a lot of missfiring, I use the run_int to execute a bunch of code in the loop only one time. When I receive the interrupt I set it to True, run the code in the loop and reset it to False
The last_int instead is used as a check to understand if I just run an interrupt or no, without it each loop entered the if statment previously mentioned and I had delay in each loop
About where i got the code... pretty much from my head
OK, I have had another look at the code and found where you used
So that code is complete nonsense.
As you do not understand what interrupts are and why they are terribly inappropriate in this (as in most) situation, you really need to delete that line and all reference to interrupts. Start again with the problem and carefully discuss your proposals here.
So on further thought. maybe that is only one part of the problem
I also note a catastrophic error in the relay wiring! Simultaneously actuating relay 1 and relay 3 shorts out your 12 V supply. :astonished: