Using pressure switch outside of frc

So for an outreach event, we are modifying a trashcan to open with a pair of pneumatic cylinders. We have everything plumbed but we have absolutely no idea how to wire anything. We’ve used pneumatics before on the robot but we used a pcm which makes everything really easy. For our outreach event, we are not using a pcm and are controlling everything via an arduoino. The reason we are not using a pcm is because we don’t think a pcm can work with an arduino.

So, can you connect a pcm to an arudino, and if so how would the programming aspect work?
If we don’t use a pcm, how do we wire the pressure switch with the compressor so the compressor turns off at the right pressure?

Not sure about using the PCM, but it’s relatively easy to do without it.

The pressure switch is essentially just a limit switch. When closed, you want the compressor to be on. When open, you want it to be off. So hook it up to a digital input and program it accordingly!

For the compressor, you just need a relay. The old Spike relays were nice for this, but not available anymore. Get one that’s rated for at least 20A at 12V DC (I’d go a little higher, just to be safe… the compressor start up current can exceed 20A), or whatever start up current you can expect from your compressor, if it’s not an FRC-legal compressor. There’s a surplus store near here that I’d go to first, pick something up for a couple of bucks, but you can find something appropriate on Digikey too. Activate the relay from the arduino (a digital out to switch between 0V and 5V is probably what you need, it depends on the relay specs) when you want the compressor to run.

Do NOT run the switch in-line with the compressor. It’ll seem to work at first, maybe go through a couple of cycles… and then it’ll burn out, every time.

The pressure switch sold by AndyMark is rated for 5 A with a resistive load. A load like compressor will cause the contacts to arc when they open. Eventually, the contacts will weld closed and it will never open again. As @Jon_Stratis said, you may get a few cycles before it welds. I have seen tests where the contacts weld on the first cycle.

There are AutomationDirect relays explicitly legal for FRC use, if you want some part numbers to start from. From the Blog for 2020 motor controllers:

Check your compressor current draw. The 25A & 45A versions should work fine. The 12A rated one might fail due to inrush current, but if it doesn’t fail on the first use I’d expect it to work for quite a while after that.

might find a useful 12v relay at an auto parts store…then wire the coil of that relay, through the pressure switch. Connect the compressor to 12v through the relay contacts, but make sure to use the correct pair (either Normally Open or Normally closed) so the compressor turns on at low pressure, and off at high pressure.

I’m assuming you want do do this as simply as possible, and not bother with a computer or processor to control the compressor.

Be sure to include the safety pressure valve, pressure regulator, etc as used on FRC robots.

We already have some relays that are rated for 120v ac at 5amps so I’m gonna take a wild guess and assume that well likely be fine. I understand the part where you plug in the compressor to the relay and the arduino to the relay. How does the power go to the relay? Since I can plug in a compressor and an arduino but I still need 12 volt going through the relay

You want to see what the rating for DC voltage is. As @Jon_Stratis said, the compressor can draw up to 20 A so a switch or relay rated for 5 A will likely burn up.

Often the current rating is lower for DC than AC because the contact arc self-extinguishes when the AC voltage goes through zero V. There is no similar effect with DC.

You should research how to control a relay with an Arduino.

Yes, I want to do this as simply as possible without much processing. I’m having a hard time understanding what you mean. Is there a wiring diagram I can find online?

something like this. Although since you’re using DC, pretend L1 is +12v, and L2 is -12v

pres%20switch

also, for a relay, I was thinking of something like this

https://www.oreillyauto.com/detail/b/dorman-conduct-tite-3354/accessories-16449/accessories---exterior-16767/exterior-lighting-16612/replacement-relays-17672/2db4dc99d100/dorman-conduct-tite-30-amp-5-terminal-relay/88069/4177128?q=universal+relay&pos=5

Thanks. So since L2 is -12V, it’ll connect directly to the compressor with a direct wire from the power output. +12V will plug into the normally closed in the relay and in the the other compressor wire will plug into the common port in the relay.

The pressure switch is where I am confused now. What is the wire from L2 going to the relay? And does the little bump mean anything? Whats the squiggly thing on top of the relay switch?

That’s very interesting. I wonder why I’ve been so lucky with my test bench setup.

I’ve run the pressure switch in-line on it for hundreds of cycles and it still works fine.

1 Like

Are you running off a battery or a “wall wart” power supply?

How big is your compressor? How much current does it draw?

We did this once, a long time ago, for a non-competition project, using an FRC-standard compressor (the old Thomas compressor) and a battery. It didn’t last more than 1 evening of tinkering and testing.

This compressor https://www.viaircorp.com/ig-series/250c-ig
tldr max 11 amps at 120 psi
Straight to the battery with the switch wired in-line.

1 Like

The little squiggly thing is the coil in the relay, that is what activates the relay. It should appear on the diagram on the housing of the “real” relay, in a similar way. The coil needs to get positive and negative voltage, to close the switch that turns on the compressor motor. The coil gets this voltage from the 12v source, and it’s switched on and off by the pressure switch.

I’ve been playing with electric stuff like this for 50 years, I forget that it’s not obvious what a schematic means, to folks who are new to it.