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.

pocketmon

Well-Known Member
Joined
Oct 12, 2015
Messages
792
Reaction score
283
bmex.jpg


BrewManacEx is a brew controller based on ESP8266. It was started by mimicking famous Arduino-based Open ArdBir, so most of Open ArdBir functions are included.

  • Manual and Automation brewing process control
  • PID and PWM heat control
  • Automatic PUMP control

The operation is almost like Open Arduino, while the most important feature that BrewManiacEx differs from Open ArdBir is


  • WiFi Enabled, Web-based interface
    You can view, change the settings, monitor and control the brew on your phones, tablets, and computers.

Additionally,

  • Multiple sensors support
    Up to 5 sensors are supported. Different sensors can be used in different stages.
  • PID autotune
    Run the PID Autotune to get the best PID parameters for your system instead of guessing.
  • Sparge water Heating control
    Run the sparge water heating when the main heating element is idle during mashing to enable using only one 15A/20A GFCI socket.
  • Temperature logging chart
    Watching the temperature chart during brew and after brew

The hardware is relative simple. In additional to the socket, Relays, button, and LCD, the main circuit is comprised of a ESP8266 and PCF8574.

My first trial version was made by a PCF8574 board and a NodeMcu board:
bm_inner.jpg


Second version is made by a WEMOS D1 mini and a custom-built shield:
bmnew.jpg


I am using with a Grainfather
BM_GrainFather.jpg


Latest brew temperature log:
gfbrew.jpg


I am going to attach additional sensors for next brew.

The source code, reference circuit, and prebuilt image can be find on github:
https://github.com/vitotai/BrewManiacEsp8266

You can find some screenshots in the user manual:
https://github.com/vitotai/BrewManiacEsp8266/blob/master/docs/BrewManiacExManual_0.1.pdf
 
yes. I used this IO expander.
The parts for 1st build
1. NodeMcu. $5
2. PCF8574 IO expander $2
3. I2C 20x4 LCD. $5-8
4. membrane keypad $2
5. buzzer. $1
6. Ds18B20 waterproof sensor $2-3
7. 1 Way relay module $2
8. SSR w/ heat sink $6-8
9. 5V power supply $5
10. 4.7k resistor, a few header pins for power and GND $1-2
11. waterproof case $15-18 The most expensive one!
12. sockets, power cord $5-
 
You'll set a record for the cheapest controller ever.

I think I can do roughly the same for an Open ArdBir build by replacing the NodeMcu and PCF8574 IO expander with an Arduino Uno. However, Arduino doesn't have WiFi capability, and the small memory of Arduino Uno limits the additional functions: PID AutoTune, multiple sensors, data loggings, and etc. (Yes, I've tried that.)
 
Why do you need to replace the NodeMCU? Not enough I/O (hence the expander... I didn't count). The NodeMCU I have seems to have a good bit for a basic single vessel brewery, and has lots of I/O: https://www.amazon.com/gp/product/B010O1G1ES/?tag=skimlinks_replacement-20

Do not use an UNO. The memory constraints will make your life a nightmare. If you want that form-factor, get a 101 or a Zero. They can be made WiFi with a shield but the best one is based on the WINC1500, and the shields have been unavailable for months.

If it were me (it would break your relative bank), get an MKR1000 or a Adafruit Feather M0+WINC1500. Love that last board and pretty much 100% Arduino compatible.
 
Last edited by a moderator:
Why do you need to replace the NodeMCU? Not enough I/O (hence the expander... I didn't count). The NodeMCU I have seems to have a good bit for a basic single vessel brewery, and has lots of I/O: https://www.amazon.com/gp/product/B010O1G1ES/?tag=skimlinks_replacement-20

Do not use an UNO. The memory constraints will make your life a nightmare. If you want that form-factor, get a 101 or a Zero. They can be made WiFi with a shield but the best one is based on the WINC1500, and the shields have been unavailable for months.

If it were me (it would break your relative bank), get an MKR1000 or a Adafruit Feather M0+WINC1500. Love that last board and pretty much 100% Arduino compatible.

I used Arduino at first and then switched to ESP8266. It was really a pain to squeeze some memory. I've tried for two weeks only for 100k.
 
Last edited by a moderator:
The boards I mentioned (except the 101) are all M0 based - you will have a hard time filling its flash of 256k and 32k of RAM.

The esp8266 has 4M or 16M(pro version) of flash. Web server, db for loging and pages for UI. Hard time filling 256k???? Bet he's into a couple meg.
 
The boards I mentioned (except the 101) are all M0 based - you will have a hard time filling its flash of 256k and 32k of RAM.

The esp8266 has 4M or 16M(pro version) of flash. Web server, db for loging and pages for UI. Hard time filling 256k???? Bet he's into a couple meg.
 
The esp8266 has 4M or 16M(pro version) of flash. Web server, db for loging and pages for UI. Hard time filling 256k???? Bet he's into a couple meg.

I checked, and it is 290KByte for web files only, already compressed. A picture of 130k was ditched. The code size includes the SDK part, but I guess my code with the libraries used should sum up to 150kByte.
The log file for one brew is around 1K~2K. Additional space is needed for recipe storage.
I don't even need to try.
 
So what your saying is there plenty of room to dev beerxml intergration???
 
yes. I used this IO expander.
The parts for 1st build
1. NodeMcu. $5
2. PCF8574 IO expander $2
3. I2C 20x4 LCD. $5-8
4. membrane keypad $2
5. buzzer. $1
6. Ds18B20 waterproof sensor $2-3
7. 1 Way relay module $2
8. SSR w/ heat sink $6-8
9. 5V power supply $5
10. 4.7k resistor, a few header pins for power and GND $1-2
11. waterproof case $15-18 The most expensive one!
12. sockets, power cord $5-

Possible to drop some components if web is the only userinterface I need?
(My Pad is on the wall in my brewery)
 
Not sure your question, but IMO an MCU should not be used for user interface work.

There is no reason to stick with Arduino when you need additional SD card, WiFi shield, and etc. Raspberry Pi might be a better solution.
On the other hand, a NodeMcu has 4MB flash, 96K RAM, and WiFi capability. It costs only $5 or less.
Why stick with Arduino?

Is it MicroController Unit when you said MCU? Most smartphones today uses ARM cores which are regarded as MCU. Back to a few years ago, a lot of non-smart phones have MCUs running at 13Mhz with 1~2MB flash. Although equipped with small LCD and only 16~24 keys, they had menus, phonebooks, and text. I don't see any reason why an MCU should be used for user interface.
 
Possible to drop some components if web is the only userinterface I need?
(My Pad is on the wall in my brewery)

short answer: NO. The system is designed to work alone with OPTIONAL web interface.

The problem is that the connection is not reliable and there are constraints for a web page. For example, a web page can't stop iPhone/iPad from entering sleep while an APP can. When safari is put to background or when iPhone/iPad enters sleep mode, the communication is stopped. The communication is unreliable.
Well, things change fast, it might change(or has changed) anytime. It was true when I surveyed last time.

:off: I worked in wireless industry. During all my career, at least 99% of the effort was spent for the unreliable nature of wireless. I would never rely on wireless communication.
 
There is no reason to stick with Arduino when you need additional SD card, WiFi shield, and etc. Raspberry Pi might be a better solution.
On the other hand, a NodeMcu has 4MB flash, 96K RAM, and WiFi capability. It costs only $5 or less.
Why stick with Arduino?

Is it MicroController Unit when you said MCU? Most smartphones today uses ARM cores which are regarded as MCU. Back to a few years ago, a lot of non-smart phones have MCUs running at 13Mhz with 1~2MB flash. Although equipped with small LCD and only 16~24 keys, they had menus, phonebooks, and text. I don't see any reason why an MCU should be used for user interface.

I guess I foolishly thought the M0 could handle more based upon my compliling comparisons. I just tried compiling the same good-sized sketch on a Feather M0 and a NodeMCU 1.0. These are all code, not static text/fluff stuff:
Feather: Sketch uses 58400 bytes (22%) of program storage space. Maximum is 262144 bytes.
NodeMCU: Sketch uses 278601 bytes (26%) of program storage space. Maximum is 1044464 bytes.

What I don't understand is why the NodeMCU says 1M of storage... I have the compiler set to 1M SPIFFS, so it should be at least 3M, so will need to investigate. Certainly the ESP has more memory, just not compiled as efficiently, at least here in the IDE.

Anyway, I see little to no reason to use a microcontroller (yes MCU) as a one-off automated brew controller. Yes, it is inexpensive, but takes too much development time to test, change, update, etc., and the user interface options are just way too limited. Personally, I like a nice "cockpit" information screen, so I can control and visualize all of the components in the system simultaneously. But hey, that's me.
 
short answer: NO. The system is designed to work alone with OPTIONAL web interface.

The problem is that the connection is not reliable and there are constraints for a web page. For example, a web page can't stop iPhone/iPad from entering sleep while an APP can. When safari is put to background or when iPhone/iPad enters sleep mode, the communication is stopped. The communication is unreliable.
Well, things change fast, it might change(or has changed) anytime. It was true when I surveyed last time.

All you have do to circumvent this issue is put a "watchdog" in the html page and have it kick the process on the server every second or so to keep it alive. If the server doesn't receive a kick from the client, it goes into safe mode.

It creates network traffic, but on a local network, who cares ? Then all you have to do is disable sleep on the client device.

Lots of industrial process control systems use watchdog setups, both in hardware and software.

I'm with the other people, anything with a UI/ http UI should be implemented on something that has a network and http stack. RPi is perfect as far as I am concerned.

One of the biggest wasters of development time is to chose a hardware platform that you eventually outgrow - for features, memory, processing speed, etc. That is where I feel you are headed here.

I find your thread title interesting - "yet another". There are a lot of controllers out there, but I've yet to find one that does exactly what I want. In this day and age, I have no idea why people are spending huge $$$ and time wiring up "control panels" for their brewery. Are they compensating for something ?

I'd rather have a black box that everything plugs into and control it from my (PC | laptop | tablet | phone). If I'm going to spend some money on a fancy brewery control interface, I want a 24" touchscreen beside my brew kettles, one where I can touch a control and drill down to see temp history, PID settings, etc. That and being able to upload mash schedules and keep track of brewing notes while using it.

And yet I've not seen a single controller that does all this. Hmmm...
 
I guess I foolishly thought the M0 could handle more based upon my compliling comparisons. I just tried compiling the same good-sized sketch on a Feather M0 and a NodeMCU 1.0. These are all code, not static text/fluff stuff:
Feather: Sketch uses 58400 bytes (22%) of program storage space. Maximum is 262144 bytes.
NodeMCU: Sketch uses 278601 bytes (26%) of program storage space. Maximum is 1044464 bytes.

What I don't understand is why the NodeMCU says 1M of storage... I have the compiler set to 1M SPIFFS, so it should be at least 3M, so will need to investigate. Certainly the ESP has more memory, just not compiled as efficiently, at least here in the IDE.

Anyway, I see little to no reason to use a microcontroller (yes MCU) as a one-off automated brew controller. Yes, it is inexpensive, but takes too much development time to test, change, update, etc., and the user interface options are just way too limited. Personally, I like a nice "cockpit" information screen, so I can control and visualize all of the components in the system simultaneously. But hey, that's me.

The Sketch size of NodeMcu includes not only your code but also the libraries (for Arduino environment) and SDKs( for WiFi and others.). You don't think we can get the WiFi function for free, do you?

I bet the 1M program storage issue has something to do with Arduino IDE setting. But, who cares? My project, BrewManiacEx, takes less than 500k program size. I would never wrote a sketch larger than that.

It's not only you who don't want to use small MCU to do COMPLICATED user interface. Me, neither. Put aside the OPTIONAL web interface, the project works just like an Open Ardbir with TINY LCD and 4 buttons. All operations can be performed in from of the controller without additional phones, tablets, or computers. It's good to have nice interface, but I like to use physical buttons for simple operation, like heater, pump control, or "Yes" to continue.
Some people asked about touch LCD, and my answer is NO. Never on ESP8266.
 
All you have do to circumvent this issue is put a "watchdog" in the html page and have it kick the process on the server every second or so to keep it alive. If the server doesn't receive a kick from the client, it goes into safe mode.

It creates network traffic, but on a local network, who cares ? Then all you have to do is disable sleep on the client device.

Lots of industrial process control systems use watchdog setups, both in hardware and software.

Surely there are ways. I would implement an APP by using WebView to get all APP privileges.
BTW, timers are usually stopped when the browser is put to background.

I'm with the other people, anything with a UI/ http UI should be implemented on something that has a network and http stack. RPi is perfect as far as I am concerned.

One of the biggest wasters of development time is to chose a hardware platform that you eventually outgrow - for features, memory, processing speed, etc. That is where I feel you are headed here.

Exactly. I probably stop developing new functions for this project after adding simple recipe management.

I find your thread title interesting - "yet another". There are a lot of controllers out there, but I've yet to find one that does exactly what I want. In this day and age, I have no idea why people are spending huge $$$ and time wiring up "control panels" for their brewery. Are they compensating for something ?

I would guess that they think it's more REAL brewing by direct controlling the brew process. At the same time, simple system requires less maintenance. What can go wrong with simple switches? If a switch broken, just replace it.

I'd rather have a black box that everything plugs into and control it from my (PC | laptop | tablet | phone). If I'm going to spend some money on a fancy brewery control interface, I want a 24" touchscreen beside my brew kettles, one where I can touch a control and drill down to see temp history, PID settings, etc. That and being able to upload mash schedules and keep track of brewing notes while using it.

And yet I've not seen a single controller that does all this. Hmmm...

I guess BrewBoss might be something you want. If I am going to build a tri-kettle system or something more fancy or complicated, I would definitely use similar architecture:
-One or more Arduino/ESP8266 that control heating and pump by relay.
-The main controller runs on a tablet. It can be as fancy and as complicated as possible.

BTW, I don't understand why people like to use RPi and buy expensive touch LCD to work with. An Android tablet might cost less than a RPI and touch screen. IMO, the only advantage of RPI is more geekiness.
 
Surely there are ways. I would implement an APP by using WebView to get all APP privileges.
BTW, timers are usually stopped when the browser is put to background.

There are ways.

I would guess that they think it's more REAL brewing by direct controlling the brew process. At the same time, simple system requires less maintenance. What can go wrong with simple switches? If a switch broken, just replace it.
When was the last time you had a microcontroller or SSR fail ?

You could implement a virtual control panel that functioned exactly like the real life version, if you want that functionality.

The issue I have against big panels is their cost, their size, the lack of portability and the massive wiring job they represent.

BTW, I don't understand why people like to use RPi and buy expensive touch LCD to work with.

Large touchscreens aren't terribly expensive, especially compared to a control panel. Larger size = bigger virtual buttons, numbers that can be seen from further away, more data can be displayed on a screen, more screen real estate (pixels), multiple applications running on 1 screen, etc. A 24" touchscreen could display every aspect of a virtual control panel with near life size components. For those that want that.

And they can be repurposed when you aren't brewing.

23.6" touchscreen for $229. 1920x1080.
https://www.newegg.com/Product/Prod...6174&cm_re=touchscreen-_-24-016-174-_-Product

Put a towel beside it so that you can wipe your wet fingers before touching it, if that is a problem.

An Android tablet might cost less than a RPI and touch screen. IMO, the only advantage of RPI is more geekiness.

RPi advantages

- you won't run out of memory, RAM or storage.
- it runs Linux, which provides a ton of computing infrastructure like a network stack, disk management, file system, development tools, debugging tools, USB, keyboard, mouse, HDMI, sound, WiFi, Bluetooth, etc.
- cheap
- very powerful
- easily expanded I/O
- versatile
- runs on 5 volts, low power consumption
- the OS and apps all fit on a memory card. Easy to replicate, backup and debug
- you can use whatever display you want. Run it headless, put a monitor on it, view on any mobile device via a browser
- endless number of accessories available
- tons of open source software
- huge support community

What more could you want ?
 
I started sketching out a board for this in Eagle (not proficient in it's use at all), eagle tells me the I/O expander needs power at VSS and VDD, does VDD get 5v or 3.3V or do I just wire as per your diagram.
I have switched out:
BSS138 for BSS123 (have some from Thorak's brewpi board) and
PCF5874AT for PCF5874P (mainly for packaging)
I used the D1 Mini MCU

I'm probably a month or so from getting a proto up and running but will keep you posted when I get there. At some point I'll need to send it to someone to check it over as this is the first board I've done.

cheers
froot
 
I started sketching out a board for this in Eagle (not proficient in it's use at all), eagle tells me the I/O expander needs power at VSS and VDD, does VDD get 5v or 3.3V or do I just wire as per your diagram.
I have switched out:
BSS138 for BSS123 (have some from Thorak's brewpi board) and
PCF5874AT for PCF5874P (mainly for packaging)
I used the D1 Mini MCU

I'm probably a month or so from getting a proto up and running but will keep you posted when I get there. At some point I'll need to send it to someone to check it over as this is the first board I've done.

cheers
froot

I am no expert in circuit, so I am telling what I was thinking and you can make your choice.
The IO Expander, PCF8574 or PCF8574A, operates under both 3.3V and 5V.
The LCD works better under 5V, so that's the reason of level shift circuit.
I prefer putting PCF8574A in 5v domain is because 3.3V power is regulated by D1 Mini if you don't have another regulator. Supplying 5V to the IO expander makes me feel more comfortable.
 
Thanks pocketmon, will make the relative adjustments, still playing, and matching parts to libraries. Will post results we I eventually get there.

cheers
froot
 
I started sketching out a board for this in Eagle (not proficient in it's use at all), eagle tells me the I/O expander needs power at VSS and VDD, does VDD get 5v or 3.3V or do I just wire as per your diagram.[...]

fwiw, VDD is a convention for a positive device power supply voltage, while VSS is a convention for the device power supply return. The former ranges anywhere from 1.1 volts these days up to 5 volts or more, while the latter is typically referenced to Ground...

Cheers!
 
It's possible if the TX/RX pins can be used. The real problem is the pin out of your existing shield. I don't have either, so I can't say anything about it.
 
I sure wish I was a programmer right about now. If it comes down to pins for shields I'll figure that out


I should also mention that your arduino based software that you are no longer developing was based on the same shield as I have now
 
I sure wish I was a programmer right about now. If it comes down to pins for shields I'll figure that out


I should also mention that your arduino based software that you are no longer developing was based on the same shield as I have now

Are you going to replace the Arduino with this board or use this board as a WiFi shield?

I might be wrong, but I think it won't work by simply replacing the Arduino with this ESP8266 board. As far as I know, Open ArdBir shields use 6 pins interface hd44780 LCD. ESP8266 doesn't have enough PINs, so I2C LCD is used. The I2C LCD is in fact a hd44780 LCD adapted by a PCF8574/PCF8574A, though.

I am not sure that it is appropriate to reveal this information. The user who has working Arduino+ESP8266 system has designed a shield that has nearly the dimension as Open ArdBir(or, the like) because he wants to use the old box and other components. If he finally decided to open his design, it might be a better choice. Let's see.
 
At this point I have the shield designed up, I need to tidy up the labeling, and have it double checked for any standout faults. I'll then get fabed, and test. Once I'm sure all is working I'll forward to the files and BOM to pocketmon to place in the github repoBoard.png.

Pocketmon, with your latest up date, would it be possible to break out the USB and allow import from thumb drive? Just a thought before I finalise the shield.
 
At this point I have the shield designed up, I need to tidy up the labeling, and have it double checked for any standout faults. I'll then get fabed, and test. Once I'm sure all is working I'll forward to the files and BOM to pocketmon to place in the github repoView attachment 388407.

Pocketmon, with your latest up date, would it be possible to break out the USB and allow import from thumb drive? Just a thought before I finalise the shield.

USB thumb drive? why? how? ESP8266 doesn't support USB. The USB on it is a USB to serial adapter and USB slave. ESP8266 does support SD card, though.

I don't think we need more storage, given the fact that 4MB is available or 16MB if you go with D1 pro.

A question for your board: is there space for an external antenna? The D1 pro has socket for external antenna, but you place the USB side outward and antenna side inside. It would be better to be able to use external antenna in some case.
 
Yeah follow what you mean with the aerial, the above is 1 revision behind, and I'll be adding heating, sparge and pump LED's.

Which ever way I spin the D1 around you'll only ever be an inch or so worse off, but I see what you mean and I'll see how best to get better positioning of the aerial. I may move the D1 all the way to the right.

Also note this iteration is using an onboard 5a SSR I'll create a second board file without, so all relays can be off board.

cheers

Mike
 
Cool. yeah I was thinking of a direct replacement, but I didn't realize about the LCD screen.
 

Latest posts

Back
Top