Budget control unit for a brewery using Arduino Uno. Automation for BeerDuino brewery based on arduino mega


In 2014, I came across a video of a man making beer from beer wort concentrate. I got excited about the idea of ​​brewing and then it started...
Brewing beer from cans became uninteresting to me after the 2nd time and I decided to switch to all-grain. Once I brewed beer on gas and realized that this was not my method. I decided to make it automatic. The evenings became more interesting. I got so involved in programming that I coded until 2-3 am. Tests were needed in real conditions. In the bins I dug up a boiler and a cut glass.

And this is what I ended up with

Now I’ll tell you how to make such automation.
To begin, we will need the following details. I bought them in China.
ssd1289 or ili9341.
Solid state relay for controlling the heating element (or circuit diagram)
Solid state relay for pump control (for pump on alternating current) or (DC)
Thermal sensor or or
Power supply 7.5-9V 1A. For example
Connectors for connecting a temperature sensor and a pump and
(more )
(buzzer)
4.7 kOhm resistor

Low voltage circuit

Power circuit. Be careful. If you are not sure, trust the professionals.

We take the wire cross-section depending on the total power of the pump and heating element. A solid heating element requires a radiator because... It doesn't heat up too much. We stuff it all into a box. We upload the firmware, configure it and brew beer.

(instructions inside)

But basic functions I didn't have enough. And I decided to turn on wifi. I bought an ESP8266 module on Aliexpress. At the same time I ordered the module because... The guys from the forum really asked to implement it into the project (you can do it without it). And connected according to the following diagram

For food wifi module we need a 5V power supply. Arduino cannot be used. You can use a separate power supply or convert 9V to 5V. To do this, you can assemble a simple circuit with a voltage stabilizer or buy a ready-made one from the Chinese. For example (there are a lot of other options).

The next step is to flash our module with NodeMCU firmware. Download. Let's launch. Click Start and wait until the firmware is uploaded. Did you ask? That's great. Now we load the script. For this we need. There are of course other programs like . But I couldn't get them to work with my module. In ESPlorer we create new file init.lua with the following content:

Changing the name wifi networks and password for yours. Set the speed to 9600. Press the “Open” button (if it doesn’t connect, pressing reset buttons on the module). And click “Save to ESP”. After downloading the script, the module should connect to your router. You can check this by logging into the router and looking DHCP clients. If your module is not visible there, then something went wrong.

The web interface contains the following functions.
1. Process monitoring. You can monitor temperature, pump status, mashing and brew performance. The web interface is equipped with an audible alarm.
2. Load recipes into the controller’s memory and onto a flash drive.
3. Construction of a global graph of the entire cooking process.






Login to the web interface

Why did I need automation?

Automation is needed to facilitate the process, because... this controller itself will monitor the temperature, maintain it and raise it to the required temperature pause. Also signal sound signal about the necessary intervention, for example, you need to add malt or do an iodine test.

I decided to make my own automation from finished project. It runs on arduino, a temperature sensor, two relays, a display and buttons are connected to it. The first relay controls the heating element, the second relay controls the pump. The mashing pump is very convenient because... there is no need to stir the mash during the entire mashing process (I recommend reading my earlier ones for more details on how to brew beer)

I assembled the first automation using modules:

- Arduino mini
- Block of two 15A relays
- Display 2004
- Temperature sensor
- 4 buttons
- 5 volt power supply
The convenience of modular assembly is that it is not difficult to get all the parts and there is practically no need to solder anything. But the biggest disadvantage is huge amount wires, and a cheap Chinese relay created interference on the display, so the mechanical relay had to be replaced with a solid-state one.

Over time, I came to the conclusion that I needed to build my automation on a chip with 64 KB of memory (Arduino mini has only 32 KB) on one board. I didn’t find a ready-made solution, so I began to create a circuit myself and subsequently a board for my craft.

Scheme:

I developed and drew the diagram, so to speak, on my knees and for myself, so some shortcomings are possible, but the diagram is completely working:

Pay:

I drew the circuit, then it remains to draw the board, first I drew it using the program Sprint-Layout 6, very convenient, but it doesn’t have enough functionality, so I decided to move away from it towards the program DipTrace and this is what I got:

You can download the sources.
As you can see, I named my brewery QRBeer and this is already version 0.5...

The board is ready, all that remains is to somehow manufacture it. For this I decided to use . Why them and not LUT? I just decided to try this for myself new technology, I already tried LUT, I felt it, so to speak, I won’t say that I liked it...

Photoresist:

For making printed circuit boards using photoresist you will need:
- Printer film
-
- UV lamp
- Soda ash

UV lamp

First, I’ll share information on how I made mine UV lamp. At first I wanted to use a ready-made lamp, and then I decided to assemble it using six 3W LEDs:
and also purchased on Tao:


I glued the LEDs to the radiator, although they could have been assembled on a PCB, I doubt that they would have overheated.
Here's what I got:


Board manufacturing

1. So, I have prepared the template, all that remains is to print it on film. As I wrote above, I need a film for the printer, I tried the film for both laser printer, and for inkjet, best option It can only be produced on inkjet film. You need to print in negative and mirror image:

I immediately laminated the template so that fingerprints and debris could be easily washed off.
2. Next we need to sand our future board (fiberglass laminate). A slightly dampened regular sponge or melamine sponge is suitable for this:


3. After this procedure, the copper still needs to be degreased with acetone:


As you can see in my photo, I degreased it with a regular napkin, and I poured the acetone into a peroxide bottle, so it’s more convenient to take...
4. The next step is to cut the photoresist slightly to fit your future board and carefully remove the top protective film so as not to damage it. If the photoresist is domestic, you need to peel off the matte side, if it’s Chinese, then there is no difference...
5. Next, we glue the photoresist onto the PCB so that no air bubbles appear under the photoresist, otherwise the tracks will not appear in such places, cut off the excess...
The process of gluing photoresist is similar to gluing a protective film on a phone.


6. When the photoresist is glued, the textolite with it must be passed through a laminator 2-3 times or use a warm iron and ironed through a sheet of paper folded in half:


The main thing is not to overheat the photoresist, otherwise it will turn out like this:


If you get a “jamb” when gluing the photoresist, then it’s better to remove it (wash it off or scrape it off) and re-glue it, otherwise after etching the board it will be sad... I won’t remove this photoresist, I’ll show you the end result.
7. Place a template on the PCB with photoresist and press it with glass (I took it from old photo frame), and place a weight on the glass:


8. We illuminate the photoresist using a UV lamp. My lamp lasts about 2 minutes:


As you can see, the photoresist that was exposed changed color from light blue to dark blue, and the exposed photoresist is very fragile.
9. Remove the glass and template. Excess photoresist can (optionally) be trimmed and carefully separated with tweezers:


10. The next step is to wash off the undeveloped photoresist with alkali; to do this, take 2 glasses of water and a tablespoon of soda ash, stir well. Peel off the top protective film of the photoresist and dip our textolite into an alkaline solution.


11. Take a brush and rub three pieces of photoresist in the alkali, gradually the undeveloped photoresist is washed off:


You can not pour out the alkali, but leave it on the next board or to wash off the photoresist after etching, but more on that later...
12. Board etching:
There are two most accessible methods: etching with ferric chloride or peroxide + citric acid and salt. I won’t write about ferric chloride, but I’ll probably describe it using peroxide:
- 100 ml. hydrogen peroxide 3% - it is sold in a pharmacy for 7-12 rubles
- 30 gr. citric acid(available at any grocery store)
- 1 tbsp. spoon of salt (both fine and rock salt will do)


All this is mixed in a container and the board with the finished photoresist is immersed there, after a while bubbles appear on the board:


And after some time, the “bare copper” will be completely etched:


By the way, if you poison in more high temperature, for example, with an incandescent lamp or in a water bath, then three etchings will be reduced, the main thing is not to overdo it, otherwise the excess will be etched...
13. The most convenient way to remove the photoresist is in the same alkali in which the unetched photoresist was washed off; after 20 minutes it will fall off on its own and there is no need to rub anything...

And here are my “jambs”:


Although not significant, but still, carelessness is to blame for everything, did not notice air bubbles under the photoresist or overheated...

I got the following board “clean”:


14. Next, drill holes and tin the board:


15. Solder all the parts and wash off excess flux:


I soldered SMD components with a Chinese infrared soldering station, very convenient:

That's all, the hardest part is over, all that remains is to ring the tracks for short circuit and start programming the chip.

Programming atmega644

1. To start programming, you need to load the bootloader into it. This is not difficult to do with using Arduino UNO, but first you need to download and install the program.
2. The next step in installed program add or take a ready-made assembly right away:
3. Upload the ArduinoISP sketch to the UNO:

4. And connect our board to UNO:


According to the sketch instructions:
// pin name // slave reset: 10: // MOSI: 11: // MISO: 12: // SCK: 13:
It turns out according to my scheme like this:

5. Next, install our board in the settings and load the bootloader:




If everything went well, we will see the message: “Bootloader recording complete”
At this point, the loading of the bootloader is complete, you can connect the display, buttons, temperature sensor and fill in. Friends, a home brewer needs help. A lot of time has passed since the desire to make a smart thermometer and a new desire arose - to build an automated home brewery. To automate it, you need a block control, it was decided to abandon the use of purchased PID controllers to control the heating element, since there is an Arduino, an SSR relay for it, a 4 by 20 line display and a Serial Board for transmitting information over one wire, not counting the ground and power.
My Arduino controller, I use the project of the Australian Rob, the project is designed for Arduino Duemilanove ATmega328 - www.arduino.cc/cgi-bin/yabb2/YaBB.pl
and directly the project itself -
My brewery will work according to a slightly different principle, not like Rob’s, I rely on Spidel Braumeister, how it works is clear from these videos: http://www.youtube.com/watch?v=x-OBE4tJ-j8&feature=player_profilepage
But, unfortunately, I’m never a programmer, I know how to solder and do it according to instructions. Now, if you remade Rob's program, it would be perfect control device. I assembled the controller and tested it, but for some reason the DS thermal sensors are not recognized. There is a lot of unnecessary stuff in this project for me, because... I don’t want to build a HERMS system like the author’s, so you can remove all unnecessary ones from the program. All actuators are controlled by solid-state relays. I have 2 pieces, for the heating element and the pump. I use a heating element purchased on Amazon, low density 4.5 kW. Nothing sticks to it and you can even turn it on in the air and it won’t burn. What’s interesting is that the display is connected via a Serial Board, I assembled it from a kit purchased on eBay. Only 3 wires are used, thereby unloading the Arduino ports. What is needed: PID control of the heating element for accuracy and convenience, there is a ready-made library for Arduino, widely used in the project www.brewtroller.com/wiki/doku.php, you can also borrow many ideas from there, but the project is overloaded with functions and is also tailored for the American HERMS and RIMS. The program should have 3 operating modes: CIP washing (heating water up to 70g (can be changed in the settings) and simultaneous operation of the pump), AUTO mode (when all the steps laid down in the programming mode are processed, you can pause and forcefully move to the next step ), MANUAL mode (B manual mode we simply control the on/off switching of the heating element, pump and AUX output, the temperature is indicated.), AUTO programming (Auto mode - water heating 70g, pause (for filling, adjustable), setting temperature pauses (there should be 4 pauses, with a reserve, acid, protein, saccharification), with simultaneous operation of the pump, pause mash out - configured with simultaneous operation of the pump, just operation of the pump, the so-called whirlpool mode, when the wort swirls in a stream and all the turbidity settles in the center, and pumping with simultaneous operation of the AUX and the second temperature sensor, an aquarium compressor with a flow-through aerator will be connected to it, The wort flows out through a flow-through chiller-cooler.
Actually, the task is not big, but I’m a humanist, and programming just doesn’t come easily.

On at the moment, the controller looks like this:

In return, I promise to become a personal mentor and teacher in brewing for anyone interested! :)

UDP! Topic on Habré!







2024 gtavrl.ru.