i got it connected when the arduino still plugged in the laptop but i'm unable to connect to it wirelessly, neither my phone nor my laptop can do it.
here is the code i use from chatgpt:
#include <SoftwareSerial.h>
SoftwareSerial BTSerial(10, 11); // RX, TX
void setup() {
Serial.begin(9600); // Serial Monitor baud rate
BTSerial.begin(9600); // Bluetooth module baud rate
Serial.println("Enter AT commands:");
}
void loop() {
if (BTSerial.available()) {
char c = BTSerial.read();
Serial.write(c); // Echo to Serial Monitor
}
if (Serial.available()) {
char c = Serial.read();
BTSerial.write(c); // Send to Bluetooth module
}
}
It appears that you have connected Rx to Rx and Tx to Tx. Transmitters transmit to receivers. Receivers don't hear anything from other receivers. The back of the Bluetooth module clearly says 3.6 to 6v, so why are you feeding it 3.3v? This quite apart from the question of adequate power from the 3.3v pin.
Anything that can deliver the appropriate power. A PP3 is essentially devoid of power. Having said that, it may work for little while, once you have fixed the other stuff. Try a 9v 2A wall wart.
But still wont connect to bluetooth no matter what i do
About the power source, i want to put this on a moving robot so i can't really use a 9v 2a wall wart, any other solution?
The wall wart will ensure you don't have a power problem now, and it will plug straight into the barrel jack. You can come up with a 6xAA or 18650 pack later.
I also submit you should solve the communication problem first and address AT mode later.
Your wiring should be Rx to Tx and Tx to Rx. I never use software serial but I believe your code is the wrong way round.
Further your code looks like standard stuff for a BT2 device. You need to ensure that it is kosher for your BT4 Bluetooth module.