Picaxe Amps

SKL BOI

Member
Hi

What is the maximum current that a picaxe chip can take im currently using a 08m but i will be using a 14 later on for the same thing. Im using coputer power supply to run the board which is 22 amps so if this is too much how can i limit the current but not the voltage.

Also im am trying to run a 12 computer fan off of the pwm out from the pic chip using a transistor but ive blown 2 of them up as in they just don't work so i assume they have gone can any one recomend one from maplins because i am on a tight schedule and i don't have time to order one from rapid.

Sorry to ask that but i don't understand all the stuff on the website so i can't figure out which one to use.

Any help would be greatly appreciated.

SKL BOI
 

inglewoodpete

Senior Member
I think you need to supply some more information. I have used a 2N7000 FET to drive a 12v computer fan with PWM from a 14M. I needed to use a 100nF capacitor mounted close to the PICAXE's power pins to stop it from resetting from the power noise from the motor.

What sort of transistor are you using? How about a circuit diagram and a photo of your setup?

A 22 amp supply is 'ample' (!) for the circuit: a computer fan uses 100 to 200 mA, depending on its capacity. I would suggest you use a 500mA fuse in the 12v supply circuit to limit any damage should something go wrong with your wiring.

It appears that you have limited knowledge of voltage and current. If we use water as a comparison, voltage = water pressure and current = water flow. Voltage (pressure) can 'burst' (blow) components.

Current (energy flow) is normally limited by resistance in the circuit (like a 12v motor or 12v lamp). Take the resistance out of the circuit and (theoretically) infinite current will flow, overheating things (generally releasing the smoke or melting wires etc). So, if wired correctly, you will only use a fraction of the current capacity of your supply. The circuit should be wired as per the diagram on page 11 of manual 3.
 

hippy

Technical Support
Staff member
http://www.picaxeforum.co.uk/showthread.php?t=11963

In terms of PSU, they allow a particular maximum current be drawn, a circuit can draw up to that current limit if the circuit requires it.

You can run a PICAXE circuit requiring 10mA from a 22A supply but it is not recommended because if you short something you can get that 22A delivered which can cause damage and even explosive destruction of components.
 

SKL BOI

Member
thanks for replying quickly:


I can't find my circuit diagram I must have left it at school. But I have the PCB board diagram attached. I just jumping the Green and the Black pin to get the power supply to give out power.

Do i need that capacitor on the + power only yeah or both + and -.

And the fuse should that go into the direct supply or the output from the transistor?

Thanks Allot
 

Attachments

inglewoodpete

Senior Member
SB: I had hoped the photos would show me (and others) what you are building.

The circuit board has 2 x 18-pin ICs but they do not appear to be 18Xs. The 8-pin chip could be an 08M: only you know that. Is it? Where does the fan connect? I can't see any pads for a transistor.

The other shot is a great shot of the edge of a circuit board: it could be anything. No sign of the fan referred to. Do the photos have any relationship to the problem?

The capacitor I referred to would go between the 0v common and +5v, with leads as short as possible and as close as possible to the power pins on the PICAXE.

The fuse would go in series with the +12v feed from the power supply (yellow wire).
 

SKL BOI

Member
Hi

The 2N7000 FET doesn't work correctly I'm getting the 12v to drive the fan but it doesn't reduce or increase when the voltage does. its 12v constantly. I am using your program you gave me. I have also tried a Darlington pair form the picaxe manuals and that does the same thing a constant 12v.

No the pads aren't touching the tracks its because I copied it into power point then saved it as a picture.

The 18 pin IC's are LED bar graph drivers I wont have them both there in the final board as this is just prototype I will only have one which is why I'm upgrading to a 14 pin picaxe to remove the second bar graph driver because that too is being problematic.

With the capacitor then I have done a rough diagram on the pictures is that what you mean. Sorry but I don't understand.

Thank you all very much for your help hopefully ill get it soon.

Again Answers A.S.A.P please because i have 1 week to make this work and then build my final baord and finnish off the casing.

SKL BOI
 

Attachments

inglewoodpete

Senior Member
The 2N7000 is intended to be a switching FET: ON or OFF. With the gate connected to a pin capable of PWM, try 30% PWM - the FAN should run a lot slower. The average voltage across the FET will change but this is best observed on an analogue voltmeter. The actual voltage across the FET at any instant will either be 0v or 12v, depending on whether it is ON or OFF, as controlled by the PWM.

I'm not sure what the problem you are having with the capactor is. The diagram that you posted looks like black on a blackground ;o) I suggest you position the cap at the 'power' end of the PICAXE: connecting to pins 1 and 8 (08M) or to pins 1 and 14 (14M).
 

SKL BOI

Member
Right ok thanks for explaining that better i don't know what happened to that picture.

I want three levels of power going to the output 6v 9v 12v dependant on how hot a thermistor is the program gives a different pulse width modulation dependant on the input voltage unless the program is wrong so what i need is a transistor that will gain in voltage and not one that will jump straight to 12v.

my code is here:

main:
readadc 1,b0

if b0 < 100 then top 'if it is less than 100
if b0 < 200 then bot 'if it is between 101 and 199
if b0 < 255 then dot 'if it is between 200 and 255
goto main

top:
pwmout 2,99,120 '30% speed
high 0
goto main

bot:
pwmout 2,99,240 '60% speed
high 0
low 0
high 0
low 0
high 0
goto main

dot:
pwmout 2,99,400 'full speed
high 4
goto main
 

inglewoodpete

Senior Member
I thinks its now a matter of putting your circuit together (preferably on a breadboard) and testing the software.

A couple of points with your code.

Code:
high 0
low 0
high 0
low 0
high 0
....may not give a visible output on a LED (is that what you want?). You may nees to add a few milliseconds Pause when the output in On.

and 'High 4': O/P 4 never goes low again.
 

SKL BOI

Member
sorry that's the wrong code I've adjusted that to give it timings and output pins etc. but that's the gist of it.

Yes with a Darlington pair and an audio transistor(stopped working entirely) and latching transistor all work on the fan but the fan stays the same speed because the Transistor doesn't change the voltage.

So what transistor would you recommend?

Thanks

SKL BOI
 

inglewoodpete

Senior Member
Bipolar transistors will tend to get hot when you use PWM. This is because they will probably be working in the their linear region. If you drive a bipolar harder, it will turn on harder but the 'on' resistance is still relatively high when compared with a MOSFET. Resistance gives heat: P=I*I*R

As I mentioned previously, I have successfully used a 2N7000 to drive a computer fan with PWM from the PICAXE (I used a 14M but the PICAXE model is not important).

...fan stays the same speed because the Transistor doesn't change the voltage
The transistor is supposed to be limiting the current flowing through the fan, thus controlling the speed.

You will have to describe the problem further.


One step at a time: With the 2N7000's Source leg connected to 0v and the Drain connected to the fan motor (other side of fan connected to +12v), and the Gate connected to 0v the fan should not turn: the MOSFET is turned off. Move the gate to +5v and the fan should turn at top speed. Does this happen?
 

SKL BOI

Member
rite i want to double check something first I had a 12v supply from the power going into one side of the pad and the other side the output from the transistor i have been using this as the positive pad and then the negative pad has been the output from the transistor as well. this didn't work so i cut the "negative" pad from the transistor output and gave it a negative form else where on the board this then made the fan run. could all this problem be because i haven't wired it properly.

I have done a diagram hopefully it will come out ok:

I have cut the green line and the black line is the negative cable added. ok.

because of this wiring when i put negative to the gate on the transistor it still worked because of the 12v on the other side of the pad.

Thanks
 

Attachments

nbw

Senior Member
Don't forget a reversed diode to catch any nasty back EMF if you're switching fans or motors....
 

SKL BOI

Member
Yes the fan turns but the speed doesn't vary when i adjust the variable resistor still!

So I still have that problem.
 

SKL BOI

Member
no I can't turn the fan off, on, down or up I also disconnected the pic and the fan still turned!

Thanks

Skl BOI
 

SKL BOI

Member
Yes I had the 2n7000 wired as inglewoodpete has suggested and I have tried Darlington pairs and audio transistors and they all do the same thing I have printed the pin out diagrams off the internet to make sure I am doing it right.

Did you look at the picture of the PCB? Is that how I should have it wired because the fan still runs when I remove the pic because of the 12v supply on the other side of the pad?
 

BeanieBots

Moderator
If the fan runs with the PICAXE removed it's either a very fundamental connection fault or a blown FET.
Any chance you can post a circuit diagram of how YOU have wired it up?
 

Andrew Cowan

Senior Member
Can you write on the PCB picture (on paint, or something), what each of the pads are connected to?

Thanks,

A

Edit: The unnamed ones on the right.
 
Last edited:

fernando_g

Senior Member
Dear SKL BOI;
to provide you the help you require, it is of utmost importance that you do post a circuit schematic. That way, any of the fellow forum posters will be able to assist you by suggesting points to probe with a multimeter, or better yet, an oscilloscope.

PWM-driven fan circuits are fairly simple and straightforward, and troubleshooting should be a snap. But without a proper schematic diagram, with clearly labeled componets and values, a simple task becomes very hard indeed.

And no, only posting the PCB artwork is not enough.
 

SKL BOI

Member
Hi sorry for not giving a circuit diagram before buts that's because I didn't do one and I have just realised that PCB Wizard does it so I've used that. So one is the original circuit diagram and the other is the current way its configured the only difference is the red line.

ask for more info if I have forgotten anything.

And for testing purposes that thermistor is replaced with a 10K variable resistor (the thermistor is 10K as well)
 

Attachments

BeanieBots

Moderator
Blindingly obvious from the diagrams!

Circuit one should work fine.

Circuit two will leave the fan on always. (It's simply connected to the supply, the tranny is not used)
 

Andrew Cowan

Senior Member
BB has it - it is very obvious with a circuit diagram. In circuit 2, the diode doesn't do anything, and the motor is always connected.

I notice leg 2 (serin) is floating - it needs to be pulled to 0V for the PICAXE to function reliably.

A
 

SKL BOI

Member
Well the first circuit diagram didn't work at all which is why I cut the link wire and gave it a negative feed! But ill put it back and see what happens.
 

SKL BOI

Member
Nope the fan doesn't turn at all.


I used the multimeter on the 2 cables going to the fan and nothing. I then put the Negative stick on the negative line and the positive on the outputs to the fan and I'm getting the PWM up to 12v on one and 5v on the other because I have a negative feed.

IC2 is a 18 pin led @ bar graph driver.
 

MartinM57

Moderator
Time to go back to basics I think....we could be here a long time trying to diagnose and fix your problems via forum messages.

You need a simple circuit diagram, simple electronics and simple code

For the simple circuit diagram, start with clean piece of paper and make a circuit diagram (hand-drawn) with the absolute minimum circuit (leave out the led bar graph - that's just a distraction):
- PICAXE
- download circuit
- transistor
- resistor
- fan

For the simple electronics, get your breadboard out and wire up the minimum circuit

For the code simplicity, try this:

Code:
main:
  pwmout 2,99,120 '30% speed
  pause 5000
  pwmout 2,99,240 '60% speed
  pause 5000
  pwmout 2,99,400 'full speed
  pause 5000
goto main
Understand what you are doing at each part (circuit diagram, breadboard and code) and I'm sure you'll find the problem yourself.

Then you can go back to the PCB....

Good luck...
 

Andrew Cowan

Senior Member
I'm getting the PWM up to 12v on one and 5v on the other because I have a negative feed.
You've lost me.

Circuit 1 looks correct, so it must be a transistor problem.

Can you try a new transistor?
Are you SURE the pinout is correct?
Is the diode the correct way?

A
 

SKL BOI

Member
Im getting the 12v from the transistor the transistor works the pic works its pulsing.

Correct me if im wrong but the motor needs a 0v or a negative rail yes to function?

Well where is that 0v in the 1st circuit diagram?
 

MartinM57

Moderator
The motor "negative" needs to go exactly where you have it in your 1st diagram. Changing to the 2nd diagram was definitely the wrong thing to do - as pointed out it just powers the motor directly from 12v all the time

As also previously pointed out, if you don't tie the Serin leg to 0V then you can't guarantee the PICAXE will work.

If you've got a working motor, a working transistor and a working PICAXE then you must have a wiring fault that none of us are going to spot via forum messages....

Two more questions:
- what do you mean "you are getting 12v from the transistor" - the transistor doesn't supply volts, it just acts like a switch in the motor negative line
- How do you know things are "pulsing" - have you got a scope on it?
 
Last edited:

hippy

Technical Support
Staff member
Your left-hand circuit in an earlier post should work - double check you have got your circuit configured like that. Think of the Q1 transistor as a voltage controlled switch ...

As the input to it goes high that shorts the collector to emitter, this allows current to flow from +12V, through the fan, into the transistor collector, out the emitter and to 0V. The current flows through the fan, it turns.

When the input to it is low, the switch goes open circuit, no current can pass through so the fan cannot turn.

One thing to add is that some fans do not like PWM control as they actually have a PWM controller inside them. It may be worth trying a different fan, however, a good start would be LED plus R instead of the fan. You should be able to turn that on and off and dim it with your circuit.

If that works and the fan doesn't, it looks like there's an issue with the fan.
 
Last edited:

Andrew Cowan

Senior Member
Do you have the diode the wrong way? That would give a pulsed 12V at the transistor output. The stripe should be closest to the 12V side.

A
 

SKL BOI

Member
in the picture attached the black arrow is the black pointer on my voltmeter and the red arrow is the red pointer on my multimeter i put them where they are on the picture and i get (if i have it in the current set up) between 0-12v varying up and down and if i turn the variable resistor then it speeds up going up and down on my multimeter.

The diode in the circuit diagram isn't their i removed it while testing there is just a link wire there.

I was originally using a antec 900 fan which has a variable resistor for fan control and LED's in it if have now tested the circuit with a dell fan that hasn't got speed control and it doesn't make a difference.
 

Attachments

Last edited:

Andrew Cowan

Senior Member
Wire link?!? No!

The function of the diode is just to connect when back EMF is produced.

A wire link shorts out the system, and heats up the transistor! Bad!

Take out the link, and measure the voltage across where the wire link was.

A
 
Top