Hello everyone! I bought an HM-10 bluetooth module to communicate with my Arduino Uno via iPhone. I want to control a TIP120 transistor with a PWM signal to manage an exhaust valve in my car. The valve needs a short 10% PWM signal to open the valve and a short 90% PWM signal to close the valve.
I tested my code with an LED instead of the transistor to see if it works but I now run into the problem where the LED on port ∼9 turns on when my iPhone is initially connected to the HM-10 module, without sending any specific signal/command to turn it on. When I look into the serial monitor I see:
OK+CONLED ON
NLED ON
LED ON
LED ON
LED ON
LED ON
...
This means that irl, once I connect the app to the module on the Arduino, the transistor will let electricity flow through the transistor, which means the valve will be powered with a wrong signal, and for too long.
In conclusion, I don't want it to send any amount of power to the output port all through the connecting process until I actually send a signal/command via Bluetooth to make port ∼9 power on.
Is this something wrong in the code? (I'm quite new to coding). And if so, what can I do about it.
Try setting your code so that when the phone connects the HM-10 or when your board is powered on, set the value to be off. (Turning it off when the board powers on can be done through the setup section)
What app are you using to control the HM-10 with the iPhone? I’m stuck on finding a decent app that lets me connect the module to my phone