basic stamp to generate pwm to control temperature
0001T
Posts: 14
Hello...i chanced upon this forum searching for information on pulse width modulation
I am doing a school project whereby I need to control the temperature of a heating element such that it will not overheat. I was told to use pwm to control the output current to 0.8A [noparse][[/noparse]electical resistive heating]·for a period of time.
I have access to a basic stamp 2 but the fact is·I do not know how to use it. Is there anyone or any data sheet/ manuals that I can refer to?
Thank you.
I am doing a school project whereby I need to control the temperature of a heating element such that it will not overheat. I was told to use pwm to control the output current to 0.8A [noparse][[/noparse]electical resistive heating]·for a period of time.
I have access to a basic stamp 2 but the fact is·I do not know how to use it. Is there anyone or any data sheet/ manuals that I can refer to?
Thank you.
Comments
http://www.parallax.com/detail.asp?product_id=27207
look at the bottom of the page for the link "What's a Microcontroller v2.2 (.pdf)"
after that keep asking questions here
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Magic Smoke Theory of Electronics –
Inside every electronic part there is magic smoke.
The magic smoke is what makes everything work.
If you release the magic smoke, the part stops working!
http://www.parallax.com/detail.asp?product_id=122-28176
-Martin (Author)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
StampPlot - GUI and Plotting, and XBee Wireless Adapters
Southern Illinois University Carbondale, Electronic Systems Technologies
instead of using the pwm function, i chose to use pulsout...this is the simple program which i've got...
counter VAR Word
DO
DEBUG ? IN3
IF IN3 = 1 THEN
FOR counter = 1 TO 5
PULSOUT 0, 50000
PAUSE 1000
NEXT
PULSOUT 1, 10000
FOR counter = 1 TO 5
PULSOUT 0, 50000
PAUSE 2000
NEXT
PULSOUT 1, 10000
ENDIF
LOOP
however, i realised that each time i press the pushbutton [noparse][[/noparse]normally open type] connected to IN3, the program must complete one cycle. how do i go about modifying the program such that the moment i release the pushbutton, the program would stop?
thanks
Presently the DO ... LOOP combination is causing your program to run indefinitely. If you want just one iteration, then remove both commands. If you want it to continue for some finite period, you may want to use LOOP with the UNTIL option:
LOOP UNTIL counter = 10 or somethng like that.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
main:
Timer=1000··· 'initialize pause time
DO WHILE IN3<1··· 'wait for button press
LOOP
DO WHILE Counter<10····· 'loop 10 times
Counter=Counter+1
IF Counter=6 THEN Timer=2000···· 'on count 6 make pause 2000
PAUSE Timer
IF IN3=0 THEN EXIT·· 'exit on button release
PULSOUT 0, 50000
LOOP
Counter=0···· 'initialize Counter
GOTO main······ 'go do it again
If the pulsout assigned to pin·1 is for indication that the heater is on then add these two lines either side of the pulsout 0 line.
HIGH 1
PULSOUT 0, 50000
LOW 1
Jeff T.