# Heating coil based on bluetooth input

#### Siddharth Mehrotra

Joined Jul 15, 2019
11
Hi,

I want to heat coil based on the input value received by bluetooth device.

I made a small circuit also for this. I am using Kanthal wire for heating, it's 22g wire which is 1.31Ω per foot. The wire needs current of 2.5 amp with 3.7 V battery to heat.

I am transferring ASCII values to bluetooth device with my phone.

Here is the code I am using:

Code:
char c;
int state = 0;
uint32_t period = 1 * 60000L;//  1 min
void setup() {
while (!Serial);
Serial.begin(9600);
Serial1.begin(9600);
}
void loop() {
if(Serial1.available()){
Serial.println(c);
if(c=='7'){
for( uint32_t tStart = millis();  (millis()-tStart) < period;  ){
digitalWrite(A7, HIGH);
}
}
}
delay(1000);
}
The bluetooth is working fine! Example: When I send a ASCII value 5, I can see on Arduino serial monitor 5.

The problem is the circuit! I am not able to understand where I am making the mistake as based on the bluetooth input, fire is not heating up. Please help.

#### Attachments

• 422 KB Views: 14
• 203 KB Views: 14

Joined Feb 20, 2016
3,939
Have you set A7 as an output?
pinMode(A7,OUTPUT);

#### BobTPH

Joined Jun 5, 2013
4,037
Multiple things wrong with that code.

You say you are sending a '5' and the code is only doing anything if it sees a '7'.

What the code does is wrong. It keeps setting the output high in a loop. No line ever sets if off, so, if it worked, the wire would stay heating forever.

Line up the { and } in the code so we can more easily see what code is contained within each structured statement.

Bob

#### Siddharth Mehrotra

Joined Jul 15, 2019
11
Have you set A7 as an output?
pinMode(A7,OUTPUT);
Yes, A7 is output on Flora which is D6 in Arduino.

#### Siddharth Mehrotra

Joined Jul 15, 2019
11
Multiple things wrong with that code.

You say you are sending a '5' and the code is only doing anything if it sees a '7'.

What the code does is wrong. It keeps setting the output high in a loop. No line ever sets if off, so, if it worked, the wire would stay heating forever.

Line up the { and } in the code so we can more easily see what code is contained within each structured statement.

Bob
Actually 5 is just example of value I am sending! Even if I send 7 nothing happens according to my circuit. Also, I understand that I didn't turned off the heating, but that's not the issue. The problem is with the circuit design I have the above code doesn't heat the coil. (See the Fritzig Diagram)

#### BobTPH

Joined Jun 5, 2013
4,037
Sorry, I read schematics, not Fritzing diagrams.

Bob

Joined Feb 20, 2016
3,939
Your breadboard layout leaves a lot to be desired. But that aside, where is the power to the boards?

Have you written a test to just pulse the output on and off, not using the bluetooth?
Test that you can drive the heater first. Add an LED with resistor so you can see it switching.

#### oz93666

Joined Sep 7, 2010
737
The problem is with the circuit design I have the above code doesn't heat the coil. (See the Fritzig Diagram)
At a guess you have too much resistance in the (heating) circuit ...

You have very low voltage and want high current so you cannot have even modest resistance in connecting wires , contacts , and resistance in components ..

Stepping up the voltage must be the answer , within the limits of the circuit.

#### Siddharth Mehrotra

Joined Jul 15, 2019
11
Your breadboard layout leaves a lot to be desired. But that aside, where is the power to the boards?

Have you written a test to just pulse the output on and off, not using the bluetooth?
Test that you can drive the heater first. Add an LED with resistor so you can see it switching.
The FLORA is powered by USB from computer & coil by battery as it requires high current to heat up.

I will test with LED and update you! Thanks.

#### Siddharth Mehrotra

Joined Jul 15, 2019
11
At a guess you have too much resistance in the (heating) circuit ...

You have very low voltage and want high current so you cannot have even modest resistance in connecting wires , contacts , and resistance in components ..

Stepping up the voltage must be the answer , within the limits of the circuit.
I am using a separate battery to power the coil as it requires high current. I will reduce the resistance and will update on that. Thanks.

#### djsfantasi

Joined Apr 11, 2010
7,920
Doesn’t the Bluetooth TX pin need to be connected to the Arduino/Flora RX pin?

As shown, nothing will ever received by the μp, and hence the digitalWrite() will never be executed. Hence, no current will flow to the wire; no heating will occur.

Plus, if the μp is a 5V device, it’s TX pin must be reduced so that the Bluetooth module isn’t damaged.

#### Picbuster

Joined Dec 2, 2013
1,027
Hi,

I want to heat coil based on the input value received by bluetooth device.

I made a small circuit also for this. I am using Kanthal wire for heating, it's 22g wire which is 1.31Ω per foot. The wire needs current of 2.5 amp with 3.7 V battery to heat.

I am transferring ASCII values to bluetooth device with my phone.

Here is the code I am using:

Code:
char c;
int state = 0;
uint32_t period = 1 * 60000L;//  1 min
void setup() {
while (!Serial);
Serial.begin(9600);
Serial1.begin(9600);
}
void loop() {
if(Serial1.available()){
Serial.println(c);
if(c=='7'){
for( uint32_t tStart = millis();  (millis()-tStart) < period;  ){
digitalWrite(A7, HIGH);
}
}
}
delay(1000);
}
The bluetooth is working fine! Example: When I send a ASCII value 5, I can see on Arduino serial monitor 5.

The problem is the circuit! I am not able to understand where I am making the mistake as based on the bluetooth input, fire is not heating up. Please help.
I am missing parts of program like millis()
and the vars named tStart and period;