I2C sensor erratic readings when not using usb connection - Uno

Ok, so I've been pulling my hair out over this issue all day and I cannot for the life of me find the solution.

I am running an Uno which has 4 sensors connected to it, 3 DHT22 temp/humidity sensors and 1 Senseair K22 I2C CO2 sensor. The Uno is being powered off of 12vdc wall adapter and the sensors are powered/grounded off the Uno 5v. I used 1 cat5 cable, about 13' worth to run 3 separate wires for the DHT22 signals, 2 wires for I2C signal and then used a common power and ground wire for all 4 sensors. I ran the two common supply wires to the K22 CO2 sensor, soldered them to the board along with 3 additional supply wires for the DHT22's. So power and ground for DHT22's splits off from the K22 board.

The problem I am running in to is when I have the Uno connected via USB, the K22 gives stable read outs. When I remove the USB connection the K22 begins to give erratic readings. The DHT22's remain unaffected, however. If I simply touch the outside of the USB connector to the outside of the USB port on the Uno the K22 begins to send back stable readings. This leads me to believe that I have a ground issue.

I'm also running a 4 brick 5v relay board off the Uno and that works no problems... Everything seems to work fine without the USB ground being involved other than the K22. I'm starting to wonder if it doesn't have to do with tying pwr/gnd of all 4 sensors together the way I did?

Please help!

Have you measures the voltages with and without USB? some I2C devices are really sensitive for too low voltages.

If you have a logic analyser you might be able to see the communication failure.


I have measured the voltage and it stays above the K22's minimum of 4.5v. Previously I was having an issue with the sensor timing out on occasion and I traced that to the voltage dropping below 4.5v... I fixed that but now the problem is solely with ground signal from the USB plug. The plug does not need to be inserted in to the Uno port, only touching grounding jacket to the outside of the port. I've used 2 different adapters so far, a 6.5vdc 2a and a 12vdc 5a and experience the same issue. I've attempted tying off grounds in every which direction I can think of and nothing does it but ground signal from USB. Makes me think I am having a "dirty" ground issue and that the ground from USB is clean enough for the sensor read properly.

I'm thinking I will whip out the soldering iron and unsolder the 3 DHT22 supply wires and then see if the K22 keeps acting up. Since I am a newb with electronics I can only rely on trial and error.

The other problem I seem to be having is with high frequency noise. This is a control system for my greenhouse and when the fluorescent lights come on the DHT22 readings begin to bounce all over and become erratic. When the lights go off the sensors return to normal operation - as long as the USB ground is present.

Room Conditions: * Temp: 67.8 * Humidity: 66.9% * CO2: 1255ppm * Errors: 0 * Light:

Canopy Conditions Left: * Temp: 67.5F * Humidity: 67.4% Right: * Temp: -2926.1F * Humidity: 4930.8%

As you can see, sometimes it's only 1 sensor that freaks out, sometimes it's other ones.

might need to check al the soldering ?

robtillaart: might need to check al the soldering ?

I have looked the soldering over to make sure nothing is shorting out, etc and it all checks out.

I unsoldered the DHT22 power supply wires from the K22, leaving it the only sensor and still the same issue - Until I ground the Uno with the USB cable. The errors I get from the DHT22’s seem to be very intermittent and without pattern. Here is a pic of the Arduino side of the setup. As you can see I am using the Uno to gather environmental data and then using serial comm to send it to a Mega which then displays it on the LCD. I have no problems with the Mega and I’ve tried disconnecting it completely and I still have the same issues from the Uno.