• Welcome to National Homebrew Club Ireland. Please login or sign up.
April 19, 2024, 01:11:39 AM

News:

Want to Join up ? Simply follow the instructions here
Not a forum user? Now you can join the discussion on Discord


Brewpi on the Cheap

Started by darren996, March 24, 2017, 08:32:51 PM

Previous topic - Next topic

darren996

March 24, 2017, 08:32:51 PM Last Edit: October 25, 2017, 12:52:18 PM by darren996
Hi Folks

I have just built a barebones brewpi.  It was fairly straight forward, only a bit of soldering on the wemos di mini board and the software was very straight forward.
I installed thorrak's version of brewpi, found on homebrewtalk http://www.homebrewtalk.com/showthread.php?t=586476.
The upto date instructions on the github page are excellent and there is also some youtube tutorials
https://github.com/thorrak/brewpi-esp8266

All connections to relays and temp probes are done on the wemos d1 mini board (esp8266) so you don't need to solder the gpio header pins onto the raspberry pi. 
The rasperry pi just does the data logging and hosts the brewpi software.  The d1 mini does the switching etc, if the pi fails the d1 mini keeps going.
You do need to solder the headers to the d1 mini board, this is the only tricky bit.  The d1 mini can be powered from the raspberry pi using a usb cable.

For the hardware build you need :
1. Pi zero ( I recommend the new W as this has built in wifi and bluetooth) think it worked out at 15 euro delivered
2. An esp8266 module, i recommend the wemos d1 mini 3 dollars on Ali https://www.aliexpress.com/item/ESP12-ESP-12-WeMos-D1-mini-V2-Mini-NodeMcu-4M-bytes-Lua-WIFI-Internet-of-Things/32673300492.html
3. Temp probes about 10 euro for 5 https://www.amazon.co.uk/Waterproof-Temperature-Sensors-Transducer-Black/dp/B00WDPIWCI/ref=sr_1_6?ie=UTF8&qid=1490384107&sr=8-6&keywords=DS18B20
4. 12C LCD (20x4) Screen, still waiting on this from China, I will update this thread when it arrives.
5. Sd card, this is the one I got for 6 euro http://cgi.ebay.ie/ws/eBayISAPI.dll?ViewItemVersion&item=182210923621&view=all&tid=1624980199008
6. You need a mini usb cable to connect the d1 mini to the rasberry pi, something like this. http://www.ebay.ie/itm/New-Super-Short-Mini-USB-Cable-Adapter-USB-2-0-to-Mini-USB-/271402045726?hash=item3f30d2911e:g:gusAAOxy63FS~k0l
7. 4.7k resistor.
8. 2 channel 5v relay board


I would suggest you get some Dupont(saison :-X)) cables to connect to the pin headers on the d1 mini board, makes it hand and you wont have to solder.

I followed the instructions here to the letter, very detailed
https://github.com/thorrak/brewpi-esp8266/blob/master/docs/INSTALL.md

Here is what I did if you get stuck, but I would recommend just going through the github instructions.  Mine is more of a step by step and the links i used

Downloaded Rasbian Jessie ( I prefer lite on the pi zero ) 
If using the pi zero w make sure and download the latest version of rasbian or your wifi adapter won't work.

https://www.raspberrypi.org/downloads/raspbian/

Prepare your sd card

https://www.raspberrypi.org/documentation/installation/installing-images/windows.md

Before you remove the sd card setup the pi zero as an otg device.  This means that a windows pc
will recognise the pi zero when you connect it to your pc's usb port and you will be able to connect to it using some software called putty.

Setup pi zero as usb otg
http://blog.gbaman.info/?p=791


Put the sd card into the pi zero ( note pi zero will not boot unless a supported sd card is inserted, transcend work good for me)
Connect the pi to a usb port on your pc
If the device is not recognised connect the power supply to the pi zero.

Once windows has detected and setup the device then you can connect to it using putty.

Download and install putty.
open putty and connect to the pi zero @ address raspberrypi.local on port 22
username pi
password raspberry

Next setup your wifi, you need to know the network and password
setup wifi
https://learn.adafruit.com/adafruits-raspberry-pi-lesson-3-network-setup/setting-up-wifi-with-occidentalis

Next give your pi zero a static ip.  This will allow you to connect to the pi over your wireless network.
setup static ip ( you need to know the ip address of your router )
https://www.modmypi.com/blog/how-to-give-your-raspberry-pi-a-static-ip-address-update

Reboot the pi sudo reboot
you will then be able to putty on using http: and the static address that you setup  e.g. 192.168.1.201 or raspberrypi.local

Next setup the brewpi software.
First steps upgrade Rasbian
To do this putty on to the pi zero

run the following commands.

sudo apt-get update
sudo apt-get upgrade
sudo raspi-config ( launches the config console )
Goto advanced settings and expand the file system.
Reboot Pi

Putty back on to the raspberry pi

install git, this allows you to pull brewpi from github.
sudo apt-get install git

You are now at the step where you you can will install brewpi

Commands
git clone https://github.com/thorrak/brewpi-tools.
Execute sudo brewpi-tools/install.sh
Execute sudo brewpi-tools/install-esp8266.sh

Thats brew pi installed, next you need to flash the esp8266 board, so connect it to your raspberry pi using a suitable usb cable.

Once connected putty back onto the pi

sudo esptool.py --port /dev/ttyUSB0 write_flash -fm=dio -fs=32m 0x00000 /home/brewpi/esp8266/bin/brewpi-esp8266.v0.8.wifi.bin

At the time of writting this the firmware version is brewpi-esp8266.v0.8.wifi.bin, this can change so if the flash was not successful you need to see
what version of the wifi firmware is there.To do that type the following commands

cd /home/brewpi/esp8266/bin/
ls

This will give you a list, you are looking for the file ending in wifi.bin.

Its plain sailing after this.  Please have a look at the github page step 4 onwards to setup the rest of the software.

After you are all setup on the software end you need to connect the relays and the temp probe.

The pin headers on the d1 mini board are

D0 - Heat
D1 - I2C SCL
D2 - I2C SDA
D3 - Buzzer (currently unsupported)
D4 - N/C
D5 - Cool
D6 - OneWire Data
D7 - Door (Untested)

The temp probes are one wire so you can have as many as you like connected together, they will each get a unique address in brewpi.

I attached a nice diagram from vitos brewpiless page. It is for a NodeMcu board not for the d1 but you will get a good handle of the layout and it shows you how to wire things up  I can't link it as it is currently down.
Connect the dc+ on the relay board to the 5v pin on the d1 mini
Connect dc- to the ground pin on the d1 mini. 
Connect  channel 1 on the relay board to D5 (cool)
Connect channel 2 on the relay board to D0 (heat)

Temp probe
Data cable to d6 (yellow or white or green wire on temp probe depending no type you have)
Red cable to 3.3v on d1 mini
Black or grey cable needs to goto the ground pin on the d1 mini.
You need to splice the ground cable using a strip connector as the d1 mini as the board only has one ground pin.
You need to place a 4.7k resistor between the data and the 5v cables.  Have a look at attached pics this will be a lot clearer

Reboot everything.
Logon to brewpi by typing in the static address you gave it into a browser.
Goto the maintenance panel, then to device configuration and click on the refresh device list.  You should see your probes and the heat and cold relay switch channels.

Thats it

The first image below is a node mcu board.  This image is for a brewpiless implementation.

darren996

Thorrak has another project called fermentrack that is based on brewpi and allows for multiple chamber support and will work with tilt and ispindle in the future.

Beerbuddha

Great piece work Darren very well presented.   :)
Pi for dummies.
IBD Member

darren996

Cheers BB, If I can do it any one can.  Only tricky bit is soldering the d1 mini.

Beerbuddha

I have an acetalyne torch should do the job i think. Do i need solder or brass rod  :P
IBD Member

TonyC

Great job Darren, I have a purge zero w on order. Didn't know what I was going to do with it but now I do 😁

Sent from my ONE E1003 using Tapatalk


darren996

Quote from: TonyC on March 25, 2017, 07:25:24 AM
Great job Darren, I have a purge zero w on order. Didn't know what I was going to do with it but now I do


I have spare resistors so don't order them, we can talk about it at the next meet.

Going to give fermentrack a go as well as this will control two chambers. Finished my bar and fermentation chamber build and am not happy with the stc1000 controlling the keg storage side of things.

Shanna

Hi Darren,

Great article & thanks for putting it together. Had a couple of questions.

1. Where did you get the "2 channel 5v relay board"?
2. What ampage did you choose on the relays? I would assume something like 30Amps.

Shanna
Cornie keg group buy organiser, storeman & distribution point
Hops Group buy packer
Regulator & Taps distribution point
Stainless Steel Fermenter Group Buy Organiser
South Dublin Brewers member

rukkus

I have an 8 channel board like that, they are only rated at 10a at mains voltage so fine for ferment control but not for large heating elements

BrewDorg

Unreal Darren, good to see it up and running. Tempted by it.

darren996

March 25, 2017, 10:50:37 AM #10 Last Edit: March 25, 2017, 11:03:52 AM by darren996
Quote from: Shanna on March 25, 2017, 09:57:11 AM
Hi Darren,

Great article & thanks for putting it together. Had a couple of questions.

1. Where did you get the "2 channel 5v relay board"?
2. What ampage did you choose on the relays? I would assume something like 30Amps.

Shanna
They are rated at 10 amps, plenty for a fridge and I have a dimplex 60w tube heater running off it.

This one will do the job
5V 2-Channel Relay Module Shield for Arduino ARM PIC AVR DSP Electronic https://www.amazon.co.uk/dp/B00CRVYIMG/ref=cm_sw_r_cp_api_-QK1yb1813EFG.

Shanna

Quote from: darren996 on March 25, 2017, 10:50:37 AM
Quote from: Shanna on March 25, 2017, 09:57:11 AM
Hi Darren,

Great article & thanks for putting it together. Had a couple of questions.

1. Where did you get the "2 channel 5v relay board"?
2. What ampage did you choose on the relays? I would assume something like 30Amps.

Shanna
They are rated at 10 amps, plenty for a fridge and I have a dimplex 60w tube heater running off it.

This one will do the job
5V 2-Channel Relay Module Shield for Arduino ARM PIC AVR DSP Electronic https://www.amazon.co.uk/dp/B00CRVYIMG/ref=cm_sw_r_cp_api_-QK1yb1813EFG.
Thanks nothing to stop one going for a higher ampage & then could use it to control heating elements as well.

Shanna
Cornie keg group buy organiser, storeman & distribution point
Hops Group buy packer
Regulator & Taps distribution point
Stainless Steel Fermenter Group Buy Organiser
South Dublin Brewers member

darren996

If you require multi chamber support check out fermentrack, it is brewpi based

https://thorrak.github.io/fermentrack/

darren996

Found a great guide by Thorrak for the hardware.  Includes a 3d print for an enclosure

http://tinybat.ch/2016/11/brewpi-esp8266-enclosure/

Link for the 3d print.
http://www.thingiverse.com/thing:1826360


imark

Have you taken a look at the brewpiless project? Removes Raspberry Pi from the equation making it even cheaper and they're going to integrate the iSpindle into it.