im able to connect to the module just fine through my phone, but i cannot get the code inside my if statement to run with the condition Serial.available(). when i connect to the module, the red light blinks twice every 2 seconds like normal, but when i send any information it will not turn on my led
connection BluetoothMod : Arduino
RX : TX
TX : RX
GND : GND
VCC : VCC
int PIN = A3;
void setup() {
pinMode(PIN,OUTPUT);
Serial.begin(9600);
}
void loop() {
if(Serial.available())
{
digitalWrite(PIN, HIGH);
}
delay(100);
}
It may be just a matter of procedure, but blinking twice every two seconds, only confirms the phone is connected to Bluetooth. Check the wiring again.
If you are using an HC-0x and Android, you might find the following background notes useful.
http://homepages.ihug.com.au/~npyner/Arduino/GUIDE_2BT.pdf
http://homepages.ihug.com.au/~npyner/Arduino/BT_2_WAY.ino
wiring appears to be correct and same with the software on the arduino. i switched over to using an app off the playstore for testing instead of mine and the result appears to be the same 
Is the led wired correctly?
My troubleshooting steps would be
1)
Start by using the builtin led instead of a led on A3 and by using serial monitor (disconnect the BT module).
Does it work?
2)
If that works, reconnect the BT module and try with your phone app.
Does it work?
3)
If that works, use the led on A3 instead of the built-in one.
sterretje:
Is the led wired correctly?
My troubleshooting steps would be
1)
Start by using the builtin led instead of a led on A3 and by using serial monitor (disconnect the BT module).
Does it work?
2)
If that works, reconnect the BT module and try with your phone app.
Does it work?
3)
If that works, use the led on A3 instead of the built-in one.
the led (both arduino and separate led) does work when i do not have the bluetooth module plugged into A3 and the ground. the it just does not seem to be receiving any data from my phone
gokitty199:
when i do not have the bluetooth module plugged into A3 and the ground.
Into A3 ? Your bluetooth should be connected to RX and TX.
By the way, Serial.available() does not return true or false. It returns the number of bytes available for reading. Not the cause of your problem but you need to understand it.
sterretje:
Into A3 ? Your bluetooth should be connected to RX and TX.
By the way, Serial.available() does not return true or false. It returns the number of bytes available for reading. Not the cause of your problem but you need to understand it.
no the led is plugged into A3 and ground. i tried with 2 and A3 just out of curiosity before diving deeper and they both have the same result, work without bluetooth but not with it. the bluetooth module is plugged in as i showed in the OP
rx -> tx
tx -> rx
gnd -> gnd
vcc -> vcc
thanks for the headsup on serial.available
What module are you using?
What phone are you using?
What phone app are you using?
Has the module ever worked before?
If your code lights the LED with the serial monitor but not the phone, than either the module, phone, or wiring is wrong.
Your code works to turn on led 13 with my HC05, android phone, and Bluetooth Serial Terminal app.
module: HC05 https://www.amazon.com/gp/product/B071YJG8DR/ref=oh_aui_detailpage_o03_s00?ie=UTF8&psc=1
phone: galaxy s6
app: Arduino bluetooth controller
module has not worked since ive had it. wiring is the same as several other peoples diagrams so it should be correct. it works with the serial monitor so ill give the app your using a try.
EDIT: used the bluetooth terminal HC-05 app with no luck, once i connect to the module it just blinks red twice every 2 seconds, sending any data yields no results. it works only when i send something in the serial monitor on my pc that its connected to. im going to try another phone.
EDIT2: no luck using another phone either.
What are you using for a power source? Since you are using hardware serial, pins 0,1, your code should work with the serial monitor - serial with wires, no bluetooth involved. You should then be able to connect bluetooth and the code work with the phone - serial without wires.