Sensor cable malfunction

Hi everyone,

I've recently been working on a controlled environment for a growspace with arduino, but the arduino kept freezing up and had no clue what the problem was (As seen in another topic, Arduino freezes after 30-90min).

Besides that i finally have come to the conclusion that the problem is due to the wires going from bottom (arduino) to top (HTU21d sensor). I have specifically made it like that so i would have the best readings possible and still have all the electronics protected from moist. The problem now is that it works perfectly fine when the HTU21d sensor is connected with regular jumper wires basically next to each other, but like that i would have incorrect readings. The sensor would say 30°C while at the top of the growspace its only like 18°C and a humidity difference of 20-40%.

I already made a little visualistation of the wiring with extra i2c connected devices attached, but are not causing any problems:


The easiest solution i could find to connect was to just cut 4 jumper wires in half, put some longer wire in between and solder then back together.

Arduino keeps freezing and i guess it gets stuck while waiting on a response from the sensor.

Thanks in advance.

Hello

The I²C bus system isn´t designed for a communication over a long distance.

Is there no other way of doing this, my environment cant be precisly controlled other way.

1 Like

Alright, thanks!

Another possibility - using an Ethernet cable. First pair, GND/GND. Second pair, GND/SCK. Third pair GND/SDA; last pair, 5V/5V. That might result in stable enough signal to let you proceed, though you're really pushing it with I2C. Make sure you have pullup resistors on the sensor board.

Welcome to the world of noise. I2C was never intended for communication to off board chips. Your frizzy does not show power, power sources, etc. Also missing is the required Pull UPs for the I2C. Try something around 2K, that may draw enough current to swamp out the noise. Note this will not work in all instances, depending on the noise. Also are there motors in the area or heater contacters that are cycling, they are great noise makers.

Hi, @lil_chimp

An image of a hand drawn schematic will be fine, include ALL power supplies, component names and pin labels.

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

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