Power and MOSFET problems

Calamitie

Member
Hi all,

I realise that I don't post very much, but I've never really seen anything I can help with (my knowledge in electronics is not at a 'pro' level, but equally not at a 'noob' level either hopefully :p).

I've started my first 'real' PICAXE project (I've just been playing around with various things so far); it's an RFID access control system for our new shed.

I've got a Parallax serial RFID module (~4.5V - which works extremely well, if anybody's interested), an electric door strike (~12V) and obviously an 08M PICAXE (I'm getting a larger chip shortly).

I've got the 'system' identifying certain RFID tags and bringing a pin high when authorised (which, in turn, lights an LED); so far, so good.

Although at this stage, I've run into two problems because of the higher voltage that the strike requires;

I assumed that I could just use a ~5V relay to turn the strike on when a PICAXE pin is brought high, but, even with all the advice I could find at the forum and the third manual, I can't seem to get the MOSFET to work properly (PICAXE -> MOSFET -> relay => strike).

I've used a MOSFET with a solar motor before and, after a few hours of trial and error, I got it working at the (almost) full 4.5V (unlike the ~3V from the PICAXE chip), but I didn't make any circuit diagram (assuming I'd remember later), so I'm stuck now :\

That's my first problem - my second problem is the fact that I have two circuits, one on 4.5V and another on 12V - I only wanted to use one regulated power adaptor to power the whole system, which I assumed would mean getting a 12V adaptor (for the strike) and then using a mini-step-down transformer inside (for the PICAXE + RFID module), but I'm not sure what I should be looking to buy or if it's even normal practice to use one power supply.

Thanks for reading - I know it's quite long, but I'm trying not to be that vague :p

I'd really appreciate any suggestions as I've spend almost an entire weekend messing around with the MOSFET just to get the full voltage correctly and trigger the relay, but haven't stumbled upon the solution yet. (any circuit diagrams/photos using a MOSFET correctly would be great if anybody has one)
 

BeanieBots

Moderator
You only need one power supply. A good regulated 12v one that has enough current to drive the door solenoid.
From that, use a 7805 type regulator to generate 5v for the PICAXE.
(don't forget the caps each side of the regulator and 100nF decoupling for the PICAXE).
The PICAXE can then drive the FET which in turn can activate the solenoid. There should be no need for a relay.
Check the interfacing manual for interfacing circuits.
A solenoid is inductive just like a relay so you MUST fit a catch diode as shown in the manual.
What type of FET do you have? It may be the wrong sort for the way you want to use it which could explain the problems.
 

Fowkc

Senior Member
Can you post the circuit you're using to turn the relay on? You sound like you're on the right track. Probably something small to change.

You can (and it's common practise to) use a single power supply. Use the 12V for the strike (and other 12V equipment), and use a 5v regulator to power the PICAXE and RFID stuff. Look up the 7805 regulator (google it). It's a simple 3-pin device, that takes 12V (or any voltage from about 7 to 30V) and outputs 5V. They come in all sorts of different power ratings, but typically you'd want a 500mA or 1A one for a PICAXE project with a relay.

And don't worry about the length of your post, it was pretty much spot on. Clear, consistent, no txt spk, well thought out. Good on that man.

Welcome to PICAXE. You'll never leave...
 

Calamitie

Member
What type of FET do you have? It may be the wrong sort for the way you want to use it which could explain the problems.
I've got the MOSFET shown in the example diagram (manual 3; "output device 11"):



When I was looking for the IR4001, the shop only had the IR4003 - they said it would work the same (and I assume, judging by the little difference in part code, they were correct).

I've just looked at the 7805 on the Tech Supplies website - I can't believe it's that simple! :p (and only ~30p)

P.S. I must have been day dreaming whilst reading the third manual, as I didn't associate the solenoid circuit with my strike :p (I've just had a look at it now).

Thanks for the ultra-fast (and extremely helpful) suggestions :)
 

BeanieBots

Moderator
No probs.
The IRF530 needs at least 4v on the gate to make it work so your 3v is probably not enough to make it come on fully.
The 1N4003 is just a higher voltage rating version of the 1N4001 so it will be fine.
Once you've got a decent 5v running the PICAXE I'm sure your problems will go away.
 

Calamitie

Member
No probs.
The IRF530 needs at least 4v on the gate to make it work so your 3v is probably not enough to make it come on fully.
The 1N4003 is just a higher voltage rating version of the 1N4001 so it will be fine.
Once you've got a decent 5v running the PICAXE I'm sure your problems will go away.
Ah! All of my problems with the IRF530 might have just been a lack of voltage :p (I really should have considered that :|).

I'm still a little confused about how I'll have the PICAXE and RFID module at 5V (from the 7805 regulator), while the strike will be on the same circuit (?) at 12V - especially seeing as they will both be directly connected via the MOSFET? :push:

I'm guessing that the common ground would have something to do with it...

Thanks again :)
 

andrewpro

New Member
If you continue having issues with the mosfet, you could always try a logic level IGTB (Insulated Gate Bipolar Transistor). I always use them for intermittent duty things like solenoids and whatnot. They can be rather inefficient when dealing with constant currents though, so I avoid them for motors etc.

The nice thign about IGBT's is that you can get them to turn fully on at lower voltages than a comparable high voltage, high current FET/MOSfet.

My favorite for this kind of application are the ones intended for automotive ignition systems. You can thwack a lot of voltage and current very fast with them as this is sort of what they're designed for.

--Andy P
 

premelec

Senior Member
since you have a 12vdc supply available you might just use a level converter from the PICAXE 3v to 12 volt drive for the MOSFET... this could be done with a single NPN bipolar transistor driven by the PICAXE with inverted logic - see manual for interfacing circuits.... [2 resistors, 1 NPN]
 

Fowkc

Senior Member
Calamitie said:
I'm still a little confused about how I'll have the PICAXE and RFID module at 5V (from the 7805 regulator), while the strike will be on the same circuit (?) at 12V - especially seeing as they will both be directly connected via the MOSFET? :push:

I'm guessing that the common ground would have something to do with it...
You're right. If there weren't a common ground, then comparing 5V and 12V in different circuits would not mean anything. When the grounds are connected, the 5V and 12V are related to a common point.

You say "directly connected by the MOSFET", but that's not exactly accurate. Take a look at the picture I've posted (hopefully your circuit is superficially similar).

At point "A", the PICAXE will be providing a voltage of 5V if the output is high. The MOSFET gate is very high impedance, so very little current flows through this, and for your purposes is not connected (in the electrical sense) to the strike. When the MOSFET is turned on, there is very little resistance between point "B" and ground (only the resistance of the MOSFET, called RDS(on), which you can find in the datasheet).
Hence, any current that flows will produce only a very small voltage across the MOSFET. Therefore, point B will be close to zero volts, with the remainder of the voltage across the strike.
 

Attachments

Last edited:

moxhamj

New Member
Fowkc's circuit is the way to build it. I'd perhaps add 470uF and 0.1uF across the picaxe supply - this will supply a stable 5V to the picaxe regardless of inrush currents when the strike is turned on. Occasionally picaxes don't like high currents near them - if the picaxe resets when the strike is turned on (>1A or so) then move the mosfet and strike more than 20cm from the picaxe. It depends how big the strike is.

You might also need a 4001 diode across the strike, with the diode stripe side to the top. This will suppress any back emf when the strike is turned off.
 

Calamitie

Member
Thanks for the diagram Fowkc - I can understand how it works a lot better now :)

I haven't yet ordered the 7805 or 12V mains adaptor, so I can't really give you any feedback or working photos/videos just yet :p

I just thought I'd post a reply to let you know that I have actually read both of your posts and that I'm just waiting on supplies.

Thanks again
 

desulfator

Senior Member
Has anyone thought of using optoisolators in harsh inductive or spikey environments?

Might come in handy when driving large inductive loads.

Although my suggestion adds some complexity to the subject, it is well worth a discussion.

In the last year or so I developed a battery desulfator (Charged Inductive Pulse or CIP) that works about 30 times faster than most of the common inductive desulfators based on buck and boost circuitry.

To boost CIP's pulse power further, I began experimenting with low uH, heavy current rated inductors. The flyback kept burning out the high voltage power supply. It turned out that the 1KV spikes on the xformer secondary reflected a 5KV to the primary and promptly shorted the mess out.

Thankfully the micro I was using had spike protection and survived the onslaught.

My ultimate fix was to put blocking inductors between the xformer/bridge and pulse circuits and shift to using H11D1 high voltage optoisolators to insure the survival of the micro and retain modest turn on/off speeds.

http://rocky.digikey.com/WebLib/Lite-on/Web Data/H11D1.pdf

With the optos between the micro and pulse circuits, it adds that extra layer of protection and reliability.

In the event of FET failure it prevents the high voltage now found on the gate circuit from attempting to kill the micro by electrocution.

I think I found this link on the PICAXE board and found it to be very helpful designing the opto circuits for CIP.

http://www.cel.com/prod/prod_optoapp.pdf



Digikey:

Ohhhhhhhhhhhhhhh, by the way, I use Digikey for most of my component purchases. They have virtually anything you need and ship fast!

Transactions with them always go as smooth as silk. Never a problem, unlike other suppliers I've tried.

The absolute best part about Digikey is their search software that allows rapid component selection based on your choices in their menus.

For example, simply type electrolytic capacitor in the search window to try it out.

http://www.digikey.com/

It makes component selection a breeze!

The amazing thing is they are still expanding their offerings.
 
Last edited:
Top