Arduino and current sensors to pilot pneumatic blast gates and dust extraction

Hello everyone

I’m an amateur woodworker currently playing way out of his league with electronics, pneumatics and programming.
I’m reaching out to the Arduino community for support and - if someone has the time, courage and patience - guidance in my project. Please pardon my english, I’m belgian and french is my native language, so I’ll do my best but I’d rather spend hours on arduino tutorials than on improving my English :wink:

My idea coming here is not to get a “ready to copy-paste” code and a full wiring schematic, but to get to:

  • Find the best way to connect the hardware
  • Structure my code so that it’s not a tangled mess of instructions at the end of the process. Since I never programmed anything, I’ll be the tough part…
  • Help me understand why it’s better to do it this way rather than that way.

Long story short:
I’m building an automatic dust extraction system based on the following:

  • A 2,2KW ventilation unit sucking dust from the machines producing it through metal tubing
  • Blast gates pushed or pulled by Pneumatic cylinders in order to orient the flow from the right machine
  • Pneumatic cylinders triggered by Solenoid valves
  • Solenoid valves triggered by an arduino mega, which receives its input from current sensors, push button or proximity sensor.

I’d like to be able to make the system evolve in the future, maybe add blast gates, machines,… so I need to really understand what I’m doing.

I did quite a lot of research before to dare coming to this forum, and here’s the result of this research.

1. Dust sources

  • 1 Planer-thicknesser
  • 1 Router (same machine as the saw - different motor and dust extraction setting)
  • 1 Saw (Same machine as the Router - different motor and dust extraction setting)
  • 1 Band Saw
  • 1 Lathe
  • 1 Radial Arm Saw
  • 1 floor extraction (aka “broom output swallower”)

These dust sources will be connected to 100mm galvanized steel vent duct with DIY blast gates opened and closed by Festo DSNU 25-100 PPV-A pneumatic cylinders which are triggered by Festo CPE14-M1BH-5J-1/8 5/2-way Double Solenoid Valve (24V - 1,38w)

2. Arduino INPUT

I intend to use ACS 712 current sensors in order to detect when the machine starts or stop, but this leaves me with a few issues. My intention is to keep the “Arduino Unit” in one place (near the main electrical box of the workshop)

  • The lathe is 1 phase and is connected to one of 8 “normal” power outlets in a circuit → I’d have to put the ACS712 near the lathe, but I prefer to use a push button to start the dust extraction at that location
  • The Router and the saw are basically 2 functions of the same machine, which is connected on 1 cable → That could be solved measuring the current to detect whether the saw or the router started
  • The floor extraction is not a machine and uses a manual blast gate → I’ll use a proximity sensor to detect presence 10-15cm away from the sensor and start the dust extraction.

3. Arduino OUTPUT

I intend to use a 16 relay module (Low Level Trigger) to connect the 14 solenoids of the 7 double solenoid valves and the 230V Relay which starts the Ventilation unit.

Schematic of the Workshop. Tubing in red.

The schematics of the Arduino Mega wiring (with some missing wires…) will be posted in the next message, since - as a totally new user - I can only add 1 image per post.

  • The solenoid valves I use are bi-stable → If I send a signal to the “OPEN” side, it’ll open and stay open even if the signal stops. Same for the “CLOSED” side.
  • BG stands for “Blast Gate” → BG3-O-R5 stands for “Blast Gate 3 - Open side - Relay 5”
  • R=Router - S=Saw - PT=Planer-Thicknesser - BS=Band Saw - RAS=Radial Arm Saw

I didn’t start the coding part yet (I’m still waiting for ACS712 current sensors). But I would already like to have your input, and specifically:

  • Does the proposed overall solution sound OK?
  • Do you see any “big issue” (like lack of power, impossible wiring,… etc)?
  • Is the wiring (at least what’s present) OK?
  • How would you
    • Handle the various stuff to connect to 5V (from a hardware point of view)
    • Handle the various stuff to connect to Gnd (from a hardware point of view)
    • Wire the push button for the lathe (idea is to push it once to start and push it once to stop).

Thanks in advance for your help,


1 Like

Here are the schematics of the proposed wiring

Did you ever made a large systems design like that?
Well I think the link to the IOP-model will help you to make a kick off for your project. And second avoid the usage of the delay() function. You need a multitasking sketch to execute all obove mentioned jobs in “parallel”.

No, I never made any systems design… :wink: But in the end, even if the number of inputs and outputs is a bit high, the “Process” part seems quite simple. In the end, I expect something like

  • initial state : all gates closed
  • If Machine X starts (pin n=high), gate Y opens (Pin n=high).
  • If machine X stops : back to intitial state
  • Given the configuration of the network, this setup should be able to handle any 2 machines running at the same time (knowing that Router and Saw cannot - by design - run at the same time)

Am I wrong ?

This is a project that comes up here from time to time - there was one in the last few weeks I think. You can find youtube videos of people building similar systems too, so it’s doable.

Are you sure about those current sensors? Most of my tools are 120V and draw more current than I think those things are rated for. I suppose you’re on 230V, but even then, I expect some of your tools will pull a lot of Amps under load.

Running low voltage wires a long way may be problematic, but other folks doing it this way have managed it. Consider shielding or conduit. Some people have used WiFi and satellite Arduinos that report the status of a subset of the tools.

As you’re new to coding, it’ll be tricky. Consider building the system away from your workshop and simulate the blast gates and vacuum with LEDs. Use pushbuttons to stand in for the current sensors. Then you can test in comfort.

That said, the system should be simple enough to code. You could do it with the “if this machine is on, do this” arrangement you suggested. An experienced programmer would likely make it more generic and store the rules as data, making the code shorter.

For example, each tool needs one or two blast gates open when it is running. You can store that information in arrays, or better, arrays of struct and just iterate through all tools and open the gates needed.

Hi Wildbill

Thanks for taking the time to answer. I watched an insante amount of Youtube videos lately, but - as always - none of the folks who were kind enough to film their efforts had exactly the same setup or ambitions.

Now about these current sensors, they are rated for 30A. You assumed right saying that I’m on a 230V part of the world, but the Grid current is actually 3x400V (230V beween L & N, 400V between two L) and the most powerfull motor I run is 6kW. Last time I checked, the “P=UI” rule was still standing. Applied to a 3phase asynchronous motor, we get I = P / (U.Cosφ. η. V3). → if I take a η value of .8 and a Cosφ of .8, I get a 11,2A. I think it the sensor should withstand. I’m not even sure I don’t have to divide it by 3 since I only measure on 1 of the 3 phases. Anyway… It’ll do :wink:

I will definitely have to run 24V wires with lengths of around 10-15m, but this should not be an issue since the power I need is really low (1,3W).

I expect it to be tricky, and it looks like a good advice to code everything from the comfort of my desk. I intended to do so using the valves themselves. When they are activated, the solenoid “clicks” like a relay, even if I have no pressurized air. I can put the sensor on a lamp or anything and test with the input the sensor. I won’t build 6 “lamp and sensor” things, 1 or 2 should do the trick.

Finally, storing rules as data or using arrays is definitely the kind of advice I will need when I get to actually coding the thing, but I’d like to first address the hardware part, since it’ll condition the way I code it.

Any thought on the way I connected it or on the way I should wire my push button for the lathe? (I’m not sure my schematics are large enough… I did this using Axure RP but only shared a screenshot so far. If you can’t read it, please say so, I’ll try and find another solution to share it.

The diagrams are readable - unusually so for a first post :wink:

I assume that your lathe’s manual button will take care of latching on & off although it’s no big deal if it doesn’t. Wire it to pull a digital pin to ground when the button is pressed and use input_pullup as the pinmode. Reading LOW on the pin means it’s pressed.

The same concern about long wire runs and interference applies equally to that lathe button though. Testing will tell.

As to the current sensors, I now see that there are many different ones with various current ratings; the laws of physics are indeed still in effect, so your 30A ones should do nicely.

About the “latching on & off” part, I assume you mean that the dust extraction should start when the button is pressed once, then remain ON until the button is pressed again. If I’m correct (and the page I favourited about that is correct ;)), I can do that using variables like “buttonState”, “lastStateButton” and “loadState” in order to do keep the extractor ON.

I’m not sure I got the wiring of the button thing… Did you mean something like this?

I meant that I was expecting the button to physically latch, so that when you press it it stays on and when you press it again it releases. My bandsaw, drill press and vacuum work this way for example.

It doesn’t matter though, as you say, you can do the same thing in software.

Wiring is right. Don’t forget pinmode.

You’re right, I could try & find a button that physically latches… :smiley: Since I didn’t buy it yet, it won’t even crash my budget !
When you write “Wiring is right” do you mean it only for the button of for the whole thing?

I looked for a solution on various electronics online shops, but couldn’t find a suitable piece of hardware to “join” cables. I’ll end up with 6-7 cables going to 5v and the same to GND… How should I put them together? I could solder everything in a big mess (keep in mind I bought my first soldering kit about 3 days ago… :grimacing:), but I think it really wouldn’t be quite “up to industry standards”

I was referring to the button wiring - I’m more of a software person so I will leave the critique of your circuitry to the folk that know it better.

That said, if you need multiple ground connections, look for a terminal bus bar.

Thanks Wildbill. It already helps a lot to have a first opinion!

any “circuitry expert” around to have a look at my beginner’s attempt?

I was also wondering what kind of wire (section) I should use to wire all of this. Right now, I bought M/F jumpers plugged in the arduino & relay module pins, but the cables are about 10cm (4") long, and I’m pretty sure it will be a problem when I get to put everything together.

  • What kind of section to go from arduino pin to relay pin?
  • How to handle connectors? Should I find connectors to solder to wires, are there some kind of crimp connectors?
  • What kind of section to go from relay module to 24V solenoid valve (max distance : 15m - 50ft - power: 1,3w)

I’m not sure if I should move this topic from project guidance to another section. Please don’t hesitate to do so if it’s now at the wrong place :wink:

depending on how elaborate you want, look at 22mm buttons.
they come in a range of colors. some mushroom head, some push once, need to turn to release (emergency stop)
some with lights.
they typically have a button and a separate contact. or multiple contacts.
most suppliers also offer a simple case you put them in.

another option people use for current sensing is a CT or Current transformer.
it uses a rather simple circuit to be able to bring that into an Arduino.

From what you have said, and the logic and clarity of your schematic, it seems you have a really good grasp of the project. Success is almost assured as you are not missing ‘step 2’

since almost every Input or output can be translated into turning an LED off or on, you can run wires across your shop and test with LED’s. if you can light it up, you can send or receive the signal.

one thing I would offer is that your Arduino power supply be for your Arduino.
a separate power supply should be for the relay module.

do not try to power anything from the Arduino board.

:smiley: Step 2 is indeed really important in my case. And I can be more explicit about it. It’s the moment I get to create a code for this.

I considered the option to use a Current Transformer. I even bought one (SCT013 - 100A - 50mA) cut the jack 3,5 attached to it, then realized that if I didn’t want to fry everything, I would probably need a burden resistor (although it depends on the exact type of SCT013, which is not easy to find), then I realized the output of this thing was AC, so I needed something that the Arduino could handle, and that meant I would need something like a diod bridge rectifier (?) and the ability to interpret the signal coming from this thing.

At that point, I realized I was not playing out of my league, but out of my sport entirely, so I looked for a more user-friendly solution and came across the ACS712… which seem a lot more convenient for my use.

Could you please explain why I should have a totally different power source for the Arduino? I learned somewhere (I think it was with Robojax on Youtube) that the best solution was to power the Arduino from the Relay module… Is that wrong?

Do you think the wiring, as it is now, should work OK ?

Relay modules with multiple relays tend to have two ways to power them. There will be a jumper that lets you power them from the Arduino or to use a separate power supply.

Separate power is preferred because the Arduino cannot provide enough current to switch all the relays on, especially in your case where you have so many.

Also, your board has optoisolators on it to defend the Arduino from inductive spikes from the relay coils. Connecting Arduino power to the coils defeats that protection to some extent.

So, if I understand you correctly, it should look more to something like this:

Not really, the Arduino and relay board still have common power and ground. Personally I’d rather they had separate transformers.

But I still need a ground connexion between the GND pin of the relay module and the GND pin of the Arduino, right ? That would give something like this then:

That’s it I think, now the Arduino is only connected to the digital logic part of the relay board.

Great! Thanks for the tip. I’m still waiting for the ACS712 current sensors to arrive (Should be somewhere this week…).

In the meantime, I’ll start this evening outlining use cases and try to create a structure for the code. I’ll come back when I have “something”… I doubt it will be any good, but it’ll be a start :wink: