Digital Hydrometer Project update

Tags

, , , ,

I have made a little progress with this Digital Hydrometer project. I must mention right from the start that my knowledge of Arduinos, electronics in general, and all that I am doing here, I know very little about! It possibly isn’t the best way at all and I will likely make mistakes – anyone that can help me out feel free to comment on improvements!

Arduino

I wired up my Arduino Uno clone and MPU-6050 according to the Fritzing diagram below, which I found here.

conn

Then using code I found here (the code with 36 line, approx. 1/4 down the page), I got some form of tilt readings off the MPU-6050. I don’t know at this stage how to convert the raw data into recognized values (like degrees), but to be honest I don’t think I need worry. All I am interested in is getting a difference in values when the angle of tilt changes. Which this does!

Wemos D1

I then swapped the Uno clone for a Wemos D1 board I bought cheap from AliExpress. The Wemos D1 (apparently obsolete; perhaps that was why it was so cheap) is an Arduino UNO Compatible WiFi board based on ESP8266. It looks virtually the same as an Uno, but it is quite different, one difference  being the pins run at 3.3V rather than Arduino’s 5V. Luckily the MPU-6050 board I am using (GY-521) which can handle both.

The wiring was as follows:

GY-521 (MPU-6050)               Wemos D1

VCC                                 –>       5V

GND                                –>       GND

SCL                                  –>       SCL/D3

SDA                                 –>       SDA/D4

INT                                  –>       D2

(XDA, XCL, ADO not used)

img_20161007_200806

You will also need to add the ESP8266 Library to the Arduino IDE, if you want it to run the Wemos D1 on the Arduino IDE (which I did). You add the library in the Arduino IDE by going to Files and click on Preferences. Copy the following into the Additional Boards Manager URL: http://arduino.esp8266.com/stable/package_esp8266com_index.json. Click OK, and it will add the library; you should be able to find example ESP8266 sketches.

Ubidots

I then used Ubidots, a great online Internet Of Things platform, that allows you to send data from home projects online and view the data.

I added the relevant lines to my previous code (see my code at the bottom of this post) to have the tilt readings from the accelerometer sent to the cloud. This data can be visualised on a graph to see the trend, and Ubidots allows alerts to be sent which could come in handy in the future for this project.

 

img_20161007_210518

Ubidots; raw data graphed. The downward spikes in the graph are when I tilted the acceleroometer. It doesn’t appear smooth because I chose a 3 second sampling rate.

Next Steps

Having got a prototype that reads tilt values and can send the data wirelessly to the cloud, I imagine my next steps will include adding a battery pack to power it, and enclosing it in something that will float atop the wort/beer in the fermentor, with a suitable weight to give it tilt as the density changes. I will need to make up differing sugar solutions to see what weight will be suitable, and hopefully to calibrate (with a regular hydrometer) the tilt data with a specific gravity reading.

 

Appendix: My Code

#include <UbidotsMicroESP8266.h>
#define TOKEN “XXXXXXXXXXXXXXXXXXXXXX” // Put here your Ubidots TOKEN
#define WIFISSID “XXXXXXXXXXXX”// Put your WiFi SSID here
#define PASSWORD “XXXXXXXXXXXX” // Put your Wifi Password here
Ubidots client(TOKEN);

#include<Wire.h>
const int MPU_addr=0x68; // I2C address of the MPU-6050
int16_t AcX,AcY,AcZ,Tmp,GyX,GyY,GyZ;

void setup(){
client.wifiConnection(WIFISSID, PASSWORD);
pinMode(LED_BUILTIN, OUTPUT);

Wire.begin();
Wire.beginTransmission(MPU_addr);
Wire.write(0x6B); // PWR_MGMT_1 register
Wire.write(0); // set to zero (wakes up the MPU-6050)
Wire.endTransmission(true);

Serial.begin(9600);
}
void loop(){
Wire.beginTransmission(MPU_addr);
Wire.write(0x3B); // starting with register 0x3B (ACCEL_XOUT_H)
Wire.endTransmission(false);
Wire.requestFrom(MPU_addr,14,true); // request a total of 14 registers
AcX=Wire.read()<<8|Wire.read(); // 0x3B (ACCEL_XOUT_H) & 0x3C (ACCEL_XOUT_L)
AcY=Wire.read()<<8|Wire.read(); // 0x3D (ACCEL_YOUT_H) & 0x3E (ACCEL_YOUT_L)
AcZ=Wire.read()<<8|Wire.read(); // 0x3F (ACCEL_ZOUT_H) & 0x40 (ACCEL_ZOUT_L)
Tmp=Wire.read()<<8|Wire.read(); // 0x41 (TEMP_OUT_H) & 0x42 (TEMP_OUT_L)
GyX=Wire.read()<<8|Wire.read(); // 0x43 (GYRO_XOUT_H) & 0x44 (GYRO_XOUT_L)
GyY=Wire.read()<<8|Wire.read(); // 0x45 (GYRO_YOUT_H) & 0x46 (GYRO_YOUT_L)
GyZ=Wire.read()<<8|Wire.read(); // 0x47 (GYRO_ZOUT_H) & 0x48 (GYRO_ZOUT_L)

/*
Serial.print(“AcX = “); Serial.print(AcX);
Serial.print(” | AcY = “); Serial.print(AcY);
Serial.print(” | AcZ = “); Serial.print(AcZ);
Serial.print(” | Tmp = “); Serial.print(Tmp/340.00+36.53); //equation for temperature in degrees C from datasheet
Serial.print(” | GyX = “); Serial.print(GyX);
Serial.print(” | GyY = “); Serial.print(GyY);
Serial.print(” | GyZ = “); Serial.println(GyZ);
*/
Serial.println(AcX);

client.add(“Tilt”, AcX);
client.sendAll(true);

delay(3000);
}

 

 

 

 

DIY Digital Hydrometer Project Part 2

Tags

, , ,

I have decided to purchase only the accelerometer for this project, at this stage. I have the selected the MPU-6050 (basically on price; it was the cheapest option available to me!).

After some quick Googling (and this blog in particular), it became apparent that using the ESP8266 wifi module would require a logic shifter (it runs a 3.3V – not the arduino’s 5V) and extra serial comms in the form of an FDTI breakout board, or use of an arduino Mega.

For a beginner like me, getting this up and running right away would all detract from the point of the project, and actually isn’t needed at the prototype stage. Wifi can be added later once the concept has been proven to work, if it is still required.

So I now look forward to the arrival of the MPU-6050 accelerometer, and getting it running measure angle of tilt.

Low Oxygen Brewing for Helles

Tags

, , , ,

I recently came across this post at GermanBrewing.net about how ensuring low oxygen in the brewing process can dramatically improve the quality of beers such as a Bavarian Helles, and probably all beer. It’s a fascinating set of instructions.

I have been following along on the Homebrewtalk forum here, and there is a fair amount of debate on the topic. But I figure it’s certainly worth a go and see if it works for me, especially as Helles was the beer that ultimately caused me to progress my homebrewing past the kit stage. I have not found a good Helles in New Zealand (they may exist, but I have not found them) and it is a passion of mine to brew one of these as good as any at the Hofbräuhaus  or from Paulaner.

Unfortunately, to do it fully (and it appears to be an all-or-nothing prospect) I need to modify my brewing process a little. But only a little as (to me at least) it seems reasonably well suited to the BIAB and bottle conditioning methods I use.

The two biggest things I need to change are:

  1. replacing my copper wort chiller, and
  2. using a mash cap during the mash.

I have ideas to remedy both of these, and in fact I have already begun work on project to allow the use of a mash cap (not that I have one or have quite worked out how to make one). My problem is currently I need to stir the mash vigourously to keep the mash from over-heating.

So, having now provided brief background detail, I will shortly be posting details of the mash improvement project I have already begun!

DIY Digital Hydrometer Project

Tags

, , , , , ,

I have wanted a digital hydrometer for some time now. It would primarily be useful to know the gravity of the beer to know when fermentation is complete, or if I wanted to leave a couple of points unfermented, depending on the style. I don’t like taking samples and using my standard hydrometer – it wastes the beer, it takes time, and it compromises the beer hygiene. Imagine just being able to quickly look on the laptop or smartphone what the gravity is.

In the last couple of years I know of two products that can be bought, namely The BeerBug and the Tilt.

These both look like great products and I would be thrilled to have one. But these cost a reasonable amount and I figure I could probably do it myself for cheap.

I had thought for a while to base it on measuring the change pressure difference between two points (one high, one low) in the fermentor. But with tapping points in the side of the fermentor (plastic fermentors only!) it is likely to get messy.

I really like the idea behind the Tilt, which is explained nicely by the makers of the Tilt in their Kickstarter page,  and I am basing my project on that concept.

Basically the theory is that a sensor is floated in the fermenting beer, weighted at one end and buoyant at the other. As the density changes, the weight will sink, changing the angle of the floating sensor. This change of angle can be calibrated to density.

I intend to base the project around the Arduino, probably the Uno (due to the low price of Uno clones available). Add on an accelerometer to measure the angle of tilt, a wifi shield to send the data, and a battery pack to power it all. (I already own a 6x AA battery pack for an arduino).

I also will probably have to make a local webserver to send the data too, and write some software (preferably similar to the BrewPi software) to display the data! None of which I know how to do currently.

To start, I am thinking of purchasing the following off TradeMe:

461977978

Arduino Uno clone

464638344

ESP8266 Wifi module for Arduino

414528529

3-axis gyroscope and accelerometer (MPU-6050)

Next step is making sure that this hardward is what I want. Can the Arduino power both the accelerometer and the wifi shield? Do these run on 3.3v rather than the Arduino’s 5V?

I think I may need one of these:

416027735

Bidirectional Level Shifter 5V 3.3V 2.5V 1.8V

This lot should cost around $25 including postage – so I won’t be breaking the bank just yet.

But it is becoming more obvious to me that in order to complete this project I will need to learn a fair bit; hardware, software and practical implementation. But for me that is half the fun.

Please let me know if  you have an observation/suggestion to make.

Introduction

Tags

I am into homebrewing, and am always looking for ways to improve the functionality of my brewing setup.

For various reasons the purse-stings are often tight so I am always looking at ways to make improvements while keeping costs to a minimum.

So this blog is about my projects and ideas, and maybe even about my brewing!

Design a site like this with WordPress.com
Get started