A couple of months ago I posted a forum asking about how I could amplify the PWM from a PICAXE 18M2 where I received positive responses (http://forum.allaboutcircuits.com/t...mer-amplifying-light-bulb.118185/#post-930297). After building the rest of the circuit and trying solve all the problems within the circuit, I find myself coming back to the 18M2 subsystem where I can't solve the PWM amplifying problem.
I connected the IRF 640 as I was shown in the previous forum (subsystem diagram attached) however the filament light has a small dimming range, from 6.34V to 6.74V to be exact. The PWM signal itself straight from the 18M2 has a consistent voltage range from 0V to 4V, meaning that I believe that there are no problems with the code itself as it works fine when I have a diode connected to the PWM output (without using a MOSFET, no power amplification). I want the subsystem to work so that I can dim the filament bulb from 0V-7V (or around that range). I will upload pictures of the actual connected MOSFET connected within the subsystem.
As well I have tried to use a 2N2222 transistor to act as a power amplifier, however it has low switching voltage and the voltage across the light bulb is constantly varying when I am not changing the readadc value (which is the voltage from the potentiometer), I believe this occurs due to the transistor heating up quite a lot however I am unsure. Below I will also attach the code that I set up for the PICAXE 18M2.
init: ;initial code, setting parameters for pwm
pwmout b.6, 50, 300 ;generating pulse width modulation at b.6 of the 18M2 driver which is pin 12
main:
readadc c.2, b0 ;analogue signal at c.1 (pin 16)
pwmduty b.6, b0
debug
goto main
For the code above, after "pwmout", I'm unsure what values I should use for dimming the light bulb, these values were obtained from trial and error, and used what looked had the best dimming effect.
I connected the IRF 640 as I was shown in the previous forum (subsystem diagram attached) however the filament light has a small dimming range, from 6.34V to 6.74V to be exact. The PWM signal itself straight from the 18M2 has a consistent voltage range from 0V to 4V, meaning that I believe that there are no problems with the code itself as it works fine when I have a diode connected to the PWM output (without using a MOSFET, no power amplification). I want the subsystem to work so that I can dim the filament bulb from 0V-7V (or around that range). I will upload pictures of the actual connected MOSFET connected within the subsystem.
As well I have tried to use a 2N2222 transistor to act as a power amplifier, however it has low switching voltage and the voltage across the light bulb is constantly varying when I am not changing the readadc value (which is the voltage from the potentiometer), I believe this occurs due to the transistor heating up quite a lot however I am unsure. Below I will also attach the code that I set up for the PICAXE 18M2.

init: ;initial code, setting parameters for pwm
pwmout b.6, 50, 300 ;generating pulse width modulation at b.6 of the 18M2 driver which is pin 12
main:
readadc c.2, b0 ;analogue signal at c.1 (pin 16)
pwmduty b.6, b0
debug
goto main
For the code above, after "pwmout", I'm unsure what values I should use for dimming the light bulb, these values were obtained from trial and error, and used what looked had the best dimming effect.
Attachments
-
129.7 KB Views: 6
-
129.6 KB Views: 5