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:
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()){
c = Serial1.read();
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, coil is not heating up.. Please help.
Check if bluetooth has onboard regulator of 3.3v if it has then you have to probivide 3.3v+dropout to module but same time keep rx pin of bluetooth at 3.3 logic level.
You didnt provide any details of the problem and components so this is just a guess.
And how u gonna switch n channel mosfet with gate to ground?
That thread was based on input from conductive stretch sensor. Here I am using bluetooth as input. I will close that thread as it was wrong specs by Amazon which caused all the error.
Put a led in paralllel with mosfet gate as an indicator.
The bluetooth is working fine! Example: When I send a ASCII value 5, I can see on Arduino serial monitor 5.
We need to know:
Does the mosfet turn on the coil if you drive it directly from the flora , bypassing the bluetooth?
or
does the mosfet turn on the coil if you connect the gate directly to +5V ? (another way of saying "Is your mosfet good ?)
What , if any communication do you have with the bluetooth module ?
I'm confused . How do expect to turn on the heating coil with the bluetooth if the coil is controlled by the flora D6 and not the bluetooth ?
You say that you see ASCII 5 on the serial monitor if you send a 5 but did not say if the same is true if you send a 7 ?
What does 5 have to do with turning on the coil ? Did you try changing the code to turn on the coil when it receives a 5 , since that seems to work ?
We really still don't know if your communication works because if you can send and receive a 5 , why can't you send and receive a 7 ?
Something seems to be missing ...
Have you tried adding leds to the other flora digital outputs (D9,D10 & D12) and turning those on as a diagnostic test ?
If you can turn those on then why can't you use those to turn on the coil ?
Your Fritzing suggests you're using a breadboard. If so, that's likely at least part of your problem as 2.5A is way too much for a typical breadboard.
Your Fritzing also suggests you're using an otherwise unspecificed MOSFET in TO-220 housing. Are you sure you're using one of the very few such MOSFETs that actually switches properly at 3.3V logic level?