I have been using this code for my FSR (Force Sensor Resistivity) and Vibration coin motor.
The Arduino Uno has no problem when connecting through USB port as the pressure applied on the FSR, the coin vibration motor will start vibrating after 7 seconds (even though I have preset the time for 10000milliseconds).
But as soon as I connect Arduino Uno with Bluetooth, the serial monitor is still reading the data but the coin vibration motor starts vibrating as soon as I applied force on FSR.
Is there any solution to this problem?
Below is my coding for the FSR and Coin Vibration Motor:
int motorPin = 5; //motor transistor is connected to pin 5
int fsrPin = 0; // the FSR and 10K pulldown are connected to a0
int fsrReading; // the analog reading from the FSR resistor divider
unsigned long elapsedTime = 0;
unsigned long onTime = 10000;
Your real problem is probably being addressed in reply #4. You don't actually need any special code for Bluetooth. Just connect HC-05 to serial pins 0,1 Rx to Tx and Tx to Rx. It is advisable to have a 1k / 2k voltage divider in Arduino Tx line.
But the main problem is when Im connecting my arduino to laptop with USB port, the vibrator coin will start vibrating after 7 secs after I applied pressure on my FSR sensor (Which is I intend to do). But as soon as I connect my arduino to laptop with HC-05 Bluetooth, my vibrator coin vibrates immediately after I applied pressure pm FSR sensor.
I assume you either intend to ignore the advice in reply #4, or have already proven it is irrelevant, but can't be bothered enlightening the rest of us to that effect.