Controling 12v relay with arduino based on pressure value

Hi there, I am working on making a gauge setup for my car. Two pressure sensors and a temp sensor. Anyway I would also like to add a relay that is activated when the one pressure sensor reaches 15 PSI. What hardware is needed to make my arduino r4 minima capable if activating a 12 volt relay and what is a basic sketch of coding to accomplish that? I am fairly new to arduino coding.

You need code for the basic handling of each input or output device. Use relay modules that use the same voltage as the controller Vcc.
When You master those devices You can make the logic how an input will make an output react.
Power for the various devices must be considered.

I have the basic coding outlined for the inputs at the moment. I am waiting on some more parts to complete the whole setup and then write the coding for the nextion display. How likely am I to fry my arduino trying to trigger the relay? Would it be something that either it will not be powerful enough to trigger or possibly it would trigger it but then overheat after prolonged usage? I would obviously have the relay powered from 12v and and just be using the arduino to trigger it with 5v. I am mostly worried about it overheating, if that isnt a concern I will just try it and if it doesnt work i will have to go to plan B.

When people ask in general, the answers will corresponds to those questions. If you're serious, provide such information as the devices in question and their datasheets, and a circuit diagram or schematics.

Please explain.

A good chance.

What do you mean by "relay powered from 12v"?

I see a possibility to use less number of voltage converters in the build.

How would that be? The relay I need to trigger is a 12v rated for 40 amps that will be powering a 150 psi water pump. I have a 12v relay that I am questioning wheter it might work. Is there a 12v relay of sorts that can be triggered with the arduino?

Okey. Is it a "naked" relay without board and driver?
If it is You use a logic level Nchannel MOSFET to drive the relay on the low side. The Arduino outputs don't handle 12 volt and are limited to 20 mA. That will hardly be enough for Your relay.

There are relay modules, having the relay driver onboard, but if there is anyone capable 0f 40 Amp, I don't know.

Ok that makes sense. Yes it is just a bare relay without a board. So what i will probably end up doing is using two relays. A lower power one to power the bigger one unless i can find on that can be triggered by the arduino and power my motor.

You came here for advice about controlling a relay. You have now decided to use another relay to control the relay, which no one here suggested. Why not use a third relay to control the second relay, if you love relays so much?

You don't need any relay. A high-power MOSFET like IRLZ44 can probably switch the pump, and the mosfet can be controlled directly by an Arduino pin. Depending on the pump current, you may need to attach a heatsink to the mosfet. You will need a flyback diode to protect the circuit from reverse currents when the pump gets switched off.

If you must use a relay, you will need a transistor (could be a small mosfet or npn) to switch the current to the relay coil. The choice of transistor depends on the relay coil current. A flyback diode Will be needed for the relay coil and another flyback diode for the pump.

To give good advice, we need the specifications of the pump and the relay.

Ok, thanks. I will have to get a MOSFET I believe. I was not sure what to search for other than relays. The pump is 12v 30amp. If I am understanding correctly I will need a diode between the MOSFET and the pump and also one between the arduino and the MOSFET?

n00b; automotive electronics; 12V, 30A pump; off to 'mosfet city'
how could this go wrong ?

MOSFET, not a good idea.
The IRLZ44 has an on resistance of 0.28 ohms. With 30A, it would dissipate 25 Watts.
You'll need a big heatsink and a fan to keep the mosfet cool.

Use a relay.

That's a lot of amps. This is the first time you have mentioned this. You mentioned that the relay was rated for 40A. And that the pump is rated for 150PSI. But neither of those figures tell us how many amps the pump draws. What is being pumped?

@jim-p is correct, it's not going to be practical with a mosfet. So stick to the relay idea. But you will still need a transistor of some kind to drive the relay coil. That's why I asked for the specs of the relay, so we can recommend a transistor. The coil resistance is the figure we need for that.

You are not understanding correctly. These are flyback diodes.
For the relay coil, I expect an ordinary 1N4001 or similar will be ok. But for a pump with 30A draw... I don't know what to suggest.

Ok, sorry for the lack of clarity. The pump is pumping a water methanol mixture. I don't have any info on the relay other that 12v max 40 amps (cheap ebay stuff). I believe the pump pulls 30 amps. I want to set it up to activate the pump at 15 psi boost and turn it off again below that. The pump will never be running for more than 30-45 seconds max with equal or greater off time, so that will help with the heat most likely? I could try testing the relay tonight. Would it be a good idea to use a MOSFET to trigger the relay? (I could not find any relay suitable for my setup)

IRLZ44 is probably overkill for driving a relay coil. A small npn or n-channel fet like BC337 or 2N7000 might be sufficient.

@jem003 measure the relay coil resistance. From that, you can work out the coil current.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.