You have to provide much more information about what hardware you were using
what is the exact type if WiFi-module that you are using
if it is an ESP8266 or an ESP32 working with this AT-firmware is a big hassle.
You can eliminate the complete arduino by using a nodeMCU-esp32-board
You can connect the pulse-sensor to the ESP32 itself and send the data over WiFi
at the same time.
What maybe the cause is that you wired Tx and Rx the wrong way.
You should use a demo-code for a simple test that checks if you can comunicate with your WiFi-module in general.
best regards Stefan