I love to spend time in the bathroom, even very much.
There is nothing better to take a beer, fried dumplings, aypadik and bylokodit lying in hot water.
But this idyll breaks a terrible creature, and his name is “gas column”.
The essence of the problem:
')
Our house is old, the pipelines are also old, respectively, and the pressure in the riser is simply disgusting.
If you turn on the water from the tap and tune the column in 40 degrees, then it will give you 40 degrees ... but not for long. Once you turn on the shower, the temperature will soar sharply to 50 or even higher. Also, takeoff depends on the day of the week (on weekends, the water temperature graph with a constant column setting looks like a dubstep visualization).
The reason is simple, when you turn on the shower because the diameter of the shower hose is smaller than the diameter of the pipe, then a smaller amount of water passes through the heat exchanger in the column with the same flame. Accordingly, the water is heated more. This effect is observed at the weekend when everyone accepts water procedures and the pressure in the general system drops even more, this effect can also be observed from anything in the flesh to the phase of the moon and the position of Saturn.
I nursed a plan of revenge for a very long time, but since I was very far from circuit engineering, I could not decide.
But then the hour of reckoning came and I decided.
- a cat that constantly drags this very small things
I have a column Oasis 20RG
What pushed me to create the device is the fact that the column shows the current water temperature, which means there is a sensor that can be read.
As you can see from the photo, the left-hand twist knob is responsible for the height of the flame, the temperature is controlled to it, and we will turn it on.
All the good ordered on the site amperka.ru, yes, with ebey byloby at times cheaper and would cost a penny. But the thirst for revenge could not wait.
So removing the front panel was detected temperature sensor at the outlet of hot water
which is a conventional thermistor.
By including it in the voltage divider and sticking the data into the analog input, I got an analog value, which was converted to temperature by simple manipulations and the map function.
In fact, I was tormented here for a long time because I forgot Jeremy Bloom's video lesson about the voltage dividers, but after looking again I quickly grabbed everything, it was up to small matters.
The temperature I received, it remains to place the servo and come up with a mechanic who will twist the handle of the stud.
Servu placed clearly under the hairpin
I thought how to fix it, at first I drilled holes for fastening, but the metal of the column turned out to be stronger than the metal of the bolts on which the thread instantly sat down.
An irreplaceable material was taken - nylon ties. Fixed it tightly.
I was stuck further, I don’t know what found me, but I couldn’t figure out how to mechanically connect the servo to the spire, the idea of ​​the yoke was spinning in my head, but it didn’t materialize. Thank God for Q & A prompted, in the end of the PCB was cut rocker the same length as on the server, and pasted on the hairpin.
Traction were made of flexible wire (then replaced).
Further, I made it so that when you turn on the column - the whole process is turned on, there is no need to try to raise the temperature when the column is turned off. To do this, monitor the screen's power wire (which only works when the speaker is on) for voltage. And if it is, I launch the process.
I also wrote a so-called. “Warming up” - the controller waits 10 seconds after the column is turned on and only then it starts working. Made to heat the heat exchanger.
As a result, the alpha version of the controller was born (I apologize for the bad video, then - better):
After a couple of tests, the following bugs were noticed:
Well, firstly an obvious bug with rods, they are soft and not strained, respectively, there is a backlash that prevents the rapid setting of the temperature.
In the bins was found a piece of copper wire and simple manipulations made by the traction.
We measure:
Happened:
The next bug was that the temperature sensor showed less than 20 degrees outside the window, but after a few seconds it returned to its normal state. For a long time I caught it and eventually realized what was the matter.
I powered the sensor from 3.3V output per arduino, I don’t know why, but these same 3.3 jumped, thereby changing the sensor reading. Having powered the sensor from 5V, everything became normal.
The result was a beta test:
Unfortunately I don’t know how to make two videos into one, therefore:
Arduinka logs:
Serva with new rods:
Well, in principle, that's all, then I quote the program listing, after writing the article the program was still a little bit more in order to adjust it to the fastest possible temperature equalization.
Listing:
#include<Servo.h> int termalPin=A5; int enablePin=8; int ledPin=7; int temp; int lastTemp=0; boolean enabled=false; static int minAngle=5; static int maxAngle=100; static int needTemp=40; Servo myservo; void setup() { // Serial.begin(9600); // pinMode(enablePin,INPUT); pinMode(ledPin,OUTPUT); } void loop() { // temp = map(analogRead(termalPin),800,635,31,51); if(digitalRead(enablePin)==HIGH) { // if(!enabled) { // // myservo.attach(9); // myservo.write(50); Serial.println("WARMING UP BOILER."); // delay(10000); Serial.println("BOILER READY!"); } // enabled=true; // digitalWrite(ledPin,HIGH); Serial.print("BOILER ONLINE. CURRENT TEMP: "); Serial.print(temp); Serial.println(" C"); // if(temp>needTemp) decTemp(); if(temp<needTemp) incTemp(); delay(300); } else { if(enabled) { // Serial.println("BOILER OFFLINE. GOOD LUCK!"); // myservo.write(50); // myservo.detach(); enabled=false; } // digitalWrite(ledPin,LOW); } } void incTemp() { int p=needTemp-temp; Serial.print("Increasing TEMP. P="); Serial.println(p); int pos=myservo.read(); int newpos=pos-p; for(int i=pos;i>=newpos;i--) { if(i>minAngle) myservo.write(i); if(i<minAngle) myservo.write(minAngle); delay(50); } if(p>5) { delay(p*1000); } else { if(p<=3) delay(p*3000); else delay(p*2000); } } void decTemp() { int p=temp-needTemp; Serial.print("Decreasing TEMP. P="); Serial.println(p); int pos=myservo.read(); int newpos=pos+p; for(int i=pos;i<=newpos;i++) { if(i<maxAngle) myservo.write(i); if(i>maxAngle) myservo.write(maxAngle); delay(50); } if(p>5) { delay(p*1000); } else { if(p<=3) delay(p*3000); else delay(p*2000); } }
Well, that's all, arduino was placed in the column itself next to the native control unit. External power supply by power supply found in bins.
By the way, I also returned the native screen to the place, and it also works, the guests are often scared seeing how the pen on the column is spinning itself)