Hi,
my sugestion:
Connect to your microcontroller only the SHT85 sensor and the pull-up resistors.
Then run I2Cscanner.ino https://playground.arduino.cc/Main/I2cScanner/
and see if it finds the sensor and what its address.
A temporary solution in my case seems to be the following. Just before the temperature reading I need to stop the current on the load resistors, which would look as follows:
void loop() {
analogWrite(PIN_OUTPUT, 255); //stop load current
if (sht.readSample()) {
String temp = String(sht.getTemperature(), 2);
String hum = String(sht.getHumidity(), 2);
String per = String(Output, 2); // percentage of max. voltage
Serial.println(temp + " " + hum + " " + per);
Input = sht.getTemperature();
myPID.Compute();
analogWrite(PIN_OUTPUT, 255-Output);
} else {
Serial.print("Error in readSample()\n");
}
delay(1000);
}
This seems to be working and since I am dealing with heating resistors, which react super slowly by nature, it could be a work around. I would really like to try the optical coupling, but I only have the optocoupler from the Arduino starter KIT, which I am not sure about if this is suitable for transmitting a PWM signal. I would need to look into finding an appropriate optocoupler. Any advice in this regard is hearty welcomed.
Hi,
Did you try the suggestion in post#6, yes jumping like that would help.
And a jumper between the two gnd pins of the Micro.
What you have to minimise is the volt drops caused by current changes through your PCB when you control the heaters.
The internal track from one gnd pin to the other of the Micro means that these switching currents can induce glitches in the gnd circuit within the Micro.
Externally bridging will bypass this problem.
Also placing some 0.1uF bypass capacitors at each of the power connectors will possibly help.
A 0.1uF between the 5V and gnd pins of the Micro, at the Nano pins is another noise precaution.
Have you got the SHT85 wires running along side the heater leads?
Tom...
PS, Going back and editing old posts is not a good thing, you should have posted your updated schematic in a new post.
Anyone using this thread for info, will now be confused with the flow of the thread as posts are asking for more info, and you "appear to have already supplied" it.
No, I would say it is still about the same. I read every second and I would say between every 10th and 15th reading is without success until the Arduino freezes at some point.
Yes, I have tried #6, but it did not really help. Instead, adding a 0.1µF capacitor between the + and - of the 24V supply seems to be the problem's solution, as you suggested. Thanks a lot.
What is the physical reason that the capacitor is helping? Does it have something to do with the inductance of the power resistors?