Couple of simple questions

Hello All!

This is my first big project but hoping maybe I can get just a bit of guidance on this. Couple of questions.

  1. I have 8 or 9, 24Vac sensors that will be triggering different functions of my code. Notice I said AC. To my understanding the arduino is DC only. Does this apply for the I/O pins as well?

  2. I'm looking to attach a transistor to my power supply to the sensors. (24V AC). My transistor will act as my fail safe to keep the sensors from sending any current to the arduino without the ardunio being powered up first. Do you think it would be better to do 1 transistor rated for 24V to run all the sensors or attach 8 or 9 5V Transistors.

Very curious to see what answers I get so anything helps!
Thank you,

  • Matt
  1. DC only on the input pins, 0-5V.

  2. A transistor cannot be used to switch AC power. You will need a relay, either SSR or electromechanical. In the latter case, you will need a transistor to switch the relay coil and a flyback diode across that coil.

For more informed advice, post a link to the data sheets or product pages of the sensors.

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html

We need you to provide s with links/data on these AC sensors.
What are you trying to do with the AC sensors and control with the arduino controller?

Can you tell us your electronics, programming, arduino, hardware experience?

Thanks.. Tom... :slight_smile:

How are your sensors related to 24V AC? Are they powered by 24V AC, or do they measure 24V AC, or how else?

jremington:

  1. DC only on the input pins, 0-5V.

  2. A transistor cannot be used to switch AC power. You will need a relay, either SSR or electromechanical. In the latter case, you will need a transistor to switch the relay coil and a flyback diode across that coil.

For more informed advice, post a link to the data sheets or product pages of the sensors.

Thank you for your response. I am not so good with the Electric side of things yet so thank you for explaining that.

The sensors in question are similar to these:

I would have them converted to DC but that would obviously be very costly as our machines run 8 to 9 per machine. A cheaper alternative would be preferred for now.

TomGeorge:
Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html

We need you to provide s with links/data on these AC sensors.
What are you trying to do with the AC sensors and control with the arduino controller?

Can you tell us your electronics, programming, arduino, hardware experience?

Thanks.. Tom... :slight_smile:

Thanks, its quite a helpful community and i'm glad to be a part of it. I've never really played with micro-controllers in my programming days so this is a very nice beginning to a new era for me. I quoted a link to a sensor thats very similar to the one we use. They do "require" 24V, I did try to run one on a lower amount but it didn't give very good results. Our machines do have quite a bit of 24V solenoids, and other parts that do need 24V so stepping down the power to just run 5V isn't much of an option.

What I intend to use the Arduino for is to listen for signals from these sensors then send signals depending on different variables along with "safety checks". I have my code written although its a bit "unorganized" I do believe it will give us a basis to work with. After researching more for a few days I did see a few little things that might help from SparkFun.com but a more simple design would be helpful.

I have very little electronics experience, I've rewired parts of our machines and worked with simple stuff like running conduit and setting up receptacles but as far as circuitry i'm fair to say i'm very much an amateur. I do have programming experience in a few languages, i've tinkerd with C++ in the past so this is helping me kinda clean off the cob webs of what i've done before. I hope this information helps and I do appreciate all responses to my posts.

DrDiettrich:
How are your sensors related to 24V AC? Are they powered by 24V AC, or do they measure 24V AC, or how else?

To my knowledge they are powered by 24V AND they relay that 24V power over when something is passed by them. I'm not 100% on that but fairly sure.

Those sensors are intended entirely for AC output and power and really aren’t suitable for Arduino.

I would look for similar sensors that operate on DC, or at least have logic level outputs.

If you describe your machine requirements, one of us may be able to suggest another option. For example, if you are just looking for presence detection, the Sharp IR sensors would be much easier to use and cheaper.

jremington:
Those sensors are intended entirely for AC output and power and really aren't suitable for Arduino.

I would look for similar sensors that operate on DC, or at least have logic level outputs.

If you describe your machine requirements, one of us may be able to suggest another option. For example, if you are just looking for presence detection, the Sharp IR sensors would be much easier to use and cheaper.

I will look those over, they do look like a very nice alternative. In the meantime I'm still gonna continue looking for something to "interpret" the AC signal from the sensors already on the machine. What sort of info are you looking for? I'd be happy to provide it. I wasn't very informative in my previous post but the machine does use magnetic sensors as well that use the same 24-120Vac.

What sort of info are you looking for?

What are you trying to detect, how quickly and over what distance?

The sensor output is a SSR for AC (triac). The connection to the Arduino can be made like for other switching contacts, using a pullup resistor. But such a SSR relay will stay closed while current flows, that's why it has to be used with AC, so that the current flow during zero crossing becomes zero. In the best case a small current through the pullup resistor will prevent latching of the SSR, so that it can be used with DC as well.

For a test of the SSR behaviour you only need a voltmeter and a resistor. Connect the resistor to +5V and one SSR contact, the other SSR contact to Gnd, then measure the voltage across the contacts. Start with e.g. a 10k resistor, and watch the VM while switching the sensor. First of all the voltage should drop from 5V to a lower value when the sensor triggers. If not, reduce the resistor value. Down to 50 Ohm (for 10mA) should do no harm. Please test and report.

Once the SSR is known to close, watch whether it also opens when the sensor does not trigger, i.e. the voltage returns to 5V again. In the luckiest case you'll find a resistor value that both allows the SSR to close and open again. If not, you have to spend another output pin to switch between 5V and zero.

jremington:
What are you trying to detect, how quickly and over what distance?

Items of different color variations, apox 1" - 4" away from the sensor. Very quickly would be best. We use sensors to track the machine as fast as possible, some cycles as fast as readings of 4 sensors within a second.

DrDiettrich:
The sensor output is a SSR for AC (triac). The connection to the Arduino can be made like for other switching contacts, using a pullup resistor. But such a SSR relay will stay closed while current flows, that’s why it has to be used with AC, so that the current flow during zero crossing becomes zero. In the best case a small current through the pullup resistor will prevent latching of the SSR, so that it can be used with DC as well…

So the sensor is a solid state relay, so your suggesting using a pullup resistor to limit the current down to 5V? Do I understand that correctly?

given your sensors and outputs, would a programmable logic controller - PLC - be a better choice?

Loads of people make them,

regards Allan

allanhurst:
given your sensors and outputs, would a programmable logic controller - PLC - be a better choice?

Loads of people make them,

regards Allan

I would have to agree, the extra hardware and time involved in AC to 5Vdc conversion of each input circuit would make it more reasonable to go PLC.
You can get them with AC inputs/outputs and they are designed for industrial operations.
The arduino is not industrially hardened, and would require power and input filtering that a PLC would already have.
If the sensors are already fitted, was used before if they had a control system?
Tom... :slight_smile:

Blade2021:
So the sensor is a solid state relay, so your suggesting using a pullup resistor to limit the current down to 5V? Do I understand that correctly?

The outputs of the SSR act like relay contacts or switches, so some voltage and a current limiting resistor is required. For best Arduino compatibility the Arduino operating voltage should be used for that purpose, so that a full logic level swing can be achieved, while avoiding any dangerous voltages on the Arduino pins.

My experience of PLC's is :

You choose a suitable one with the required inputs and outputs and PSU requirements.
You bolt it in and wire it up.
You program it.
It works ....

If this is for an industrial process I suggest you go that way - you'll have enough problems doing the programming without cobbling an unsuitable piece of hardware - the hobbyist arduino with a stack of experimental interface circuitry - into the job and getting that to work and survive in a hostile environment as well.

regards

Allan

Hi,
If you choose to go the PLC way, when choosing one, ask about the programming software.

Ask if its free or not, because some PLC manufacturers charge an arm and a leg, ie up to $1000 for their software, others provide it free to down load.

Tom... :slight_smile:

TomGeorge:
Hi,
If you choose to go the PLC way, when choosing one, ask about the programming software.

Ask if its free or not, because some PLC manufacturers charge an arm and a leg, ie up to $1000 for their software, others provide it free to down load.

Tom... :slight_smile:

I dunno if i'm going to go with a PLC or not but I will defiantly take yours and everyones advice into consideration. The machines I'm going to be working with aren't exactly something that will rip someones arm off but they aren't the simplest either. There more of a medium. I am on edge about using a PLC due to a few factors that an Arduino would be very strong in. One of them being cost. Everyone loves saving money right? so I will have to talk with my supervisor and get a game plan on what he decides. I do appreciate the help and looking forward to working on this, no matter which option is chosen.

Best regards,

  • Matt

Hi,
Is this a new installation, or upgrading an existing one, if so what did the controlling before?

Tom… :slight_smile:

If you use an arduino you have to figure into the cost your time in designing and debugging the interfaces and power supplies, the cost of making and testing them (PCB’s?) ,the enclosure costs (IP65?), and the inevitable delay to the project…

If you want to make lots, and perhaps sell them, this could well be a sensible route… but for a one-off?

good luck whichever way you choose.

Allan

TomGeorge:
Hi,
Is this a new installation, or upgrading an existing one, if so what did the controlling before?

Tom.... :slight_smile:

The machines that the board will be used on have been in operation for many years without really many changes. We have 3 mostly automated ones and 2 semi automated ones. The 3 are my main focus at this point but basically what was or is controlling the sequence right now is a long series of mechanical relays and mechanical timers. This system isn't really efficient and honestly its becoming more of a pain then its worth. Going through two or three relays every couple of months or so. I know that isn't much but I see room for upgrading such a retro system.

allanhurst:
If you use an arduino you have to figure into the cost your time in designing and debugging the interfaces and power supplies, the cost of making and testing them (PCB's?) ,the enclosure costs (IP65?), and the inevitable delay to the project...

If you want to make lots, and perhaps sell them, this could well be a sensible route... but for a one-off?

good luck whichever way you choose.

Allan

I talked with my supervisor today and after hours of haggling and negotiation we have reached an agreement of trying to use a version of an arduindo to upgrade the system. Really looking forward to it myself, I think an arduindo is a great direction, at least for us to try. I mean labor excluded, we will be investing couple of hundred tops.

Not really planning on selling but if our "test run" over the next few months goes smoothly and can run as fast as our current machines speed (I have a friendly wager on that :wink: ) then the "reformed" system will be implemented on up to 5 machines.

It has been a very anxious day, however i'm very glad to have the outcome we have. Its going to be a very exciting project and i'm sure you'll see me around a good bit. One of the agreements to going with the Arduindo is I have to have a LCD Screen implemented when we launch it so that will be fun.

As always, Thank you all for your time, advice, and guidance. It is truly appreciated!

  • Matt