Controlling a solenoid with hall sensor

Alext123

New Member
Hello all.
First of all my electronic knowledge is very very limited and this is not my field. So please excuse my lack of knowledge in this area. Also I accidently posted this in a wrong section, so sorry for a duplicate post.
I am working on a hobby project which I want to use a solenoid to open and close a latch.
To accomplish this, I'm planning to use 2 hall sensors.
A shaft which rotates clockwise holds a magnet in place and passed the first hall sensor at 6 degree which will send a signal to cut the power to solenoid (close state which the solenoid spring close the latch) and when the magnet passes the second hall sensor which is placed at 170 degree provide power to solenoid to open the latch.

Doing a search I came across PICAXE 8 pin Motor Driver Board
http://www.rev-ed.co.uk/docs/AXE023.pdf

Do you think this will server the purpose of what I'm planning to do?

Also I want to add some logic as when to open the latch ( maybe every other revolution). Does this board have such a capability?
My logic is something like this

hall sensor1 is installed at 6 degree on a disk
hall sensor2 is installed at 170 degree on the same disk

the shaft starts to rotate (RPM between 400 – 3000)

magent passes sensor1
cut the power to solenoid regardless of which state the solenoid is

Magnet passes sensor2
if (counter = 1)
provide power to solenoid to open the latch
counter = 0
else
counter =1

Also I like to know if someone can guide me as how such a circuit should look.

Thanks so much
 

MartinM57

Moderator
Intriguing....and more detail needed

What sort of solenoid, what electrical specs - got a part number in mind?...

...and your going to have the solenoid opening/closing for 164 degress of rotation at up to 3000rpm? Sounds like you will end up with a buzzer, rather than a solenoid ;)

What are you really trying to do? More detail will allow a view on a solenoid-based (or other technolgy) solution. Are you trying to fire bullets through a propeller or somesuch?
 

geoff07

Senior Member
Short answer: probably not!

Just some thoughts that you might like to consider:

- 3000 rpm implies quite a short path length in the code given the 4MHz clock speed of the chip. I doubt that you would get the level of response you need, you should do the calculation. The chip runs basic instructions at much less than the clock speed due to the translation of basic into machine code. You might need a more expensive chip that runs at a higher clock speed (for example the 28x2 module can run 8 times faster than the 08, but costs more). Even then, path length may be an issue.

- this is a very basic board with minimal capabilities and you may well want more inputs, for example. If you have two sensors you might need external electronics to multiplex them into one input with this board. If you need to distinguish between them then you certainly need more inputs. And then how do you change settings once it is running? I have no Hall effect transducer experience so can't really help with interfacing.

- you only get 4.5v (max) to actuate a solenoid, if you need more then you will want to include transistors or mosfets and that suggests a more complex project board

- can solenoids operate at 3000 operations/second? That seems challenging!

For a prototype at least I would consider something a bit more capable (CHI035 for example, with more inputs, split power, back emf diodes and high current outputs). Once you have it working you can engineer it back to a minimal setup.

For a more detailed response you should provide some more info (what hall-effect sensors, what solenoids etc.). Also, what is the application?
 

Alext123

New Member
Ok I'm planning to build a model cam less gas engine and want to operate the exhaust valve with solenoid (electronic controlled valve). I have experience building model engine and have build a few.

Also looking at PICAXE site, it tells me 4 MHZ chip can generate up to 10,000 PICAXE BASIC commands per second. So shouldn't the response time be sufficient given max RPM of 4000 which is 66 turns per sec?

As far as the solenoid, I'm looking to use a linear push style that can operate on 6V - 12V with .25" stoke length.

Here is a engine in youtube that is using solenoid
http://www.youtube.com/watch?v=GGnT58gRAz8
 
Last edited:

graynomad

Senior Member
A couple of people have mentioned the solenoid running at 3000 ppm, I think that will be your main problem. Personally I can't imagine one running that fast but maybe. I suspect it will hover somewhere between on and off.

At 3000rpm you have 333uS to do stuff, I'll leave it for the Picaxe experts to say if that's possible but one thing to think about is the timing, presumably you don't want to open a valve at the wrong time and your talking about having a sensor at the 6 degreee point, that implies that 4 or 5 is not good enough. This means that the timing has to be accurate to say 1/360th of the above 333uS, or 1uS approx. That migh tbe tricky with a chip that is basically running at a similar speed.

Do you even need a micro, you mentioned using logic. There will be a lot of devils in the details but maybe just a D flip flop wired as a counter (Q -> Q*) then

magent passes sensor1
cut the power to solenoid regardless of which state the solenoid is
Pulse goes to RESET of FF.

Magnet passes sensor2
if (counter = 1)
provide power to solenoid to open the latch
counter = 0
else
counter =1
Pulse goes to CLK of FF.


Also, how many activations is the solenoid garanteed for? Even if it's 1 million thats only 5 hours of use before it's expected to fail.
 
Last edited:

Alext123

New Member
http://www.rev-ed.co.uk/picaxefaq.html

How fast does the PICAXE operate?

The PICAXE-08/18 microcontrollers have an internal 4MHz resonator, and the PICAXE-28 uses an external 4MHz ceramic resonator. This means the microcontroller processes 1 million assembler commands a second, which equates to roughly about 10,000 BASIC commands per second.
 

MFB

Senior Member
I think that piezo technology is used for high-speed actuators, but this involves voltages in excess of 12 volts (e.g. dc-dc converter). If electromagnetics prove too slow, it might be worth doing a search for piezo electric actuators.
 

BeanieBots

Moderator
Hmm... an optimistic claim.
In my experience, at the default clock speed of 4Mhz most commands take about 250uS which about 4000 BASIC commands per second.
Also, when it comes to maths, it depends a lot on the values being calculated.
Try it!
 

hippy

Ex-Staff (retired)
Some slight confusion over RPM and how many per second; 3000 RPM = 50 per second, 20ms per revolution. With the two sensors 164 degrees apart that's about 9ms between sensors.

A PICAXE 08M could be up to the task but I'd personally just use flip-flop hardware as that's all the PICAXE would be programmed to do as graynomad suggests ... unless there's more to the requirements ?
 

Alext123

New Member
Well I like the idea of using a FF.
Can you please recommand what FF to use?
Again since I'm very new at this, can you please suggest how the circuit looks like?

Thanks
 

hippy

Ex-Staff (retired)
The flip-flop itsef is quite simple, either as a flip-flop package or constructed from a NAND gate package. The real question is what are your hall sensors and what is your solenoid ?
 

Alext123

New Member
For now lets forget about the RPM, so I want to make the circuit and program it to do what I want even at very very low RPM, then I can improve it as I go. Maybe even use a high-speed actuators.

As far as the solenoid, I'm looking to use a linear push style that can operate on 6V - 12V with .25" stoke length.
For hall sensor, it can be any that operates at 5 - 24 volts which is activate with a magnet.


Thanks
 
Top