Relay Tester

Hi guys Im sure this topic has been discussed tons of times but I cannot find too much about what I am looking for.

Here are the details:

I have a PC board with 24 relays and I want to turn on the relays by sending a digital high signal then measure the 5V ouput of the relay back into the arduino and print to serial monitor letting me know which relay failed.

See attached code.

I'm still learning

RELAY_TESTER.ino (3.32 KB)

gen-tune:
I have a PC board with 24 relays

That's like saying "I have a purple tractor". Aka, some details about that board please :slight_smile:

And after a short look at the code, have you heard of arrays?
And after a short look at the code, have you heard of arrays?
And after a short look at the code, have you heard of arrays?
And after a short look at the code, have you heard of arrays?

septillion:
That's like saying "I have a purple tractor". Aka, some details about that board please :slight_smile:

And after a short look at the code, have you heard of arrays?
And after a short look at the code, have you heard of arrays?
And after a short look at the code, have you heard of arrays?
And after a short look at the code, have you heard of arrays?

The circuit its not the issue. I'm sending a digital High 5V signal to turn on the relay and want to measure the 5V output of the relay and print to serial monitor. Showing which relay failed and passed.

See Flow

  1. Turn on relay.
  2. provide some delay.
  3. measure output of the relay.
  4. if no output then print on the terminal.

I know nothing about programming lol But learning as I go

gen-tune:
The circuit its not the issue.

Might be, but for us it's impossible to help you if we don't know how it works as well. :wink:

But to the program, what is the problem? I think it's best to start over (yes!) and start by trying to do it for a single relay. After that expansion is easy, especially if you use arrays.

septillion:
Might be, but for us it's impossible to help you if we don't know how it works as well. :wink:

But to the program, what is the problem? I think it's best to start over (yes!) and start by trying to do it for a single relay. After that expansion is easy, especially if you use arrays.

I agree! Testing with 1 relay would be fine. So turning On the relay I will use the Digital Write High. Then I want to perform a digital read from the output of the relay and print if the relay turned on or not.

I have the hardware connect now and Ready to go if you can provide some help or code.

Thanks

But I still don't know how that hardware is connected! For all I know you stuffed a relay into a light socket, I don't know. And unfortunately, on sunny days my crystal ball just doesn't seem to work. Aka, YOU need to help me out :wink:

Cleaned Up code.

I guess we can start from here

RELAY_TESTER.ino (665 Bytes)

Just a suggestion: For now, forget trying to test all 24 relays. Read up on (and run the demos) IDE/file/examples/digital/state change detection (you'll need to debounce the relay contact closures), blink without delay, and doing multiple things at the same time, using millis() for timing.

Once you can get one relay to behave the hard part's over.

gen-tune:
I guess we can start from here

No I can not. I don't know how the hardware is connected and what it does. And I don't even know what the problem is you have!

That's like asking someone if they "can fix you vehicle". You don't tell them what's wrong and if that "vehicle" is a bike or a jumbo-jet...

Aka, if you really don't want to tell us I'm afraid you're on your own :frowning:

See attached image of the circuit.

That's a start! Now draw in the relay as well and tell us the type (or better, point to a datasheet).

septillion:
That's a start! Now draw in the relay as well and tell us the type (or better, point to a datasheet).

I really dont get what the hardware has to do with this. You keep asking over and over like the hardware has anything it could affect. I explained my issues and your still asking about the hardware.

For now I am testing with a multi meter making sure the code is working and a external 5v.

I'll actually paypal someone 20 bucks to quickly throw something together now.

It's completely about your hardware. If you use it right, you have no need to check if it's working. Right?

Maybe your relay is failing and leading you on this nonsense tangent because you're trying to power the relay with the Arduino and/or failed to connect grounds, like a lot of newbies who talk a lot but say very little.

You were asked about the hardware by people who you must've imagined to know more than you, since you're asking for help. Why are you arguing instead of answering approximately?

INTP:
It's completely about your hardware. If you use it right, you have no need to check if it's working. Right?

Maybe your relay is failing and leading you on this nonsense tangent because you're trying to power the relay with the Arduino and/or failed to connect grounds, like a lot of newbies who talk a lot but say very little.

You were asked about the hardware by people who you must've imagined to know more than you, since you're asking for help. Why are you arguing instead of answering approximately?

I attached an image of the schematic.

I have a circuit board with 24 relays and I want to turn on the relays by sending a digital high signal to MC1413PB which are driving the relays with 12V. When the relay is latched the output of the relay should be 5V. I want the arduino to measure the 5V output of the relay back and print to serial monitor letting me know which relay failed.

The circuit I described above is so simple. The relay Part Number is 2-1419130-4

Can somebody assist me?

Thanks

gen-tune: Dude, honestly: it doesn't matter how simple you think your circuit is.
Without knowing which relay's inputs and outputs are connected to which pin(s) on your Arduino board - how are we supposed to find out if your program is correct?
Maybe you're just listening on the wrong pin? We cannot say for sure, because we do not know the hardware!
Maybe your Arduino is going haywire because you forgot to put freewheeling diodes across your relays' inductor coils? We cannot say for sure, because we do not know your hardware.

And you haven't attached a picture of the schematic, you attached basically a picture of a chip with two lines attached to it. That is not a schematic, not even close.

But hey, ultimately it is your call.
If you really and absolutely do not want to post a complete schematic, it is up to you.
However, I'm pretty sure that nobody is going to help you then.

Have a good one!

Hey all,

Well for those who needed a schematic this developer didn't need one and many more who applied to my upwork post. I posted the exact same description here and he managed to write the code attached. And the best part it works.

I think you guys all failed to realize that a schematic or wiring was not needed. Its a simple digital high signal to whatever and tell the arduino to do a digital read to make sure 5V is inputted on the specific pin.

Nothing else

Thanks for all your help!!

relay tester.JPG

And you payed for that code!? :o It at least wins the most ugly code of the day award ;D Like I said, that 12 year old is laughing his ass off.

And no, to make code we don't really need a schematic. But it's the damn most effective/complete/quick way. And because you failed to even tell to which pins the relays where connected and how on earth the Arduino would read them back (because a relay does not output ANYTHING! by itself), yeah, a schematic was the quick option...

septillion:
relay tester.JPG

And you payed for that code!? :o It at least wins the most ugly code of the day award ;D Like I said, that 12 year old is laughing his ass off.

And no, to make code we don't really need a schematic. But it's the damn most effective/complete/quick way. And because you failed to even tell to which pins the relays where connected and how on earth the Arduino would read them back (because a relay does not output ANYTHING! by itself), yeah, a schematic was the quick option...

Now you want to say you dont need a schematic haha the every post you wrote mentioned a schematic and cannot be done. Only thing you failed at is being helpful. Same information posted here was done by another developer. 20 bucks and it works!

But Cool man Thanks for no Help. Appreciate everything you did :slight_smile:

You DO realize that the funny thing is you could have gotten that piece of code for free here AND have learned something by just posting the stupid schematic? Oh, not to forget you could have gotten it weeks earlier than you did now.

So, yeah, congratulations on your achievement...