Need help using arduino RP2040 nano connect w/headers

Hello! I have been trying for weeks connecting my arduino with a bme280 sensor and a hc-sr04 sensor, for a project having to do with measuring the wind with ultrassonic sounds. Every time i execute any working code i only receive neutral values, in both. My jumper connections sound all good, and i have connected the arduino to a breadboard (the arduino is being powered by a micro usb data cable). I have tried it with multiple libraries (mostly the trusted adrafruit ones), but i can never get anything useful...
I followed the guides ( Getting Started with the HC-SR04 Ultrasonic sensor | Arduino Project Hub / Sensor BME280 para Pressão, Umidade e Temperatura - Blog UsinaInfo) that show with great detail how to make them work and i can never be able to get a reading. Any help here would be marvelous, thank you.

(Aditionally, the IC2 device ips show at 0x60 and 0x6A, tho idk why)


Please post schematics and code.

1 Like

Hi @chatbot_enjoyer. You have not correctly soldered the header pins to the BME280 sensor module. You won't get reliable electrical connections with it soldered that way. This is likely the cause of your problem.

I recommend watching some videos on YouTube about soldering to learn the proper technique, then try soldering the header to the sensor module again.

You should see a smooth transition between the solder and the pad on the module, and between the solder and the header pin:

📷

Solder Joint en.svg by SLUB Dresden / Carsten Pietzsch - CC BY-SA 4.0

(this is called the "solder fillet"

1 Like

Hello. I though so, the soldering went very badly. But that's why i tested it with the HC-SR04, since it doesnt require any soldering. Here is the code:

/*

const int trigPin = 2;
const int echoPin = 3;

float duration, distance;

void setup() {
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
Serial.begin(9600);
}

void loop() {
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);

duration = pulseIn(echoPin, HIGH);
distance = (duration*.0343)/2;
Serial.print("Distance: ");
Serial.println(distance);
delay(100);
}

 
The connections to the arduino are the following: 
VCC -> 3.3V (and also tried with 5V)
GND -> GND
TRIG -> D3
ECHO -> D2

thanks!

The HC-SR04 sensor is a 5 V device, while the Nano RP2040 Connect is a 3.3 V board. There are three things you must make sure to do when using these together:

  • Provide 5 V to the VCC pin on the HC-SR04.
  • Convert the logic level of the TRIG pin from the 3.3 V output by the Nano RP2040 Connect to the 5 V required by the HC-SR04.
  • Convert the logic level of the ECHO pin from the 5 V output by the HC-SR04 to the 3.3 V that is safe for the Nano RP2040 Connect.

You can do the first thing by connecting the "VUSB" pin of the Nano RP2040 Connect to the VCC pin of the HC-SR04, but first you will need to solder the jumper on the bottom of the Nano RP2040 Connect board, as documented here:

https://docs.arduino.cc/tutorials/nano-rp2040-connect/rp2040-01-technical-reference/#5v-pin

As for the logic level conversions, you can connect a level shifter module between the pins on the Nano RP2040 Connect and HC-SR04. These modules are available for a reasonable price from any online store/marketplace that sells electronics supplies.

Okay, thanks for the help! I will try that when i have time again.

For a last guidance, if anyone has any experience, what should be the distance between the 2 HC-SR04 to measure the wind? I'm thinking like 20 cm, but maybe a bit more could be better, im not sure. Any help with the distances would help alot.
Thank you again!

FYI: 3v HC-SR04 type sensors are available.

1 Like

the JSN-SR04T waterproof ultrasonic sensor operates at 3.3V

The ones I have seen are more like 3 meters apart. You can't just measure the wind speed with a sensor and receiver because that will mean your measured speed will be dependent on the wind direction.
You need to measure the wind vector. Which will give you the wind direction and speed.

Also the ones I have seen seem to use a much higher frequency ultrasonic transducers than the 40KHz you are trying to use.

Is this trying to measure wind speed or using some sort of hard surface to bounce the signals off.

You can only measure wind speed if the emitter and sensor are facing each other.

I'm only performing tests to see if the sensors work. Before trying to measure the wind, i'm trying to make it so i know the sensors work by making simple tests.

Not quite the answer I was expecting. I was expecting something like
"I use a book to bounce the signals off, holding it between x & y cm distance."

What do you mean by:-

What is a neutral value?
In both what? I can only see one distance sensor.

Much appreciated for everyone that helped! The problem with the bme280 was that the sensor was dead, the moment i tried with another one it instantly worked. With the HC-SR04, i needed to increase the reaction time of the Trig pin. Hope this helps anyone in the future.

1 Like