Thermostat servo controller

Greetings! I am using a Nano to make a "simple" thermostat controller. My idea is a tiny bit complicated, because I want to control a fan based on the difference between two temperatures. So, I've wired in TWO DS18B20 temperature sensors and one servo... the code will use the difference between the two temps to move the servo, and control the speed of a fan. I've got it all wired/set up according to the schematic below. And, each individual component works: meaning, if I have two thermometers and no servo, I can get readings from them; if I have the servo and no thermostats I can move the servo... so I know the wiring and code "works". The issue is when I put all the items together, then it works "sort of"... until I get random junk on the serial monitor and it just stops working.

I'm (clearly) not an electrical engineer, but my layman's read is that I don't have enough power/amps to power both thermometers AND the servo. The good new is that this does not need to run very quickly, so I would be totally comfortable with it taking readings every minute, and updating the servo position a few seconds later (meaning, they don't need to "run" at the same time). I also was Googling it, and I saw that someone who had a similar project put a capacitor inline with the servo, which I think helped -- but not sure how big a capacitor to put in, or how to figure that out. And, another option would be to remove the servo power from the board, and run that with a separate power supply. And, finally, not sure if it makes any difference that I'm using the same ground wire for both the servo and thermometers... would it help to separate that? Or... something else? So, to summarize:

  • Put in a capacitor, but if so how big?
  • Separate power supply for servo?
  • Two ground wires?
  • Something else?

Use a separate supply for the servo.
Try 4 AAs.
Don't forget to connect the grounds.

Sorry for the stupid follow up, but you mean connect the grounds to each other, right?

Yes.

1 Like

Well, if you connect them to anything else, you will probably cause a short-circuit!

It seems strange to use a servo to control the speed of a fan. How is the fan powered? Is it mains AC? Normally these only have 2 or 3 speeds, plus off, rather than continuously variable speed. If that's the case, you can probably select off/1/2/3 with a couple of relays connected to the wires that would connect to the rear of the fan control knob.

How is the Arduino powered? If powered with a 7V+ DC PSU connected to the Vin pin of the Nano, forcing the Nano to power the servo may be too much for the Nano's on-board regulator.

If I wanted to plug it into the wall (hate changing batteries)… 5v 2amp wall plug thing would work?

Yes it would be better, but you should still have separate supplies for the servo and the Arduino.

So, two plugs, each 5v and 2(ish) amps, should work

Depends on the power needs of your servo (unknown to us)

Fair point... the servo is FTech FS5109M, which could draw more than 2amps at load... now that I look at it more closely, it certainly explains why this wasn't working :-). I bought a 3amp 5v power supply, and will give it a whirl now.

PaulRB, to answer your question "why a servo and not wire in relays"... the answer is two fold:

  1. I didn't want to get into wiring relays into line voltage, or dissembling a switch I didn't understand at the risk of blowing myself or house, or arduino up (remember: not electrical engineer).
  2. The switch on the fan is continuous variable, so it seemed nice to be able to slowly move the fan up as the temperature differential increased.

In short, I'm building a mechanical solution to an electrical problem, but that will be safer and within my skill set. Part of why I like the arduino approach.

1 Like

I think one PSU, with sufficient current capacity, should be fine. The Nano won't need much for itself, maybe 50mA, so having a separate PSU seems overkill. But don't route high currents through the Nano. Wire the servo directly to the PSU for power, and separate wires from the PSU to the nano to power that (to the 5V pin if using a 5V PSU).

Well... the way I have it wired now is that the new PSU goes to the pos on the servo, and ground to servo and gnd on the nano. Then, a separate PSU (and/or computer, if I'm uploading to it, etc.) is going to the USB mini port either from a USB power supply or the computer. I'm fine taking up two outlets with it... it's going in a closet. Will that work?

I should add: THANK YOU, it works now!!! The separate power to the servo solves the problem. I didn't read the servo docs to closely, and it is a super powerful high touque servo, that draws some crazy power... so no wonder it couldn't run on the nano...
-A

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