I re purposed a dehumidifier into a water chiller. The Arduino acts as the trigger to turn the dehumidifier on/off. It does this by monitoring the water temp and sending a signal to the dehumidifier at a certain temp. The signal send to the dehumidifier tricks it into thinking that the humidity in the room is 90%, thus turning it's self on. When no signal is being sent, the dehumidifier thinks the humidity is only 20% and it shuts off. All is working well for the most part but I have something funny happening.
Arduino Uno (official)
Dallas Waterproof Temp sensor
16x2 LCD
Everything works perfect when the Arduino is power from my laptop's USB. Volt meter reads 5.05-5.03v.
If the Arduino is powered from my laptop and my laptop is plugged into the wall, the temp sensor will read properly several times in a row and then bug out and read -137 once or twice, then it goes back to reading properly several more times before bugging out once or twice. This process repeats as long as the laptop is plugged into the wall (not running on battery). Volt meter reads 5.05-5.03v.
If the Arduino is powered from the dehumidifier, via "Vcc in" all works well until the dehumidifier turns on, then the LCD gets scrambled with funny characters and I can't tell if the sensor bugs out or not. It seems to run OK even with the scrambled screen but I can't be sure. Volt meter reads 4.05-4.04v
If the Arduino is powered with a 9v power supply, see #2.
The sensor bugging out for even 1 reading results in the dehumidifier turning off due to the program thinking the temp is -137 which is far below the shutoff value of 60 degrees.
4V is to low for Vin pin. You need at least 6.5V there. How long is the cable which temp sensor is attached to? Did you use pull up resistor for 1 wire signal? Are you sure you got - 137? Wasn't it - 127? As for rubbish on LCD - it's caused by electrical noise generated by dehumidifier or relay - if you have one connected. You have to move arduino away from source of noise, use short cables. It's possible to put lcd.begin() in loop firing every 10s or so but it's a dirty and temporary solution.
In order to "hack" the dehumidifier, I just cut the humidity sensor. It had 3 wires, Vcc, Gnd, and a yellow wire. Upon testing the voltage in the yellow wire changed depending on the humidity. After cutting the sensor off and discarding it, I hooked the GND wire (from the dehumidifier) directly into the Arduino's GND. The yellow wire into digitalpin 9, and the Vcc into the Vin. If I measure the voltage from the vcc/gnd coming from the dehumidifier it reads 5v but if I take the reading from the breadboard where everything's being powered from I get 4v.
@waski, 4v might be too low but it seems to work the best. Sure the LCD bugs out but at least the sensor doesn't seem to bug out. I can't be 100% sure as I've never sat and watched it for more then 20 min, but when I check on things I've seen the water temps near the shutoff value, 60F. When powered with 9v powersupply or laptop plugged in, The temps don't typically get that low due to the sensor bugging out and causing a premature shutoff. The sensor is this: Temperature Sensor - Waterproof (DS18B20) - SEN-11050 - SparkFun Electronics. Yes I have a resistor between the v+ and the signal wires on the sensor. It very well be a -127 reading while bugging out, I took a guess at the actual number as I wrote this from bed and didn't have the actual data on hand. The Arduino is about 1-2 feet from the dehumidifier, is this too close?
@TomGeorge, I have a GND lead from the dehumidifier to the Arduino. I have a GND from the Arduino to a breadboard and that supplies the GND to the sensor and LCD (they are shared on the breadboard). I can use the power from the dehumidifier, I can also not use that power and use external 9v, or USB via laptop. This works as long as I keep the GND from the dehumidifier plugged into the Arduino. I don't have decoupling or filtering caps around the Arduino, honestly I don't even know what they are. I'll look into it though.
@waski, also after the LCD scrambles, once the dehumidifier turns off and the noise is removed, often the LCD doesn't fix it's self and stays scrambled. The code does clear the LCD and re prints everything every 5 seconds or so. Every now and then it will unscramble though, so I'm lost.
What is the voltage at 5V pin on arduino when you powering it thru Vin pin ? I've made that mistake once , and fed 5V to Vin pin . At first, everything was ok. But strange things started to happen - I measured voltage on 5V pin and red - 3.2V ! Power from Vin pin goes to 5V regulator first - and thi regulator needs higher voltage to vork properly .
The -127 value means some errors from DS sensor - usually it is caused by electrical noise , bad cable etc . I would separate dehumidifier and arduino by adding relay or transistor : relay would switch yellow and GND (? VCC? )cable from dehumidifier.
@waski, It's 4.04v at the arduino. I have a relay board and will try hooking the yellow signal and GND to the relay. I'll report back with my results. Thanks for the suggestion.
Every time I have ran into a scrambled 1602 lcd, it is usually transients caused from switching an inductive load. Don't forget snubbers and decoupling capacitors. you might have to use a triac with zero crossing optocoupler which, in my case, worked the best.
@seanz2003, I'm very new to electronics and I'm not sure what those components are. If you could maybe link me to a part somewhere and let me know where in the circuit they would go, I'd greatly appreciate that.
@waski, I'm not sure what to tell you about the Vin, it worked the best out of everything I tried. Before I try just putting it on a relay, I got my hands on some shielded cable and moved the Arduino a fair bit away from the noise of the dehumidifier. It has been running for over an hour completely error free. It's being powered by my laptop which is plugged in. I'm going to try external 9v power supply to confirm. I'll keep you updated.
The best solution is to try to pin-point what is causing the noise and either stop it at the source or identify how it is getting to the arduino setup and filter it out. however, I wouldn't recommend attempting the following solutions for the AC mains side unless you have some experience, but at least you should learn about it:
Triacs; TRIAC - Wikipedia greatly reduce voltage spikes when used with a zero crossing driver.
snubbers : Snubber - Wikipedia a very basic AC snubber is a capacitor and resistor in series connected across the load. Make absolutely sure to use appropriately rated components (500+ volts) so that they can handle mains voltages.
Options for the low voltage side:
Decoupling: De-coupling
Isolating your arduino outputs with optocouplers.
Use a different outlet or mains circuit to power the arduino then what your ac load is connected to, if possible
Shielding the wires that run from the arduino to lcd display with a braid or foil helps too.
Pictures would help us help you as well as a schematic.
Just to be clear, in #3) it sounds like you are using the dehumidifier to power the arduino? Have you verified that Vcc is 5 volts with out the arduino connected (unloaded)? if it the voltage is sagging that much, the dehumidifier isn't a reliable enough source.
Hi, breadboard?
Is it the prototyping sort, which is just an array of pins sockets in rows?
If so, does it have down each side red and black or blue lines, indicating that two rows are pins connected together longitudinally?
Does the red and black or blue lines have a break in them halfway down the board, this indicates that the row is open circuit there, so red and black or blue is not continuous,
So you may not have proper gnd or supply continuity if you are using them.
Can you post a picture of your project please.
Sorry it took so long to update but I have been running for about a week now with no bugs. I have used laptop usb power and external 9v power supply. Shielded cable was my solution, and moving the Arduino about 4-5 feet away from the dehumidifier.
Thanks for all the help to all that replied!
@seanz2003, Thanks for that wealth of information. I have read some of it and plan on reading the rest soon.