I had a problem with a relay.
It works using a "Marklin Train" for my father, so I need to power up the rails sometimes or not power up.
But the problem is that the rails are always powered up, so I need to know where the error comes from. If it is come from the train stuff, or from the Arduino and relays stuff.
This is a shema of my relays and how they are connected to my Arduino:
const char rail = 6;
void setup() {
// put your setup code here, to run once:
pinMode(rail, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(rail, LOW);
}
Note this is not my definitive arduino code but this is the results:
When I replace "LOW" by "HIGH", there is electricity on the rails
When I replace "HIGH" by "LOW", there is also electricity on the rails.
Unfortunately I couldn't gives you attachments because the files are too big to be uploaded on most of the hosts, including the Arduino Forum...
NB: TomGeorge asked me to get a hand drawn version of my circuit, if you want to get it more quickly, here it is:
What do you think?
Thanks in advance
Chopin2712.
PS: When I set the rail to "LOW" in my Arduino code the little LED on my relay stops so I believe there is no problems in my Arduino code.
then your problem is in the relay module....
you can test relay module directly without Arduino... it should work and you should listen the sound as well.
also you can put a led (with resistor) if it´s not included in the relay module (I assume there´s one) to monitor your code
oswe:
then your problem is in the relay module....
you can test relay module directly without Arduino... it should work and you should listen the sound as well.
also you can put a led (with resistor) if it´s not included in the relay module (I assume there´s one) to monitor your code
I already tried it, as the recommendation of TomGeorge. I disconnected completely the Arduino and the relay then the track is always powered up. So it is not my Arduino Code for sure.
I think I found the problem, I disconnected the track from the relay and the track is always powered up. So it probably means it is the isolation with the next track is not working (to understand, please check the hand drawn). I will gives you more informations if it is that or a relay / circuit problem...
But I don't think it is the relay because to solve the error I tried using another type of relay so I believe 2 different relays cannot be broken at the same time.
Edit: The relay wasn't broken but it was not powered up correctly, to use the 5V pin and GND multiple times I place them on a breadboard. But the breadboard connection wasn't good so when I touch relay's wire or directly the breadboard the relay make a weird noise.
I think it is also because there were too much wires on my breadboard.
But now I tested my "broken" relay and it works.
This was an information for peoples who had the same issue as mine...