adachsoft.com
Published

Hot Wire Foam Cutter - Arduino PWM

This adds a PWM to control temperature on a hot wire foam cutter.

BeginnerShowcase (no instructions)1,668
Hot Wire Foam Cutter - Arduino PWM

Things used in this project

Hardware components

DigiSpark
DigiSpark
×1
IRF530
×1
Plastic box for electronics
×1
Some wires
×1
resistors 1k ohm
×5
resistors 100 ohm
×2

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

schematic_RcQc8ebiAW.jpg

Code

Untitled file

C/C++
#define LED_PIN 0
	#define PWM_PIN 1
	
	
	int val = 0;
	long t = 0;
	bool sw = LOW;
	
	//the setup routine runs once when you press reset:
	void setup() {                
	  pinMode(LED_PIN, OUTPUT); //LED on Model B
	  pinMode(PWM_PIN, OUTPUT);
	
	  analogWrite(PWM_PIN, 0);
	  delay(1000);
	}
	
	void loop(){
	  val = analogRead( A1 );
	  analogWrite(PWM_PIN, val/4 );
	  
	  if( millis() - t > 1000 ){
	    sw = !sw;
	    digitalWrite(LED_PIN, sw);
	    t = millis();
	  }
	
	}

Credits

adachsoft.com
9 projects • 16 followers
Contact

Comments

Please log in or sign up to comment.