Newbie Needs Guidance

Hello Everyone. I am so green here that you really couldn't even classify me as new to Arduino. I need to implement a system that is only a rough idea in my head, so the first thing I would like to do is explain roughly what I want to do to see if you think it is even feasible. The electricity bill at my church is absolutely ridiculous because of demand charges. What I need to do is to design a system that allows only one HAVC system to run at any given single time. Once a unit comes on, the others are prohibited to turn on for a set amount of time in order to let the working unit run some. Once the allotted time for that unit expires, it will be cut off. Then, after a short pause, another unit will come on based on priority that I would like to determine with temperature sensors around the church. I am an electronic hardware guy, so the wiring and the hardware is not an issue for me. However, I suffered a lot in my electronics career by not knowing how to code. I have friends who are software developers, and I realize there are learning tools out there, and hopefully a "cookbook" of code samples I could draw from. I just need someone here with experience to tell me "Yeah, that's a good idea", or "You're wasting your time". My plan would be to use an Arduino board with plenty of inputs and a relay module that would basically intercept the heating and cooling enabling wires from the thermostats. I would like to be able to communicate with the Arduino without having to climb up in the attic where the hardware will reside. If you feel like this is worth pursuing, I would welcome suggestions on specific hardware to purchase, and the best place to stick my toe into learning how to code it up.

Thanks much,
Brian

Welcome to the forum

A word of advice for you.

Consider editing your post to break up the large slab of text into paragraphs with blank lines between them. This will make your post easier to read and more likely to get helpful responses

In all the facilities I have worked, competing heat exchangers caused the most on-time (energy usage). Verify your exchangers are using the same thermometer.

If multiple thermometers are in use, adjust the control heads to turn the exchangers on/off at the same time (temperatures may vary). This might take a little time because the read-out might be different due to thermometer location.

On modern control heads, you can also enter schedules. Let the exchangers work for only when the building is occupied (turn on 30 minutes before opening and off 30 minutes before closing).

I found this to cut energy costs by half... verified by the energy supplier in yearly reviews.

*** And... look into DESTRATIFIERS (massive, slow-turning, fans) to push the hot air down in the cold months, and pull the cold air up in the warm months.

You are defining a load shedding process. It is very doable and also commercially available. In your case I recommend you hold on a few and get a copy of the Arduino Cookbook and skim it from cover to cover pausing on areas that are pertinent to your project. Also considering you will be switching mains power seriously consider solid state relays with zero crossing for AC loads, that will make it much easier when trying to make it work.

I have no idea how big the church is but take a look at CAN (Controller Area Network) as you can use that for sensors and controls all on the same two signal wires plus ground. Add the fourth wire and you will also have power with it. This is good for several thousand feet. Every unit will operate as a master and slave so no need for one master. Also consider what I call a power dog, that is a watch dog circuit that if the processor forgets about it it powers it down, its accessories down then starts it back up forcing everything on that node to initialize and start fresh.

Once you get through this I think you will have an understanding on how to assemble it and make it do what you want.

Just a thought, if you are on a demand metering system and three phase look into power factor correction capacitors, they can save a lot of money over time.

I think that the control system you make here should be quite safe. When you use electronics with the Arduino for this, you will typically make electronics that is quite susceptible for electromagnetic interference. It could be normal common mode transients on the mains supply that typically will make a small microcontroller like this reset.

I suggest, that you try to use more professional PLC controllers for such applications. Most of them are made to resist transients and electromagnetic noise. But they are of cause more expensive. I think that safety and reliability will be an issue here as well, and it is a lot harder to manage with an Arduino project.

Thank you for the reply gilshultz.

Yes, it is similar to a load shedding process, and I have looked at commercial units. I look at what I want as more as a load rotation process based on priority, instead of shedding a load at a particular point. But in the end, the hoped for result is the same.

Excellent advice on the cookbook. I see that there are several - would you recommend the latest version by Michael Margolis?

I will not actually be switching mains power. That is what made the load shedding commercial device unattractive to me - and the cost as well. I will simply use relay contacts on the wires that signal for heat or cold which run ~ 24 VAC.

It is not a large building, and I like the idea of a CAN.

Yep - I remember my software buddies having to put a watch dog into the code that ran one of our access control panels. That was the first time I realized that code is not "sterile / perfect" if you will.

We run on single phase AC.

Just to give an example of why I am trying to do this - our electric bill for December: We used $114.65 (843 kWh) but our delivery charge was $415.41. That is mostly because our peak demand for the month was 30Kw. So without a doubt, there was a 15 minute period where all 3 units were running at the same time. That's what I am trying to prevent.

I almost thought of just doing this with plain old relay logic and 555 timer, but I think it's better to pick which unit gets to come on next based on temperature rather than just a "blind rotation". I have also toyed with the idea of disconnecting a heat strip (we are all electric) out of each unit and just running them longer, since demand is the problem rather than usage.

As soon as you verify the cookbook I asked about, I will get it ordered. (As bad as I would like to order hardware and start dinking with it).

UKHeliBob - you are correct sir. I hope I get a better grade on the use of paragraphs this time ;-).

Thanks again,
Brian

1 Like

I agree backflip. However, I won't be touching the mains - just the 24 VAC on the thermostat wires. I have a friend who works in a large industrial plant, and his opinion was that a PLC would be overkill for this little project.

I appreciate your input,
Brian

1 Like

xfpd,

Thanks for replying, but I believe you are talking about a more industrial form of hvac than we are using. These are just basic, all electric, hvac units.

I am glad to hear that you were able to cut your energy costs in half - that's encouraging.

The use of Destratifiers is also a good idea. We have stained concrete flooring throughout which makes for a cold floor, as well as a high vaulted ceiling in the sanctuary.

Thanks,
Brian

You are correct sir.

I will do better.

Thanks,
Brian

The coding doesn’t seem particularly onerous, although you would want to test it very rigorously.

However, I would be concerned about using a homegrown system in what is essentially a public building. If there ever were a fire………

I’d get an HVAC company on the case instead.

Thank you wildbill.

Well, I am encouraged that your opinion is that the code might not be too complex. Right now, what I know about C++ is that you put \ in front of a comment...

Yes, I will indeed test it thoroughly. My last position was QA, which I absolutely detested because I was at constant war with the software developers. At least this time I won't have anyone to blame but me. And I will be the first to admit that the solution, though a simple concept, is challenging. In extreme weather, it could very well be difficult to keep every place at a comfortable temperature by juggling 3 units around. What works great on the bench doesn't always work in the real environment. IF I can get it working, it will probably need a bit of tweaking.

I have a relative who owns an HVAC company and I have talked to him at length about this. The industry approach for efficiency (other than proper upkeep, maintenance, or buying more efficient units) basically involves balancing temperatures by using motorized vents in the duct work to open or shut to provide the best efficiency as a whole. As of yet, I have not seen a way in the HVAC industry that does what I need it to do, which is basically only letting one unit run at a time. Maybe it's there and I haven't found it.

I didn't go into this with the idea of "rolling my own" solution. I thought that surely there was a way with smart thermostats linked up to a google nest or something like that, but I've not seen anything. I also looked for thermostats that had lots and lots of programming times so that I could just solve the problem by not overlapping times - no luck with that either. I have scoured the internet thinking surely someone has already done this. But if they have, I haven't found it...

As someone on this thread said already, there is a commercially available product that will shed a load, but they are expensive, and, they involve switching the supply voltage on and off. Also, from what I have seen, they don't have any smarts as far as which load to shed. That scenario could very well shed a unit that was most needed.

As far as a fire hazard, I don't mean to sound cocky at all, but I am not concerned about that. I don't plan on doing any more than the relays in the thermostat do - all low voltage stuff. And as long as I don't put all of this in an enclosure that has 120 VAC running to it, then UL approval is not required.

I hope I am not coming off as being critical or unappreciative of all the replies I have been given. It might seem that I am close minded about it, but that is not the case. I am grateful for all the thought that has been put into each reply.

Our Pastor is a retired lineman / smart meter man, and even he is critical - not of my specific plan, but the general idea. He's been to many training seminars and has been told that many have tried to beat the demand system, but nobody's done it yet. I don't buy it.

Thanks,
Brian

LOL! Sry, but the only thing you know is wrong…

// this is a comment

It also looks like the backslash you may have typed two, but the Markdown formatting language makes it look like just one.

a7

Head slap.
// This is a comment
// See spot run

LOL! I'm on the way now.

I hate to say this but all three versions are good and by Michael Margolis. The latest would probably be the best but the others are just about as good. They have some information the new one does not but it is covered in a different way.

There are many different systems on CAN and the best one is the one that works for you. It can be home brewed as is my home system or a variant of a commercial system. CAN will tell you if a message is not sent, that is part of the protocol however it does not tell you who received it, the message can be acknowledged by any member(s) on the network. I use a simple acknowledge by the target unit, it simply returns the checksum to the sending address.

You can have a lot of information on the bus such as temperatures in differents parts of the building as well as different sides outside. I think with the demand you need to lock out any non running for 15 minutes after the last start.

I have not worked with demand for a while so the rules have probably changed. Each unit can send its information at will there is no need to schedule it but it should also respond with the information if requested.

about two years ago I had to replace my roof, I paid extra for a ridge vent, I have gotten that extra back already in a lower electric bills. I have a sensor in the attic and it is definitely cooler in the summer.

Keep us in the loop.

Common mode high frequency burst transients on the mains pass through power supplies to the low voltage side and through nearby cables to low voltage cables. Burst transients are also generated by mechanical switches or relays on low voltage. So you are in no way safe from those transients just by the use of low voltage.

Well guys,
I am not exactly sure what to think at this point - I'm getting mixed opinions as to whether or not the Arduino is suitable for this application. But alas - feedback is what I asked for. In case it might sway any of you, I do not envision this to be a bread boarded rats nest thrown in the floor - It would be in a metal enclosure with a cooling fan and a door. All connections would be permanent and sound. That said, I am concerned with backflip's point about burst transients. Backflip - is there anything you can suggest to protect the Arduino? Things that come to my mind is perhaps using a multiple relay module with solid state relays and an I2C interface. But, even that only provides protection on the output side - perhaps the use of opto-isolators on the input side would help.

Gilshultz - I have the 3rd edition of the cookbook on the way.

I have done some rethinking of the project

Gilshultz talked about a CAN for the temperature sensors, and I did say in my initial idea that I wanted some temperature sensors. However, after giving it some thought, I think I only need one temp sensor, and that one will monitor the temperature outdoors.

Whomever installed our HVAC units really did a good job of thermostat placement and balancing. We do not have rooms that get overly hot or cold, either in extreme heat or cold. This obviates the need (in my mind) to monitor temperature anywhere other than the thermostats themselves.

I have not specific about our building - as churches go, it is not large at all. We have 3 HVAC units. I need to check them to see the actual size. The 2 large ones serve the sanctuary. I spoke to my pastor yesterday, and he has tried to heat the sanctuary with ONE unit. This will work, but only if it is not extremely cold outside. In Central Texas, that would mean 15 - 20 degrees F.

Thus my idea about monitoring the outdoor temp - My idea is to have the code work in 2 different modes. If the temperature is extremely hot or cold (values TBD) then it would operate in a mode where the 2 big units would be allowed to run together, and take turns with the other single unit.

The other mode would be "Mild" weather. This would be where only one unit is allowed to run at any time. When I am rotating 3 units, I don't think it needs to be as complicated as I originally thought. The next unit that is allowed to run will be whichever of the other 2 thermostats calls for heat or cooling first.

So to summarize - I am looking for more input about protecting the Arduino, or scrapping the idea. Secondly, I apologize to gilshultz for incorrectly conveying the idea that I needed additional temp sensors and wasting all his time explaining CAN. Any thoughts about my re-think of the implementation would also be appreciated. I don't mind working hard and digging into this, but I don't want to waste your time or mine.

Thank you all again,
Brian

You know what - scratch that. I don't give up this easily! I will do what I can to protect the Arduino and get on with it. One facet of this project that I have not shared is the fact is that is absolutely not mission critical. If it works out great, if it doesn't, then I either figure out how to fix it, or realize I'm chasing a ghost. If it malfunctions, we just unplug it, the relays close up, and we operate normally.

I will have the cookbook in hand in a couple of days and I will dive in. So, it could be a while before I post again.

Thanks for listening to me talk to myself....
Brian

OK - I got the 3rd Edition of the Arduino Cookbook. Wow! I am already amazed at the possibilities, and am anxious to get to see some of the details on the code side that I never understood being a pure hardware guy. Some of the terms that developers I worked with used everyday have snapped into focus for me.

I have an Uno R4 WIFI headed my way along with a starter kit. This might be overkill for my end project, but the WIFI capability, more speed and memory makes it (I think) a good choice to dive in with. I just wanted to let everyone know that I am optimistic and moving forward.

I will report again once I get the board up and running and have played with a few sketches. I know that will not be very interesting for you, but I want to keep the thread alive and I want to show progress.

Thanks,
Brian

When you get a little further along, ask here about Wokwi. You can do a whole lot of the headscratching exercise of learning to code without touching a wire or screwdriver; since you're familiar with the harware side, there's little to be gained there, it's coding you need to learn.

What you describe is conceptually quite simple. The risk you take, well, that's up to you.

Wokwi. Remember that!

Is your church in an industrial area? If in a residential area, get your power supplier to change your rate code to residential. Perhaps visit the Public Utilities Commission.