question about voice coil motor from HD and Arduino 5v to power it

Hi!

I'm a photographer from belgium and used Arduino's before too shoot high speed photography and control a photo booth for an event of friends.
I get the basic switching on and off of power to and from other hardware but for my latest project I have hit a bit of a brick wall.

At the moment I'm making a shutter out of old HD using the VC motor arm to open and close a hole.
Pretty simple construction and I thought it would be a perfect match for the Arduino since it outputs 5v, the same as the power supply of most HD's.

The arm moves very fast when connected directly to 5v and ground. No result from digital pin out. No result with a 4n25 optocoupler. It draws too much current. I got it working with an NPN (2n2222) between 5v and the VC. But with one between 5v and ground I again get nothing. So it is impossible to get an H-bridge. Also the arm moves slower with the NPN.

This is were my knowledge of electronics fail me. Is this something I can solve with a capacitor or other part?
I would rather not use a second and different power supply since the final build would have to be a bit mobile to be useful.

My gut tells me too destroy a flash and use whatever parts creates the high voltage, my brain tells me the house will burn down....

Thanks in advance for any help!

p.s. check http://www.spark.ph/work/the-lab for my arduino related photography work

edit: in advance, I have been googling answers too this for some time, either I'm using the wrong search terms, or the answer is so simple no one ever needed to ask, but I have not yet found a good answer to my ignorance :wink:

[HDDs use 12V for all the motors and suchlike, not 5.]

The voicecoil armature will take several amps easily but is designed to operate
as a servo which it can only do with the heads and platters in place.

Driving it open-loop it will slam into the endstops hard with 12V, so probably will be better
at 5V. You need an H-bridge to get drive in both directions - so either add a spring-return
and use a suitable single switch (logic level MOSFET springs to mind), or use an H-bridge chip.

The motor should not be powered from the same 5V as the Arduino, it will pull too much
current. A 2N2222 almost certainly isn't beefy enough.

Any inductive load needs free-wheel diodes, check out the playground pages for how a relay
or solenoid is driven.

MarkT:
[HDDs use 12V for all the motors and suchlike, not 5.]

Laptop drives and bus powered USB drives use 5v to operate unless there is some part on the pcb of the drive that transforms it into 12v.

MarkT:
Driving it open-loop it will slam into the endstops hard with 12V, so probably will be better
at 5V. You need an H-bridge to get drive in both directions - so either add a spring-return
and use a suitable single switch (logic level MOSFET springs to mind), or use an H-bridge chip.

I'm using a spring at the moment to pull it back faster. (since it is a shutter, open and closing time is essential) An H-bridge would be better. 4 transistors make an H-Bridge, I just need some way to get enough current through the H-bridge keeping the forward current of 2 transistors in mind.

MarkT:
The motor should not be powered from the same 5V as the Arduino, it will pull too much
current. A 2N2222 almost certainly isn't beefy enough.

Why isn't a 2N2222 good enough? Is it not good enough for 12v? This is also not important, I can choose any transistor for my final design, it is the VC and the 5v of the arduino that have to work together for this to be practical.
At the moment it works fine with one 2N2222 connected to 5v, but it isn't ideal.

Wouldn't it be possible to use a capacitor like a flash? Something to just store a bit more current until needed, discharge to generate just the amount of force to swing the arm, charge again, and discharge to swing the other way.
Or with 2 capacitors, one for each direction?

I have no idea if a capacitor is the right part, it is just something I remember from how flashes work and it seems like the right solution.

RomainM:
Why isn't a 2N2222 good enough? Is it not good enough for 12v? This is also not important, I can choose any transistor for my final design, it is the VC and the 5v of the arduino that have to work together for this to be practical.
At the moment it works fine with one 2N2222 connected to 5v, but it isn't ideal.

All devices have limits, a 2N2222 cannot carry large currents that such
a coil can readily pull - power MOSFETs are available to handle that current level.

Measure the resistance of the voicecoil and calculate the current that would flow
from 5V and from 12V, you'll see its large, probably in the 2 to 5A region. A 2N2222
will struggle above 0.5A and must never exceed 1.0A.

Wouldn't it be possible to use a capacitor like a flash? Something to just store a bit more current until needed, discharge to generate just the amount of force to swing the arm, charge again, and discharge to swing the other way.

Yes this can be done and often is with solenoids, but first you have to be
able to switch the current - capacitors can be used this way to limit the
total charge flow in a pulse, but that's trivial to do by timing in software.

You may need capacitance to decouple the supply to handle the current spikes,
but that's not quite the same.

Or with 2 capacitors, one for each direction?

Extra complication, you still need 4 switches anyway.

I have no idea if a capacitor is the right part, it is just something I remember from how flashes work and it seems like the right solution.

In a flash you are generating 100's of volts to power a xenon discharge tube, and
the capacitor is chosen to match the energy needed for the tube in question. This
means the inverter can be small and cheap.

MarkT:
Measure the resistance of the voicecoil and calculate the current that would flow
from 5V and from 12V, you'll see its large, probably in the 2 to 5A region. A 2N2222
will struggle above 0.5A and must never exceed 1.0A.

I measured the resistance of the Voicecoil using a 5v/12v 2A power supply
at 5v it is using 400mA, at 12A, it is using almost 2A

This power supply could be used to power the arduino with the 5v pins and the VC with the 12v pins.
Although I'm not sure how long the voice coil will survive the 12v abuse.
It generates a lot of heat when using it the way I'm using it. (long times at full power)

A mosfet is not an option as a switch since these are slow.
It needs to be an optocoupler or equally fast transistor. At the moment my fastest shutter speed is 1ms, using slow transistors the power get's cut of before the transistor opens.

Any idea for a replacement for the 2N2222? I also have 4n25's (6pin), but they also draw too much power

Another solution (altough silly) would be to use 4 capacitors capable to hold 100mA and let them be "slowly" charged by the Arduino.

Thank you for the replies