I quiet good in programming but a noob in electronic. I'm currently trying to make a pinball and it's quiet hard^^
My issue :
I have a 24V and 3 amperes DC input to run the two bats of the pinball (using solenoid coils). I tried to use an H bridge L298n between them and it works great.
Now I need to use this same DC input to run another solenoid coil to load the ball in the shooter, but this solenoid needs 24V and like 1 ampere (with 3 amperes, everything is burning). How can I keep 3 amperes for the bats, and reduce to 1 ampere for this one ?
If you have a power supply rated for 3 Amps you'll only get 3 Amps if the solenoids require it. Ohm's Law says Current = Voltage / Resistance. Usually solenoids (and motors, etc.) don't have a resistance spec, but they have a current spec so you could calculate resistance.
What is "everything"?
If you "pull" too much current from the power supply "bad things" can happen.
You could disable the bats when the ball is loading. But you really should have some reserve power.
You don't need an H-driver unless you need to reverse a motor or bi-directional solenoid.
A simple MOSFET driver may work better (maybe less voltage drop).
The wiring is quiet messy, I thought the explanation would be enough, but you will find the specs below in another response and I tried to draw a diagram. As I said, I'm a beginner
There are three different solenoid voltages in that link.
Which one do you have.
You should be driving the solenoid with a logic level mosfet instead of a relay.
That would also be easier on the supply of the Mega, and you can use PWM if needed.
If you keep that relay, then add at least a kickback diode across the solenoid.
Your relay could soon fail closed without it.
Leo..
No, it's not normal. I think you have a solenoid rated for a lower voltage then 24V. What you are seeing is what you would expect for a solenoid being powered with a higher voltage than it is designed for.
I really think you need to check and double check this because what you describe is what you should expect if the solenoid is rated for a lower voltage than 24V. Using a MOSFET won't make any difference, it will still be being fed with a higher voltage, and therefore current, than it is designed for.
Well, I would suspect that it's wrongly labelled. Do you have a 12V and a 6V power supply? I suggest you try it on 6V first, then 12V, and in each case see if it overheats and see if it works as expected. Just connect the solenoid across the power supply without any other components and see what it does.