question solonoid/reley setup

Hi All

i wanted to ask if my setup looks alright before I eventually burn anything or if there was a better way. I´ve been googling and youtubeing, but there is somtimes to much stuff :slight_smile:
should there be another rectifier diode with the solonoid ?
can the transistor on the pic be used ?

my plan :

use the arduino pro mini 5 v to control the 12V solonoid valve
use a 12V battery, and with that use 2 resistors equal in size to divide the 12v into 6v, before sending it into a 1117 5V regulator. this unit will supply the arduino pro mini 5v.
use the direct 12v for the solonoid.

Use a 12V battery, and with that use 2 resistors equal in size to divide the 12v into 6v, before sending it into a 1117 5V regulator. this unit will supply the Arduino pro mini 5v.

You can't use a voltage divider to supply power. As soon as you draw any current the voltage will drop and you will get next to nothing out. Use a buck converter with a 5V output and feed the Vcc pin.

A relay is some contacts operated by a solenoid, there is usually no point in having a relay operating a solenoid. Use an N channel MOSFET capable of driving the solenoid directly.

Is the 12V battery really 12V? Usually when people mention 12V batteries they mean a lead acid battery, which can have a voltage of up to about 15V, have you taken this into account?

The one thing you got right is the diode across the relay coil.

Please post a proper schematic, what you have posted might look pretty but it's next to useless as a schematic. Hand drawn and photographed is much better.

Do some searching on this site, there are plenty of examples for this kind of thing.

this pic show the battery intended

this was the components i had.
Can i feed the 12V directly into to the ams1117, and thereby cut out the two resistors.

the relay is only because of the 12v and i didn´t want any thing going back to the arduino

Can i feed the 12V directly into to the ams1117, and thereby cut out the two resistors.

Yes, but I still recommend a buck converter. A linear regulator dumps excess voltage as heat, in your case 7/12 of what is fed to the Pro Mini is wasted as heat, that's 7/12 of your battery being wasted.

If the output of the AMS1117 is 5V then feed it to the 5V pin, not the raw pin.

The relay is only because of the 12v and i didn't want any thing going back to the Arduino.

It will be fine with a correctly wired N channel MOSFET.

ok i have now made the schematic, as requested for easier understanding/reading. and i have also inserted a buck converter that can handle from 4,2v-40v dc in input, and can give out 1,2v-37v and has a max of 1,5A (its based on the lm317 its allso adjustable in voltage output.......has allready been ordered from china)
i have allso looked at mosfet and it seems easy to use with basic any voltage, but since i have the relay im gonna stick with that as long as it works.

before i order any pcb´s ill make sure that i have the mosfet as well,.

i hope its not to much nonsense from me being a newbie in this area. (hence all the questions )

That is FAR easier to read :slight_smile:

Q1 is wired incorrectly, I leave it to you to research the correct connection as there are loads of examples here.

As far as I could tell on your original 'schematic' you had D1 wired correctly, now you don't. It should be across the relay coil as you had it before, cathode to positive.

There is nothing supplying power to the relay.

When you build this wire it so the solenoid has its own wires back to the battery so that its negative connection meets the buck converter negative at the battery so they don't share the same wires.

Lille_Viking:
this pic show the battery intended

An A23 battery (internally made with small button cells) can barely provide the current for the ProMini.
I doubt it also can power a relay (for more than a few seconds).
It certainly can't power the solenoid you have drawn.
Leo..

now it got power as wel as the diode has been reversed.and the solonoid gots its on line back....
hope all is ok now :slight_smile:

by the way do i need a diode over the solonoid as well ?

regarding the batterym i took it for 23 AMPS not for the type of battery, but ill proberly go for a 12v adapter with 1 amp instead .

Lille,
Please search this forum for the correct way to wire up a transistor to a relay or anything else for that matter. It looks like you are guessing.

Thank you.

Why a relay and a solenoid.

With the right transistor you can switch the solenoid directly from the Arduino pin.
A TIP120 with 1k base resistor could do.
Leo..

Wawa:
A TIP120 with 1k base resistor could do.

"Could do" indeed, but even that is a very poor choice!

Before I pontificate on the correct FET for the purpose however, I would want to know the identity of the solenoid. Please cite the Web page which gives its specification. :astonished:

You only use a battery to operate something when you simply cannot arrange a power cord. Which usually means it is on wheels. :grinning:

Hi,
This is what I think the OP istrying for.
Comment/Edit as you will.

sorry if was looking like i was just guessing, dont have to much know how in this area, but i am trying.
found this article on this site, and the schematic has been adjusted accordingly.

https://create.arduino.cc/projecthub/tarantula3/driving-a-relay-with-an-arduino-722c24?ref=search&ref_id=relay&offset=9

the idea is for a daily use piece of hardware for my job, that can give me the adjusted water volume, by simple connecting a hose in one end....... i often need to measure 20-40 buckets of water with specific volume.
and the code is almost done , just put in some leds to see if the signal is coming the right places, as well as the use of the serial monitor. when im all done i will upload the project for use to others.

Hi,
Connect 5V to Vcc, leave Vin disconnected.

Tom.. :slight_smile:

it is. the green is connected pins , and the red pins not connected......not easy to see as it runs over both

OK, but if you reveal the specifications of the solenoid itself (Web reference), a FET will likely be able to control it directly without the relay.

there you go... these are the only specs i have on it

Lille_Viking:
sorry if was looking like i was just guessing, dont have to much know how in this area, but i am trying.
found this article on this site, and the schematic has been adjusted accordingly.

OK, much better :slight_smile:

Lille_Viking:
there you go... these are the only specs i have on it

Unfortunately that doesn't tell us what we need to know. We need either the coil resistance, from which the current can be calculated, or the current. Neither is stated. Do you have the solenoid? Do you have a DVM of some kind? Can you measure the coil resistance?

Hi,
I did a google ebay search, found this as one of the accompanying pics.
4.8W 12V.
Power = V x I
I = P / V = 4.8 / 12 = 0.4A