BruControl: Brewery control & automation software

Homebrew Talk

Help Support Homebrew Talk:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
Following up on a discussion a few pages back on which ESP32 pins can be used to drive SSRs (and some other learnings on ESP32 with Brucontrol).

Confirmed that I can use any pin that supports digital out as either a straight digital out or duty cycle. I am wiring 2 SSRs to pins 32&33 without issue.

I am also using serial communication for my interface that is in the same enclosure as the PC running brucontrol and discovered I cannot use GPIO16&17 with serial. I don't see this in the brucontrol documentation, but GPIO 16/17 are serial RX/TX pins. Before I remembered that fact I was seeing instability on the interface anytime the digital out devices I'd configured to those two pins were enabled.

I had also miscounted available digital out pins and after subtracting for unusable pins and pins required if I want to use SPI, onewire, etc there are a total of 10 usable digital output pins (or 6 after I subtract 4 for the chip select out for the SPI RTD probes).
so the esp 32 should look like this?

esp32.png
 
so the esp 32 should look like this?

Well on further examination I may have misdiagnosed my issue. I am still having issues but I can reliably recreate them with a straight digital out (no dual throw, no one-shot) on serial. In this configuration on any pin -- and only in this configuration, Brucontrol complains about a checksum error every time it tires to poll the interface for the status of the digital out pin.

Screenshot 2024-08-09 at 10.28.10 AM.png


If I send the ?27 command manually it works though...

Screenshot 2024-08-09 at 10.34.14 AM.png


This feels like a bug given that is reliably repeatable on multiple esp32's on serial. Oddly I can work around this by setting up the out as dual throw so I wonder if this is a regression bug introduced with that feature?

Example of this working when configured as dual throw:
Screenshot 2024-08-09 at 10.40.52 AM.png


Digital out settings:

Screenshot 2024-08-09 at 10.32.01 AM.png



Has anyone else faced this bug?

Update: Emailed this to brucontrol and got a pretty immediate reply that they'll look into it. More to come.
 
Last edited:
I am doing a little rewiring. It looks like the TF 4 must use 5v from the Mega tied to the AREF. Could I use a different 5 v Power Supply and have it tied to to the AREF on the Mega?
 
Just looking at some SSR's and I am looking at CKRD2430 for my elements as the form factor is really attractive for my build. Anyone have any experience with these
I haven't any experience with these however a nice feature of these SSR's is that they have a self contained heat sink which is a space saver for sure.
 
I have used other series from that brand and they are quality SSRs. I generally put all my high current SSRs in there own seperate metal container so I use the standard hockey puck type with a heat sink as I have lots of room. There are the real ones and not the cheap CoCo ones (CRA#@ of Chinese Orgin)
 
Still working on a diesel irrigation pump automatisation and have this script question concerning “if, and, or,else” commands. Essentially, I would like the element named “Starter Motor” to be subjected to another element called “Engine RPM” and to a timer called “Starter Timer”.

So basically, how could I script the following:


"Starter Motor" state = on
If “Starter Timer" value >= 00:00:10
or " Engine RPM" rate >= 400
then "Starter Motor" state = off

I 've been reading the brucontrol script srction of the manual, and I really can't get a good grasp of if/else commands at all..
 
Still working on a diesel irrigation pump automatisation and have this script question concerning “if, and, or,else” commands. Essentially, I would like the element named “Starter Motor” to be subjected to another element called “Engine RPM” and to a timer called “Starter Timer”.

So basically, how could I script the following:


"Starter Motor" state = on
If “Starter Timer" value >= 00:00:10
or "Engine RPM" rate >= 400
then "Starter Motor" state = off

I 've been reading the brucontrol script srction of the manual, and I really can't get a good grasp of if/else commands at all..
You are not using
if this
then that
else
then something else
logic

you need nested ifs

This turns the starter motor on
checks that the timer >= ten seconds
if it is not
it checks if the rpm >= 400
if not it loops back to check if 10 seconds.

If either is met, it exists the loop and turns off the motor.



// Starter script
"Starter Motor" state = true
[loopStarter]
if "Starter Timer" >= 00:00:10
goto "ExitLoopStarter"
endif
if "Engine RPM" rate >= 400
goto "ExitLoopStarter"
endif
goto "loopStarter"
[ExitLoopStarter]
"Starter Motor" state = false
 
You are not using
if this
then that
else
then something else
logic

you need nested ifs

This turns the starter motor on
checks that the timer >= ten seconds
if it is not
it checks if the rpm >= 400
if not it loops back to check if 10 seconds.

If either is met, it exists the loop and turns off the motor.



// Starter script
"Starter Motor" state = true
[loopStarter]
if "Starter Timer" >= 00:00:10
goto "ExitLoopStarter"
endif
if "Engine RPM" rate >= 400
goto "ExitLoopStarter"
endif
goto "loopStarter"
[ExitLoopStarter]
"Starter Motor" state = false
 
Im finally up to coding my brucontrol rig and I have an issue with the display command that is stumping me. I cannot figure out how to write an element value to a string with a defined precision. I've tried storing the value in a Value variable and setting precision there, but that precision setting is not respected when I cast the Value to a String. I've tried making sure I have the precision set in the element configuration, but again when I read the value as a string it retains all the many decimal points.

How do I successfully format the printing of a value using either the display or print commands such that it only gives me 1-2 numbers after the decimal?

Code:
varstr = "Kettle Temp: " + "Kettle Temp" Value + "F"
display "Elec1" 4 varstr

Results in a display of:
Kettle Temp: 74.5634355443554F

Code:
varval = "Kettle Temp" Value
varval precision = 2
varstr = "Kettle Temp: "
varstr += varval
varstr += "F"
display "Elec1" 4 varstr

Also results in a display of:
Kettle Temp: 74.5634355443554F
 
Im finally up to coding my brucontrol rig and I have an issue with the display command that is stumping me. I cannot figure out how to write an element value to a string with a defined precision. I've tried storing the value in a Value variable and setting precision there, but that precision setting is not respected when I cast the Value to a String. I've tried making sure I have the precision set in the element configuration, but again when I read the value as a string it retains all the many decimal points.

How do I successfully format the printing of a value using either the display or print commands such that it only gives me 1-2 numbers after the decimal?

Code:
varstr = "Kettle Temp: " + "Kettle Temp" Value + "F"
display "Elec1" 4 varstr

Results in a display of:
Kettle Temp: 74.5634355443554F

Code:
varval = "Kettle Temp" Value
varval precision = 2
varstr = "Kettle Temp: "
varstr += varval
varstr += "F"
display "Elec1" 4 varstr

Also results in a display of:
Kettle Temp: 74.5634355443554F
Not sure on a display but try converting to a string first

new value vV_Temp
new string vS_Temp
new string vS_Display
vV_Temp precision = 2
vV_Temp = "MB_200_1W_HLT_Probe_MC" value
vS_Temp = vV_Temp
vS_Display = "Kettle Temp: "
vS_Display= vS_Display+ vS_Temp
vS_Display = vS_Display + " °F"
print vS_Display
 
Not sure on a display but try converting to a string first

new value vV_Temp
new string vS_Temp
new string vS_Display
vV_Temp precision = 2
vV_Temp = "MB_200_1W_HLT_Probe_MC" value
vS_Temp = vV_Temp
vS_Display = "Kettle Temp: "
vS_Display= vS_Display+ vS_Temp
vS_Display = vS_Display + " °F"
print vS_Display
No luck. It's the same results. You can see in the Variables tab that the Value type is formatted correctly, but once cast to a string all the sudden the full precision of the RTD probe is back. I don't see anything in the guide that actually covers how type casting works in the brucontrol script language and I don't see an explicit cast at all. I also don't see any 'sprintf' equivalent in the language.

Screenshot 2024-10-09 at 6.43.19 AM.png
 
No luck. It's the same results. You can see in the Variables tab that the Value type is formatted correctly, but once cast to a string all the sudden the full precision of the RTD probe is back. I don't see anything in the guide that actually covers how type casting works in the brucontrol script language and I don't see an explicit cast at all. I also don't see any 'sprintf' equivalent in the language.

View attachment 859576
Try passing through a Global Value Element that has precision of 2

new value vV_Temp
new string vS_Temp
new string vS_Display
vV_Temp precision = 1
vV_Temp = "MB_200_1W_HLT_Probe_MC" value
"gblV_Temp" value = vV_Temp
vS_Temp = "gblV_Temp" value
vS_Display = "Kettle Temp: "
vS_Display = vS_Display + vS_Temp
vS_Display = vS_Display + " °F"
print vS_Display



As an aside, your naming of Elements may cause a problem in the future. "Kettle Temp" is now an object. For example, if you had

vS_Display = "Kettle Temp"

It would throw an error:

[ERROR Line 13: Object reference not set to an instance of an object.]

I give my Elements meaningful but unique names and use the Display Name Property to change the label

MB_200_1W_HLT_Probe_MC is my one wire HLT probe on the Main Brewery Interface (Mega 2560), Port 200, and it is on my Main Control Workspace.

The Display Name is HLT °F

1.png
 
Try passing through a Global Value Element that has precision of 2

new value vV_Temp
new string vS_Temp
new string vS_Display
vV_Temp precision = 1
vV_Temp = "MB_200_1W_HLT_Probe_MC" value
"gblV_Temp" value = vV_Temp
vS_Temp = "gblV_Temp" value
vS_Display = "Kettle Temp: "
vS_Display = vS_Display + vS_Temp
vS_Display = vS_Display + " °F"
print vS_Display



As an aside, your naming of Elements may cause a problem in the future. "Kettle Temp" is now an object. For example, if you had

vS_Display = "Kettle Temp"

It would throw an error:

[ERROR Line 13: Object reference not set to an instance of an object.]

I give my Elements meaningful but unique names and use the Display Name Property to change the label

MB_200_1W_HLT_Probe_MC is my one wire HLT probe on the Main Brewery Interface (Mega 2560), Port 200, and it is on my Main Control Workspace.

The Display Name is HLT °F

View attachment 859578
Yep, passing through a Global element does work to trick it into respecting precision! That seems like a lot to go through to format a string but now that I'm actually using the scripting language I'm noticing how peculiar it is at times.

Thanks for the note on names... I can see that being one of those bugs you sit there and curse your screen for an hour before you realize you're an idiot :). So the best practice for brucontrol is to name your elements using a unique, descriptive name that is NOT a phase you would ever want to use as part of an English sentence.
 
Hey all!

I just made a post in the parent automated brewing forum about an Android app I coded (using React Native and Expo) so I can check-in on and control BruControl from anywhere. My setup relies heavily on Node-RED for secure data input/fetching and Supabase for fermentation and other brew data.

I gave a general breakdown of how I manage my operations in the post. I would love to expand on this and put it on the app stores for all of us to use, but everyone's BruControl setup is so different, and this app relies on a ton of globals and scripts in my BruControl (but thank goodness for them!). Maybe someday, a major update to BruControl can allow for greater APIs and an app :)

I'm very proud of it, so I wanted to share.

Cheers!
 
Nice work, at least someone is making progress. I believe I speak for all of us when I say we’re all eager to see a new BruControl version after these 2 years. Sorry if I sound a bit frustrated. Does anyone have any updates, or should we start looking for other solutions? Was I wrong to leave brewpi...I wonder
 
I have gotten several direct responses from them recently as I’ve been building my system so they’re still active. That said their absence here after being so active in previous years is worrying. basing my build on the esp32 though gives me a bunch of options to use the hardware with other software should that become necessary.
 
Brucontrol communication question: could it communicate with this attached servo using CANBUS protocol? My plan is to control this servo using PWM and MOSFET amp. Reading of servo position value through analog input..
 

Attachments

  • IMG_2879.png
    IMG_2879.png
    199.3 KB
Brucontrol communication question: could it communicate with this attached servo using CANBUS protocol? My plan is to control this servo using PWM and MOSFET amp. Reading of servo position value through analog input..
The plan is to use this to move a throttle lever on a stationary diesel engine..
 
Is anyone using the newer Tilt Pros or Tilt Pro Minis on BC? I.e., BC finds them without issue? I know their UUIDs slightly differ
Just got my Tilt Pro Mini in and tested it. It works on BC! But you have to set a linear divider of 10 for both the SG and temp so you get the right decimal. But the pro minis have resolution to the ten thousandth place, so you can set the decimal places to 4.
 
Just got my Tilt Pro Mini in and tested it. It works on BC! But you have to set a linear divider of 10 for both the SG and temp so you get the right decimal. But the pro minis have resolution to the ten thousandth place, so you can set the decimal places to 4.
dear god it costs small fortune :)
How did you configure it? is BC in firmware? I have only experience with iSpindel, there BC is supported with special firmware only.
I am just curious.
 
dear god it costs small fortune :)
How did you configure it? is BC in firmware? I have only experience with iSpindel, there BC is supported with special firmware only.
I am just curious.
BC picks up the Tilts without issue. The only difference is with the regular Tilts, the SG and temp values appear as expected, while for the Tilt Pro Mini (and, thus, I assume the Tilt Pro), I had to divide the SG and temp by 10 in the calibration tab to get the right value. Not sure why it is different, but it may be due to the values being higher precision (the Pro series goes to the ten-thoudandths place, e.g., 1.0256).

One issue with BC is that the latest ESP32 firmware (v46) has a bug regarding how it reads Tilts. The values are nowhere near correct for some reason, so I have a separate ESP32 with v45 firmware just for reading Tilts. The benefit there is it can sit closer to my metal fermenters than the controller ESP32s do (but Tilt Pros/Minis have much more transmission power now, so that's not an issue anymore).

And yeah, the Pro Minis are more expensive than the regulars, but Tilt has an option to pay $90 if sending in a v2 or v3 Tilt (once received, they send the new Pro Mini).
 
Would be possible to control a small servo (such as radio-controlled hobby-types) with a pwm output from Brucontrol ? Seems like these are the signals I am looking for (attached)
 

Attachments

  • IMG_2973.png
    IMG_2973.png
    974.8 KB
Thanks @Tartan1 ! So I have a second Mega 2560 that I scripted - I actually took an existing script in the IDE library - and now I’m controlling the servo with a potentiometer. This is outside of BC - it’s done through the IDE only.
Next step is to get digital outputs from BC to my second (standalone) Mega so the servo will be controlled by BC…
 
Thanks @Tartan1 ! So I have a second Mega 2560 that I scripted - I actually took an existing script in the IDE library - and now I’m controlling the servo with a potentiometer. This is outside of BC - it’s done through the IDE only.
Next step is to get digital outputs from BC to my second (standalone) Mega so the servo will be controlled by BC…
Could you do it with a shunt circuit?
 
Yep, passing through a Global element does work to trick it into respecting precision! That seems like a lot to go through to format a string but now that I'm actually using the scripting language I'm noticing how peculiar it is at times.

Thanks for the note on names... I can see that being one of those bugs you sit there and curse your screen for an hour before you realize you're an ***** :). So the best practice for brucontrol is to name your elements using a unique, descriptive name that is NOT a phase you would ever want to use as part of an English sentence.
I found the same issue somewhat with times:

If you have a string you want to set a time, you CANNOT use a time variable but you can pass it to a global time element.

I discovered this when I was trying to set a time for the transfer of sparge water from the HLT to the MLT based on flow rate x gallons I wanted.

The flow rate was seconds per gallon. I needed to transfer 13.3 gallaons which should take 250.510 second.
250.510 / 60 = 4.175
4.175 - .5 = 3.675
You subtract .5 to so you do not Round up when passing to a global if is over x.5.
Passd 3.675 to a global precision 0 value type get minutes which is 4.


to get remainder seconds:
4 x 60 = 240
250.510 - 240 = 10.51
Pass 10:51 675 to a global precision 0 value type get seconds which is 11


So 4 minute 11 seconds is the estimated time to transfer.

Conjugate into a time format using string variables 00:04:11 and pas to a Global Time
 
Back
Top