Hello I’m quite new to electrical work and I’m trying to open and close a solenoid valve with a battery. I have bought these tiny 23a 12v battery. The solenoid says it needs 12v dc. I have no idea why it’s not opening all Insaw were some sparks. The battery can output 55mA but other than that I can’t tell you much. If anyone could tell me what battery I should use it instead that would be great as I wasted money on these batteries and I don’t want to waste money on other batteries that don’t work
Looking at the size of the solenoid: that thing is meant to have a lot of power.
Your battery is not meant to provide a lot of power, at all.
This won't work.
You need a battery with higher current capacity. How much – hard to tell, but maybe the label or definitely the datasheet of the solenoid would tell you.
To test, use a 12 V power supply that is certainly able to drive this (a lab power supply, a car battery, …), and measure the hold current, and if you have an oscilloscope, also measure the turn on current. Then you'll know what kind of current your battery needs to source, and then you can pick a battery.
Those tiny batteries can't deliver the current the solenoid needs to activate. How much current it needs depends on the type of the solenoid.
You could try with 8 AA batteries in series, or a 12V Sealed Lead Acid battery, but for a definite answer we would need to know the specifications of the solenoid, and how often you plan to activate it.