@Condoman , posting a picture of your wiring might be helpful. You can find other posts from other members regarding the SR04 sensor which may be helpful.
I have a JSN-SR04 sensor I just purchased that I suspect is bad. Can anyone tell me if it is the same as the HC-SR04 except they are waterproof? I am able to get firmware to work with the HC-SR04 but not the JSN-SR04.
so i am having trouble with the ultra sonic sensor SR04 because when i try to send thingspeak data it only gets -1. im not sure why so here is my code:
// This #include statement was automatically added by the Particle IDE.
#include "HC_SR04/HC_SR04.h"
int distance = 0;
int cm;
int trigPin = D2;
int echoPin = D6;
HC_SR04 rangefinder = HC_SR04(trigPin, echoPin);
void setup()
{
}
void loop()
{
distance = rangefinder.getDistanceCM();
cm = distance;
Particle.publish("ultra_senso…