Good evening ladies and gents
I've been working on a little project and i'm having problems with the PWM output of my picaxe 18m2.
The idea is to have the ds18b20 read a temperature and the 18m2 adjust the speed of a 5v motor accordingly.
The MOSFET I am using (i'm unsure if its actually suitable - i'm new to this sort of electronics building), is a FQP30N06L n-channel mosfet. I have tried attaching the motor and supression diode (1n4001) on both the D and S side of the mosfet - however i only seem to get the motor running at low speed and the microcontroller does not alter it based on the speed.
This is the code i have so far:
any help would be appreciated - i can draw up a little circuit diagram if that would help.
regards
I've been working on a little project and i'm having problems with the PWM output of my picaxe 18m2.
The idea is to have the ds18b20 read a temperature and the 18m2 adjust the speed of a 5v motor accordingly.
The MOSFET I am using (i'm unsure if its actually suitable - i'm new to this sort of electronics building), is a FQP30N06L n-channel mosfet. I have tried attaching the motor and supression diode (1n4001) on both the D and S side of the mosfet - however i only seem to get the motor running at low speed and the microcontroller does not alter it based on the speed.
This is the code i have so far:
Code:
symbol temperature = b1 ;Rename b0 variable to temperature
main:
readtemp c.1,b1
debug
pause 500
serout b.2, n2400, ( 254, 1 ) ; Clear OLED display
pause 50 ; pause to clear
serout b.2, n2400, ( 254, $80 ) ; First line of display
serout b.2, n2400, ( "Temperature" ) ; Display "Temperature"
serout b.2, n2400, ( 254, $C0 ) ; Second line of display
serout b.2, n2400, ( #temperature, "C" ) ; Display the temperature
select case temperature
case <=20
pwmout B.3, 99, 119
case 21 to 25
pwmout B.3, 99, 159
case 26 to 30
pwmout B.3, 99, 199
case 31 to 35
pwmout B.3, 99, 231
case 36 to 40
pwmout B.3, 99, 267
case 41 to 45
pwmout B.3, 99, 299
case 46 to 50
pwmout B.3, 99, 319
case 51 to 55
pwmout B.3, 99, 359
case =>56
pwmout B.3, 99, 399
else
pwmout B.3, 99, 0
endselect
wait 2
goto main
regards