DIY hot wire cutter electronics: needs some advice

Hi all,

So, after my previous successful project I am ready to try something more outside of my comfort zone. I'm a beginner level hobbyist/designer. I've created over 8 DIY machines like 3D printers, a laser cutter and more, but I've never really created my own schematics.

This time: A hot wire foam cutter with adjustable heat settings!
The entire cutter is already constructed but I'm struggling a little bit with the electronics. The PSU is too powerful to use directly and will turn the hot wire into a lamp and then the hot wire melts. So I'm setting out on creating a little circuit to make it all work.

For starters I have already learned how to:

  • Read analog potentiometer values with an Arduino Uno
  • Turn these values into a PWM signal
  • Use this signal to speed control a 5v fan

It was all pretty straightforward, I built this circuit to make it all work:

And I used this script to run it:

#define PWM_PIN 3
	int val = 0;
	//the setup routine runs once when you press reset:
	void setup() {                
	  pinMode(PWM_PIN, OUTPUT);
	  analogWrite(PWM_PIN, 0);
	void loop(){
	  val = analogRead( A0 );
	  analogWrite(PWM_PIN, val );

That was a good exercise to learn today. Now, my issue lies in the fact that I now want to convert the schematic to use on the wire cutter instead of turning on a simple 5v fan.

Parts that I have available:

  • Arduino Uno
  • IRLB8743 mosfet (plus heatsink)
  • 1K Ohm potentiometer (also bought a 10K Ohm one)
  • 15v 4A external PSU
  • Nichrome wire (various sizes)

Optional (I'm assuming these are needed):

  • Diode + Zener diode
  • Optocoupler

I'm getting stuck on working out how to connect up the power supply to the mosfet safely and keeping the Uno safe. I understand that the mosfet serves to make a kind of voltage divider between the Uno and the hot wire (which is basically a low value resistor).

This is how I think it should work but I'm unsure and don't want to blow anything up (used a buck converter as a stand-in for the 15v 4A PSU):

I hope I'm not too far off. I will probably swap the Uno for a Nano once I get it working. And I will use a buck converter to also run the Nano from the 15v PSU to make it 5v.

Thanks for your time :slight_smile:

I'm pretty sure the schematic is the same as the ones for Arduino-controlled LED strings, relays, and other higher current devices. So, you should be able to copy those and just replace the original part with your hot wire.

Do you insist on using a programmable controller for this purpose?
A dimmer for incandescent lamps should do the same job, and the Arduino stays free for other projects.

1 Like

My first reaction is that you don't need to alter the schematic at all. Simply fit the more powerful PSU and change the fan for the hot wire.

What you need to do is check that the MOSFET will handle the voltage from the PSU (which it almost certainly will), handle the maximum current that the PSU can supply, and confirm that it is a true logic-level device. Also, confirm that the Uno will safely handle 15V on Vin.

The hot wire is not inductive, so it shouldn't produce any nasty voltage spikes, which makes your life very much simpler.

I think it will work. HOWEVER, analogRead() will return a value between 0 and 1023, whereas analogWrite() needs a value between 0 and 255. So really if you just take the value from analogRead() and send it straight to analogWrite() you will find only the bottom quarter of the potentiometer* will alter the speed; for the rest of the rotation you'll be sending values higher than 255 to analogWrite(), which will be treated as 255.

So, you need to scale the number from analogRead() to ensure it is always in the range 0 to 255 before sending to analogWrite(). Go to the Arduino reference documents online and read up on the map() function. That will do what you want.

Finally, you might not want to map the range 0-1023 to 0-255, in case that makes the wire too hot. You can limit the maximum power in the hot wire by mapping to a lower number: 0-200, or whatever works.

*(Approximately the bottom quarter, if it's a linear pot.)

1 Like

Thanks for your reply, I will use a buck converter to power the Uno with 5v :slight_smile:
I'm sure I will blow the Uno with 15v!

Indeed I was wondering about voltage spike safety etc because it's not inductive I might not have to add more safety measures. Thanks for confirming.

I wasn't sure if connecting the grounds together would put my Uno at risk, that was my main concern, maybe I didn't make that clear in my post, sorry.

Indeed, I did have an LED dimmer that I wanted to repurpose for this project, but it arrived broken (small SMD part was damaged and there's no space to replace it since the trace also came off from the board due to the nature of the damage). On top of that it was kind of a challenge to make something personal instead of using a readymade solution.

But yeah, an LED dimmer or motor controller should work as well, maybe I have a spare motor controller laying around somewhere :thinking:

But then again.. I think it's a good exercise to make a circuit. Have to start somewhere.

@themarinus: I've edited my previous answer to include a discussion about the map() function. Please be sure to read it! :slight_smile:

1 Like

Thanks for the advice, I have altered the script according to your suggestion (and simplified it a bit more):

#define PWM_PIN 3 // pin 3 because: pwm
	void setup() {                
	  pinMode(PWM_PIN, OUTPUT); // set PWM_PIN as an output
	  analogWrite(PWM_PIN, 0); // set initial value to zero
	void loop(){
	  int val = analogRead( A0 ); // read potentiometer
          val = map(val, 0, 1023, 0, 255); // map the analog value from max 1023 to max 255
	  analogWrite(PWM_PIN, val ); // send value to the mosfet
    delay(100); // lower the polling rate a little

The tabbing is a bit strange, it looks better in the IDE.
Somehow the script doesn't work as well with turning on the fan, so I must be doing the mapping wrong. Maybe it's because I'm now trying it with a 1K Ohm potentiometer. I'll switch it out for a 10K one and try again.

Switched out the 1K for a 10K pot, but no success, it seems that the setup only runs intermittently, I'm not sure what could be the problem, reseating the wires also didn't help, going to try it with a different Arduino now to see if the Uno is dying.

It's also possible I've given bad advice. Let's see if anyone else can confirm/deny what I said.

By the way, you need to be much more specific than "doesn't work as well with turning on the fan" before anyone can help you. What, exactly, is it doing? And what, exactly, were you expecting?

If you've got access to an oscilloscope you can observe the PWM waveform as you move the pot. If not, then println() the value of val to the PC so you can see what it is doing.

I've edited my comment.

The fan seems to run intermittent. I can hear the PWM signal going up and down when I turn the pot, but sometimes the Arduino seems to 'hang' and then moving the pot doesn't change the PWM anymore. I don't have an Osc sadly, but I tried reading the values through the serial connection, however the Arduino seems to hang as well when I start moving the pot. So the serial outputs zero's until I start moving the pot, then it gives a conn error and it freezes.

I haven't attached the PSU yet, this is still with the 5v fan setup.

(Also tried this without the mapping, but it seems that the Uno keeps doing this with and without the mapping)

I can only reset it by disconnecting the USB power. I'll give it one last try now by connecting it all up to a separate power supply with 5v going to Vin and Gnd. Maybe it's undervolting somehow, though I doubt it as the fan doesn't pull much current (0.05A max).

No matter what I try, it keeps crashing the serial when I start turning the pot.
This is the script:

#define PWM_PIN 3 // pin 3 because: pwm
	void setup() {                
	  pinMode(PWM_PIN, OUTPUT); // set PWM_PIN as an output
	void loop(){
	  int val = analogRead( A0 ); // read potentiometer
    int sensorValue = analogRead(A0);
    val = map(val, 0, 1023, 0, 255); // map the analog value from max 1023 to max 255
	  analogWrite(PWM_PIN, val ); // send value to the mosfet
  delay(100);        // delay in between reads for stability

Wouldn't this be easier?
analogWrite(PWM_PIN, analogRead(A0) / 4);

Why print sensorValue 10 times a second?
The MOSFET source pin MUST be connected to 15V ground along with Arduino GND.
You should put a 10k pulldown resistor from Mosfet gate to GND so gate is not floating while Arduino is starting up.

1 Like

Yes, but I wanted to show the OP the map() function as it seems the hot wire gets too hot when fed the full power from the PSU. Map makes it easy to see what is happening and to modify the maximum output level.

But yes, a simple division is all that is necessary, I agree, and would work just as well.

1 Like

@ SteveThackery
Understood, I tend to get too simplistic sometimes.

1 Like

Thanks for the suggestion, dividing by four was actually what I saw in someone else's script and I had it in there initially but I didn't understand what it was for so I removed it haha (so @SteveThackery 's comment was very useful as I wasn't aware of the 0-255 vs 0-1023).

I have now solved all the issues so far. With a separate power supply for the fan I can run it perfectly while maintaining the serial connection.

I will add a 10K resistor between the Gate and GDN as well and connect all grounds (I guess that's why they also call it 'common'? My first language isn't English, so I only realize this now). This should work so well when it's up and running.

Thanks for the input! I'll share some more about the project when I finish it.

1 Like

@SteveThackery @JCA34F
As promised some footage of the cutter in action:

It stops heating the wire when I turn the knob further than ~25% and the wire 'sings' at the frequency of the PWM value (I don't mind the singing wire).
I don't know why this happens, but I think it's the PSU's short-circuit protection kicking in, is that possible? I'm now using an Xbox360 PSU.

The electronics do not turn off when it stops heating so it might have to do with the way the analog values are translated into the PWM signal. I'll hook everything up to my laptop tomorrow to see if I can get some useful data through serial to pinpoint at what value exactly it turns the heating off.

The wire gets hot enough to cut thin sheets quite quickly, but I'm sure that any thicker material cannot be cut in its current state. This wire is recycled from a hair dryer, this is why it doesn't look straight. I also have fresh new wire on a roll and the cutter has a spring-loaded tensioning system on the top of the frame. This tensioning is needed because the nichrome wire expands when it heats up. The string then runs over a grooved bearing to allow for the movement so the springs can actually efficiently apply their pulling force.

When the electronics are all finished I will create a small wooden box to house the electronics. It features a socket for the Xbox360 plug, an on/off switch to switch the power supply itself by using the PSU sense pins and it will also house the potentiometer for which I will 3D print a small front panel. The electronics are hooked up to the hot-wire with two crocodile clamps that I reused from old wires, crimped and soldered on with thick enough wire to withstand the current. This makes it super easy to replace the nichrome wire, should it ever break.


A number of things could be causing it. You really ought to sort out a proper power supply for it. You know how to calculate the current required for the hot wire at 100%, so make sure you get an adequately rated one.

Anyway, nice work. :grinning: :+1:

1 Like

What is the resistance of the heater (in Ohms)? The voltage and max current of power supply?

1 Like

Hi, I've been doing some measurements and serial observing.

First of all; when connected through USB, I can turn it up as high as I want and turn the nichrome wire into a candle (so the PSU isn't the problem). This makes me think that there might be a voltage drop causing the Arduino to malfunction. My assumption is that the buck converter doesn't compensate for a voltage drop on the PSU.

So I tested this assumption, and it turns out that the PWM signal cuts out when the buck converter's output drops below 4.5V

Some stats on the PSU:
12V primary (drops to 9.7V under load) with 14.2A max current
5V secondary with 1A max current (shorting this rail turns the PSU on)

Stats on the nichrome wire:
3 Ohms of resistance
1.1A~1.2A of current across the wire when the PWM signal drops

I noticed the PSU has a secondary rail with 5V, so I'm going to attempt to use that rail for 5V as I assume this rail doesn't have a voltage drop across it. I'm not sure if the Arduino will turn on the PSU, but I guess we'll see. If the Arduino isn't enough I might try to add a resistor across the 5V rail to see if that helps turning the PSU on (is this a bad idea?).

This is what I've found out so far. The PSU can easily push that wire to the point of melting without breaking a sweat so this also means I can probably use a slightly thicker nichrome wire if the time ever comes where I want to cut thicker foams, but by that time I'll also need a sturdier frame :sweat_smile:

Not really, although it sounds like an odd arrangement. We don't know how clean and stable this 5V supply is, so first make sure it definitely doesn't go above 5V, whether or not the PSU is switched on. If you are satisfied it is safe and won't blow up the Arduino, then try it. As you say, you may need to add an additional resistor in parallel with the Arduino power rails in order to draw enough current to switch on the PSU.

Obviously it's "safer" to use a separate 5V supply for the Arduino (or a higher voltage one that you connect to Vin rather than 5V). But I understand the attraction of making use of what's already there.

1 Like

That's some big drop (unless it's when drawing max current).
Open the PSU and check the capacitors.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.