Sensors and wire length

Hi all! New here and relatively new to all things Arduino and I have a couple questions regarding my first big project.

For a brief overview of the project, I am automating the environmental conditions inside of a reptile enclosure with the a 24"x24"x48" volume. I am doing this with a heat source input, 3 12V fan outputs, 3 DHT11 sensors (to cover different locations within the enclosure), and 2 GROVE soil moisture sensors in order to automate the watering process. In order to regulate humidity, I have several 5V pump hooked up to a watering/misting system throughout the enclosure.

As for current status, I have been successful setting up the fans and the pumps. I understand that my methods for controlling both might not be ideal, but I am learning a lot from this set up and plan to replace these components in the future. That being said, I have mistakenly attached a deadline to this project and must now complete a working model with the components I have. When it comes to the sensors, I am having a lot more trouble. I set up the soil moisture sensor in an experimental set up and it worked just as advertised. Once I attached it to a ~24 inch wire, things got worse. No matter what I try the sensor just reports random values when read. As for the DHT11's, I am only able to get them to read a consistent 254 for both temperature and humidity with similar length wires.

So, my question is: How long is too long for sensor wires (i.e. should I look into shielding)? I spent a good few hours looking on the internet and searching this forum without any luck dealing with as simple an issue as mine. From what I could gather, the length of my wires should not be an issue. I will attach an many photos as I can. I am fully aware my breadboard is a mess and that this issue could prevent you guys from giving me help. Unfortunately this is my current skill level. All advice appreciated.

Thank you!
Luka


As a rule of thumb I use 10" but that is also sensor dependent and its impedance. Your diodes are not wired properly, they appear to be in series with the fans. Also you have wires going from the Arduino to the plug board then to a single item, why? What type of environment is this in? The wiring jumble is to hard to follow. What is autocham2, a schematic it is not?

Long loops of wires such as shown in your photos readily pick up electrical interference from overhead lighting, nearby fans, etc. But from the information supplied, it is impossible to predict whether that would be a problem in your case.

However, other possible problems jump out!

Breadboards are for temporary experiments with low power logic circuits, and are unreliable. So they can't be used for semi-permanent installations, especially in humid environments, or for circuits controlling lights and fans.

Once the circuit works according to your satisfaction, it should be transferred to prototyping boards, something like the example below, with short wires and soldered connections.

Grove sensors usually means I2C?

If so, try making the pullup resistors from (respectively) the I2C clock and data wires to Vcc (5V power rail, unless you have 3v3 stuff somewhere in the system) smaller, go down to 4.7K ohms, or maybe even see if things can cope with getting a little lower still. This will help speed up the rise times on the signal despite any increased capacitance created by the long wires.

From your "schematic" it looks like presentl you're relying on only the 100K (approx) pullups inside the arduino to puul the I2C lines high.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.