Measure resistance of coil while suppling voltage

Hi,

I'm trying to build a device that uses a coil from a vape device to heat a small liquid.
I've got it mostly working but I almost used the wrong coil 0.7ohm instead of the 1.8ohm. which would have drawn to much current.

So now i want to change it and make it safer by measuring the coil resistance first and then supplying the correct voltage.

But I'm trying to work this out but how can I measure the resistance of a coil with an Arduino while also suppling voltage to it?

Cheers Peter

You would need to add a series resistance and measure the voltage drop across it.

I can’t see how you measure the coil resistance first unless you supply at a low voltage first , measure the current via the resistor voltage drop
And then decide how to fully power it.
Bear in mind the coils resistance will change with temperature , you can’t power it directly from the Arduino and you only gave Pwm outputs .

Best bet is to buy a multimeter and measure the resistance first .

Also look into driving your coil with a constant current source , which might work for both resistance coils .

Heater elements don't change resistance very much with temperature, they use alloys specifically with this
property.

Why not use a constant current circuit to drive the coil? Then the wrong coil would heat up less, not more.

I would consider on power up,

  1. powering the element through a resistor, perhaps 10 ohms.
  2. Enable the 10 ohm resistor for a very short period of time (so the 10 ohms does not have to be huge)
  3. Read the voltage across the coil
  4. Determine if the coil is correct
  5. Act accordingly.

It’s really fairly straight forward.
You have voltage source “VIN+”
You have known resistance “R1” (4.7 ohm resistor)
You have coil “L1” (“R2”)

Resistor R1 + R2 form a series voltage divider, with coil “L1” (R2) connected to GND.

Given that VLOAD which of course is VR2 = VIN*R2/(R1+R2)
(CLASSIC VOLTAGE DIVIDER FORMULA)

Then R2 = 1.7 ohms (solution to find)

Solve for R2 WITHOUT using this value:

Let VIN = 3vdc

Let VR2 (measured with a DMM) = 0.796v

Let R1 = 4.7 ohms

VR2 = VIN * R2/(4.7 + R2)

VR2 = 3V * R2/(4.7 + R2)

0.796V = 3V * R2/(4.7 + R2)

[cross multiply] 3R2 = 0.796V * (4.7 + R2)

3R2 = 3.745 + 0.796R2

[combine like elements] 3.745 = 3R2 - 0.796R2

3.745 = R2* (3-0.796)

3.745 = 2.204*R2

[divide both side by 2.204] R2 = 3.745/2.204

R2 = 1.699

R2 ~ 1.7 ohms

[PROOF] R2 = 1.7 ohms

By Ohm’s Law , IR2 = VR2/R2

= 0.796V/1.7 ohms

IR2 = 0.468 A (468 mA)

Thanks for the replies. I made a small drawing of what i'm trying to accomplish.

The measuring of the coil isn't the problem the powering accordingly confuses me (red lines).

I know this isn't going to work but how can you measure the coil and power it in the same schema (doesn't have to be at the same time. (I usually do not draw schemas so I may have used the wrong symbols) and maybe add some diodes to direct the current.

Why are you drawing an inductor for a heating coil? Its basically resistance, the inductance will
be completely negligible.

Lose the red ground connection, its shorting out your resistor.

Where is your base resistor for the transistor? You'll burn out the D9 and the transistor as you've
drawn it. 150 ohms is a suitable value.

What are the diodes for? - you need to lose both of them and you'll have a plausible circuit.

Take both sides of the heater to separate analog pins then you can accurately measure the
voltage across it, the transistor is unlikely to saturate fully.

Hi MarkT,

Thanks for your reply, I've changed the schema but are left with a few questions.

MarkT:
Lose the red ground connection, its shorting out your resistor.

Doesn't the resistor R1 block/resist the flow from the coil? And wouldn't it heat up just like the coil does?

MarkT:
What are the diodes for? - you need to lose both of them and you'll have a plausible circuit.

Isn't it a problem that when I supply voltage to the coil it could damage the Arduino/A0 pin As it could reach about 5Amp? Or does the current automatically chooses the shortest way to ground?

Peter

Any particular reason for high side switching of the heating element?

Also instead of a PNP transistor you should use a MOSFET, preferably n-channel for lower on resistance. You're not going to succeed switching 5A with a PNP (you'd at least need a darlington for this, as the Arduino can never supply enough base current, and that's not recommended due to the high losses). You're better off using a MOSFET, and low side switching.

This is my take on the problem:
schematic.png

To sense the resistance of the coil: bring SENSE high, Q1 switches on, and you can measure the voltage on SENSE_SIGNAL. Heating coil R1 and resistor R2 form a voltage divider, so you can easily calculate the resistance of R1. 10Ω limits the current to 500 mA if powering by 5V. You only need to have this on for a few milliseconds, just enough for the measurement, so indeed R2 can be a standard 1/4W resistor.

Then when the coil checks out, bring HEAT high, Q2 switches on and you have the full current for normal heating.

schematic.png

1 Like

You cannot easily read pulsating voltage (PWM) with the Arduino ADC, the voltage across the shunt resistor would have to be low pass filtered and several readings averaged to get a sensible reading.

Don't use PWM on the SENSE signal. That doesn't make sense anyway. Just switch Q1 on, wait 1-2 ms, do the reading (takes 110 µs), maybe a few readings for averaging, switch Q1 off again. That's all it takes to measure the resistance of R1, which OP was asking for.

Then in normal operation you may use PWM on Q2. The analog reading in this situation is irrelevant, no more readings will be taken, as all you will see is 0V and 5V. Unless you want to ensure the heating coil is not broken, in which case you can simply time it with the PWM signal: at 490 Hz Q1 is on for just over 1 ms, that's long enough for 9 analog samples (or half those numbers if using pins 5 and 6, which operate at 980 Hz). When Q2 is on, the analog input should be at 0V. If it's at 5V, the heating coil is broken (or gone).

1 Like

@wvmarle, Thanks for your solution, this does exactly what I want and I ordered the parts...

thanks again!

Peter

You're welcome. Good luck building!