YABC-Yet a Brew Controller: BrewManiacEx

Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum

Help Support Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
Anyway I got it to work. Time to test the power outputs. I think that with the diagram I did I can use relays directly, right?

SSR seems to draw very small amount of current, and it seemed to work for me.
Mechanical relay is not recommended for heating element control.
 
SSR seems to draw very small amount of current, and it seemed to work for me.
Mechanical relay is not recommended for heating element control.
Yes but SSR will work via 5v. Just as the relays. Thats the only thing i have left to test. Relay outputs.


Just a whole different question here. How can I change the menu to spanish?, both lcs screen and phone interface. Should I edit them within the code? How can I do that and make it available for others?

AND ALSO. Does PWM work with 0-20ms period? Can it be used to move a servo accordingly? That can be interesting to adapt it to gas burner.
 
Last edited:
Just a whole different question here. How can I change the menu to spanish?, both lcs screen and phone interface. Should I edit them within the code? How can I do that and make it available for others?

For LCD, you have to rebuild the image. All the strings are defined in resources.h.
For Web Interface, the strings are defined in index.htm. You can edit it and upload it without rebuilding the image.

I could put them on the Github if you feel appropriate. There is a Russian version of index.htm on the Github.

AND ALSO. Does PWM work with 0-20ms period? Can it be used to move a servo accordingly? That can be interesting to adapt it to gas burner.

I don't think it's a good idea to apply PWM on gas burner.
The reason of PWM is because it's easier to control the electric heating element by turning it on/off instead of controlling its output POWER. I can't image how it will work by by turning the gas on and off.
The output, generated value, of PID is in fact a VALUE. Therefore, mapping the value to the opening of gas valve should be a better way. I don't have related hardware and knowledge, however.
 
For LCD, you have to rebuild the image. All the strings are defined in resources.h.
For Web Interface, the strings are defined in index.htm. You can edit it and upload it without rebuilding the image.

I could put them on the Github if you feel appropriate. There is a Russian version of index.htm on the Github.



I don't think it's a good idea to apply PWM on gas burner.
The reason of PWM is because it's easier to control the electric heating element by turning it on/off instead of controlling its output POWER. I can't image how it will work by by turning the gas on and off.
The output, generated value, of PID is in fact a VALUE. Therefore, mapping the value to the opening of gas valve should be a better way. I don't have related hardware and knowledge, however.

Ok, i´ll try tinkering the files.

In regard to the gas thing, the deal is to control PWM within the 20ms range so you can act a RC servo with it. The servo will move the gas valve; and they work from 0-20ms. The length of the pulse is proportional to the position.

Also, do I have to edit in platformIO the words in red/orange? And keep the ones in white untouched?

I know nothing about coding..
 
Last edited:
Ok, i´ll try tinkering the files.

In regard to the gas thing, the deal is to control PWM within the 20ms range so you can act a RC servo with it. The servo will move the gas valve; and they work from 0-20ms. The length of the pulse is proportional to the position.

Also, do I have to edit in platformIO the words in red/orange? And keep the ones in white untouched?

I know nothing about coding..

In current design, it is not possible to do 20ms range. It could be done without much effort, though.
I know nothing about gas control.


Ok, i´ll try tinkering the files.

In regard to the gas thing, the deal is to control PWM within the 20ms range so you can act a RC servo with it. The servo will move the gas valve; and they work from 0-20ms. The length of the pulse is proportional to the position.

Also, do I have to edit in platformIO the words in red/orange? And keep the ones in white untouched?

I know nothing about coding..

There are two types of string in the file, the first on is StringConst.
You can change
Code:
StringConst( Initialization,"Connecting..");
to
Code:
StringConst( Initialization,"Conectando..");

The second is DefineButtonLabel, which is used to defined the button labels and has an additional id.
Code:
DefineButtonLabel( x_x_Quit_Go, "        Quit Go",0);
change it to
Code:
DefineButtonLabel( x_x_Quit_Go, "        Dejar Ir",0);

I used google translate, so don't take them serious. gracias.

Reminder: the display of LCD is 20x4. If the string is too long, you might get messy display.
The length of button labels should be 18, including space.(The space is added intentionally.)
 
In current design, it is not possible to do 20ms range. It could be done without much effort, though.
I know nothing about gas control.




There are two types of string in the file, the first on is StringConst.
You can change
Code:
StringConst( Initialization,"Connecting..");
to
Code:
StringConst( Initialization,"Conectando..");

The second is DefineButtonLabel, which is used to defined the button labels and has an additional id.
Code:
DefineButtonLabel( x_x_Quit_Go, "        Quit Go",0);
change it to
Code:
DefineButtonLabel( x_x_Quit_Go, "        Dejar Ir",0);

I used google translate, so don't take them serious. gracias.

Reminder: the display of LCD is 20x4. If the string is too long, you might get messy display.
The length of button labels should be 18, including space.(The space is added intentionally.)


Wow thank you pocektmon!!

That will do. About gas control it would be interesting to ahave a servo actuating the regular gas knob.
 
So guys..

I´ve managed to get some things insisde the box where everything will fit.

But here is the question.

Whats better? to put the relays inside de box and to output 220v? or to output 5v, and place the relays near the actuators and route the 5v cables?

I will place the SSr inside the box anyway.
 
I have one controller with SSR inside while the other has the SSR outside.
SSR might be very hot. I would say outside with heat sink might be better.
 
Hey vito another question. I have almost everything up and running. But wanted to upload a recipe. What file format is it, and is there any specific table format in case it ids an Excel file?
 
beerXml it is. So far the only standard. You can’t use it to specify Hop stand, though.
 
So.. got everything to work except one thing. The outputs to activate the relay are "not working". I put it this way because when use the multimeter to "see" the voltage at the outputs, they work correctly. 0 to 5v accordingly to what they are supposed to do. But when i try to drive the relay with those 5v, nothing happnes. The relay does not get activated.

What might it be?
 
I don't have a clue.
How do connect them?
Are you using SSR or mechanical relays?
 
I don't have a clue.
How do connect them?
Are you using SSR or mechanical relays?
I connect them correctly. Tried it with external PSU and relays works. They are machanical. I might need to use relays modules maybe. Although according to what I did in my PCB I shouldn't need them.
 
The micros' pins cannot drive a mechanical relay coil directly - you will burn out the channel and possibly the micro. You need a transistorized front end which draws much less than the pin's max output current. Think <5 mA.
 
The micros' pins cannot drive a mechanical relay coil directly - you will burn out the channel and possibly the micro. You need a transistorized front end which draws much less than the pin's max output current. Think <5 mA.


Well the PCB is made like here. The outputs are transisorized. Like this. But still not enough power to act the relays.
 

Attachments

  • 0D0[1].png
    0D0[1].png
    46.1 KB · Views: 195
What is your relay? There are different types of relays with different triggering voltages and current.
You might need to check the specification of the relay and transistors.
 
What is your relay? There are different types of relays with different triggering voltages and current.
You might need to check the specification of the relay and transistors.

Will the relay can take up to 12v and tried it at 5v with a PSU. It worked fine,but when I connection it to the 5v of the PCB it doesn't work.
 
I am not sure what part of the schematic you are showing. I don't see a relay anywhere. These 2N2222 transistors are NPN and provide a path to ground when switched on.

The ESP8266 also does not switch 5V. The I/O is 3.3V.
 
That is a fairly standard current switch on that board but trying to run a 12v coil with a 5v current source is likely to be a problem...

Cheers!
 
Well to summarize everything. I tried now using a 5v relay, but nothing happened. Even when the outputs of the mcu are transistorized. I mean the outputs work accordingly, but they cannot power the relay.

The relay is just a relay.

Should I use relay madules anyway? Even though the I/Os have 2n2222?
 
The other thing is if your trying to drive a heating element you need to use a solid state relay.
 
Well to summarize everything. I tried now using a 5v relay, but nothing happened. Even when the outputs of the mcu are transistorized. I mean the outputs work accordingly, but they cannot power the relay.

The relay is just a relay.

Should I use relay madules anyway? Even though the I/Os have 2n2222?

I use an SSR for heating control and a relay module for pump control.
Mechanical Relay is not good for heating control because of fast switching requirement.
I am not knowledge enough to provide you correct information about the transistors. I googled and found the common seen circuit, tested with it, and use it. I haven't tried to drive a relay directly. It's easier for me to find a relay module and use it.
 
Well to summarize everything. I tried now using a 5v relay, but nothing happened. Even when the outputs of the mcu are transistorized. I mean the outputs work accordingly, but they cannot power the relay.

The relay is just a relay.

Should I use relay madules anyway? Even though the I/Os have 2n2222?
From all you had posted, it looks like you are trying to do something different from what has been documented and you are not providing enough information for us to help you.

My previous knowledge in electronics was just using the multimeter to check an AC wall outlet voltage. And I found a way to put all these things together to make a 100% working BrewManiacEx for me.
 
Hey guys.. Nevermind. The problem is that I am a moron. Placed by 2n2222´s backwards. Fixed it already. Just need to figure out where I have a bad connection because sometimes buttons don´t work.
 
Soo. I've got everything done for the tests and made one. It took almost an hour to boil about 15l of water from 29C°. Is it too slow? I had this much water (picture, 2nd pencil mark on the middle left, kettle is 50l max) and no recirculation.

On the other hand I downloaded the log afterwards but apparently I cannot open it in my cellphone (Android). Is there a special software for that?
 

Attachments

  • IMG-20180123-WA0006.jpg
    IMG-20180123-WA0006.jpg
    51.8 KB · Views: 136
Last edited:
gonzalito: Heating time should all depend on your heating element power and nothing else. And if you use 240v element - you feed it between two phases, not between one phase and neutral.
 
Well heating time depends on the elements power and volume, less dissipation and other stuff. I'm using three 1200 watt elements at 240v. Since I'm from Argentina that's all I get. I could get 380v but that's nonsense.
 
Of course it also depends on volume, but what i mean is that controller have nothing to do with heating time - if it doesn't start PWM before you reach value for some reason - possibly a wrong config.
I see Argentina have 220v and you have 240v elements - which means at 220v they output 1000w instead of 1200w. It really should go alot faster than 1h to have 15L water boiling with 3000w!
I run 4800w while warming up the wort - but i do have 60L volume. While boiling i lower it to 3200w, which is enought for a quite good boil. It would actually work fine with even lower power.
 
Of course it also depends on volume, but what i mean is that controller have nothing to do with heating time - if it doesn't start PWM before you reach value for some reason - possibly a wrong config.
I see Argentina have 220v and you have 240v elements - which means at 220v they output 1000w instead of 1200w. It really should go alot faster than 1h to have 15L water boiling with 3000w!
I run 4800w while warming up the wort - but i do have 60L volume. While boiling i lower it to 3200w, which is enought for a quite good boil. It would actually work fine with even lower power.

Yes we have 220/240, didn't measure it though. I thought it was a bit slow. I might add one more since I'm using a 40A ssr. Is one of the fotek ones but seems to be working fine ftm.

I'm going to isolate the kettle too.
 
If possible use a current/watt meter to check how much power you have when everything is running. To me it seems like you don't have the power you are supposed to have. For 25L boiling volume 2000-2500w should be sufficient.
Also, throw away that Fotek SSR and buy a reputable brand... I have had a glowing red heating element because of faulty Fotek SSR's.
The fotek died and was ALWAYS on/open, so as fast as i turned on the contoller, i had full power to the element. The small signal light on the SSR worked and signalled on/off, but the SSR was always on. I have read more people than me having same problem as me, plus others saying that the SSRs are overrated with 50%, when they have opened them and looked inside.
 
Oh, and by the way - anybody who uses my PCB design, please let me know if there is any bugs you have found. Everything works fine for me - but i may have missed something, since there is a possibility of different setups.
 
Oh, and by the way - anybody who uses my PCB design, please let me know if there is any bugs you have found. Everything works fine for me - but i may have missed something, since there is a possibility of different setups.
If possible use a current/watt meter to check how much power you have when everything is running. To me it seems like you don't have the power you are supposed to have. For 25L boiling volume 2000-2500w should be sufficient.
Also, throw away that Fotek SSR and buy a reputable brand... I have had a glowing red heating element because of faulty Fotek SSR's.
The fotek died and was ALWAYS on/open, so as fast as i turned on the contoller, i had full power to the element. The small signal light on the SSR worked and signalled on/off, but the SSR was always on. I have read more people than me having same problem as me, plus others saying that the SSRs are overrated with 50%, when they have opened them and looked inside.
Yeah I've seen the issues with them but ftm I'll use it until it fails. My main concern is power.

Just in case do you know the frequency of the own signal? Might it actuate a servo? (0 to 2 Ms period).

Have you managed to download and view the brew logs?
 
Just in case do you know the frequency of the own signal? Might it actuate a servo? (0 to 2 Ms period).
I don't quite get what you are asking about here?

Have you managed to download and view the brew logs?
I haven't actually tried, never felt interesting for me. I use the controller mainly for its original purpose just a "plain brew controller" but wanted the ability of wifi-setup and to see temp, time etc from another room. Plus the simplicity that BrewPiLess uses same hardware.
 
I don't quite get what you are asking about here?


I haven't actually tried, never felt interesting for me. I use the controller mainly for its original purpose just a "plain brew controller" but wanted the ability of wifi-setup and to see temp, time etc from another room. Plus the simplicity that BrewPiLess uses same hardware.

What I meant is that servos work with pwm signals from 0 to 2 Ms, 0ms 0degrees, 2ms 180 degrees of rotation.

If the pwm signal at the MCU output is right, maybe I can adapt a servo to move a gas knob, and controla a gas burner.
 
Yeah I've seen the issues with them but ftm I'll use it until it fails. My main concern is power.

Just in case do you know the frequency of the own signal? Might it actuate a servo? (0 to 2 Ms period).

Have you managed to download and view the brew logs?

You need to use the BrewLogViewer.html to view the off-line logs.
https://github.com/vitotai/BrewManiacEsp8266/tree/master/extra

After finish that, I rarely use it again. For me, the chart provides the context during brew so that I know where it comes from and probably where it will go. It's good during brew, but it gives not much information unless there is surprise.
 
You need to use the BrewLogViewer.html to view the off-line logs.
https://github.com/vitotai/BrewManiacEsp8266/tree/master/extra

After finish that, I rarely use it again. For me, the chart provides the context during brew so that I know where it comes from and probably where it will go. It's good during brew, but it gives not much information unless there is surprise.

Thank you vito.

On another hand i think i found that PID_V1 is where the PWM frequency is controlled. If the frequency is matched to the one that servos works with, and the output scaled to their data input then a mechanical control for a gas burner might be viable.

But im not sure nor either qualified for modding codes.
 
Thank you vito.

On another hand i think i found that PID_V1 is where the PWM frequency is controlled. If the frequency is matched to the one that servos works with, and the output scaled to their data input then a mechanical control for a gas burner might be viable.

But im not sure nor either qualified for modding codes.

Yes. PID_V1 is exactly the PID library.

However, It might not be the PWM you are thinking about.
Provided INPUT, the current temperature, SET, the desired temperature, the PID algorithm will derive a value, ranged from 0-255.
To turn the output value into heating control, another parameter is introduced: Heating Window Size. For example, if the window size is 5000ms, and the output value from PID is 51, the controller will turn on the heating for 5000 * 51/255 = 1000ms and turn off the heating at the rest of 4000ms.

I don't have any experience about gas control. As far as I know, people use burners with pilot fire, and the way they apply PID is like controlling the heating element. When it's time to turn off the heating, the valve is turned off. The fire will be lit by the pilot fire when the valve is opened again.

Using the output value of PID to set control the opening of the valve is surely doable. You just need to interpret the PID output. ESP8266 supports software PWM. You might need to find out if the servo can be controlled by ESP8266.
I don't have experience and knowledge about it.

Some information for you:
https://lurchi.wordpress.com/2016/06/29/esp8266-pwm-revisited-and-reimplemented/
https://circuits4you.com/2017/12/21/esp8266-pwm-example/
 
Yes. PID_V1 is exactly the PID library.

However, It might not be the PWM you are thinking about.
Provided INPUT, the current temperature, SET, the desired temperature, the PID algorithm will derive a value, ranged from 0-255.
To turn the output value into heating control, another parameter is introduced: Heating Window Size. For example, if the window size is 5000ms, and the output value from PID is 51, the controller will turn on the heating for 5000 * 51/255 = 1000ms and turn off the heating at the rest of 4000ms.

I don't have any experience about gas control. As far as I know, people use burners with pilot fire, and the way they apply PID is like controlling the heating element. When it's time to turn off the heating, the valve is turned off. The fire will be lit by the pilot fire when the valve is opened again.

Using the output value of PID to set control the opening of the valve is surely doable. You just need to interpret the PID output. ESP8266 supports software PWM. You might need to find out if the servo can be controlled by ESP8266.
I don't have experience and knowledge about it.

Some information for you:
https://lurchi.wordpress.com/2016/06/29/esp8266-pwm-revisited-and-reimplemented/
https://circuits4you.com/2017/12/21/esp8266-pwm-example/


Thats it. Window size should be 2ms.. 0ms are 0 degrees, 2ms are 180 degrees. everything between them is proportional. That way you could turn the gas knob using a servo. But perhaps the signal cannont be processed that fast.
 

Attachments

  • PWM_servo_signal[1].png
    PWM_servo_signal[1].png
    19.1 KB · Views: 72
Thats it. Window size should be 2ms.. 0ms are 0 degrees, 2ms are 180 degrees. everything between them is proportional. That way you could turn the gas knob using a servo. But perhaps the signal cannont be processed that fast.

No. That isn't it. The window size can't be 2ms. You must use PWM function of ESP8266.

Your description seems to be disagree with your pic. I don't really get it.
Assuming the period is 2m, and 100% cycle means full open while 0% means close.(Will the fire be lit when it opens again?)

Then you will need to initialize the PWM PIN,( you can use D7).

analogWriteRange(500); // 2 microseconds, 500hz

Then, you call the following function to set duty cycle.

analogWrite(D7, (pidOutput/255) *1023);


This is the rough idea.
 
Back
Top