I'm looking for a simple way to make Arduino press a spray button. I don't care which button to use, it can be either this type:
or the following:
I know there are ways to solve this problem using a servo, but I'm trying to think about a simpler way that won't demand an engine (or will demand one but will be simple to implement).
I thought of the following - Perhaps I could place a weight on the cap of the spray, inside a solenoid and connect the solenoid with electric wires to the Arduino. I could pass current in the solenoid and create a magnetic field which will press the weight which in return will press the spray cap. The Arduino will control when to pass the current and when to halt. A sketch of the system is shown in the drawing below:
I'm not sure if it's possible (If I can get enough force to press the cap without a huge solenoid or extremely high currents which I can't produce at home) so I'd like to hear your opinion.
I thought it will resemble the principles of operation of a magnetic train such as this one.
The math:
I can use the following formula to calculate the magnetic field within the solenoid: $$ B = \mu nl $$ where $$ n = N/L $$ It probably won't be the exact magnitude of the magnetic field since the formula is ideal, but I guess that if I take a solenoid which produces bigger magnetic field (in magnitude) it will compensate for the inaccuracy of my ideal state calculations.
now I can use this formula to calculate the force which is applied on the weight when it is pressed and reaches a steady state: $$ F_{gravity} + F_{solenoid} $$ when $$ F_{gravity} = mg $$ and $$ F_{solenoid} = IBl $$ where I is the current which flows through the solenoid and I determine it, B is the mangnetic field inside the solenoid which I already clculated (depends on the type of solenoid I will choose to work with) and l is the solenoids length. The forces are shown in the force diagram below:
I can calculate the desired force for the button pressing using something like this solution.
From the former I can calculate choose the solenoid type and the weight which is needed.
My questions are:
What do you think about the solution? Will it be easy to execute? Is it an overkill? what other idea do you have?
I'm not sure which solenoid to choose - when I looked at some solenoids for sale, they never mention the n factor (how many turns per unit length) or the permeability factor mu.
I'm not sure how to calculate the drag of the air which occurs at the beginning of the movement and may diminish the net force I get which the weight "feels". Perhaps it can be neglected since it'll operate for very short period of time (when the button will be pressed it'll stay like this in the exact location without any velocity, so the drag will be 0 by this equation)?
Thank you.