Arduino Development Thread

Australia & New Zealand Homebrewing Forum

Help Support Australia & New Zealand Homebrewing Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
I read someplace if you request temp readings on the DS18b20 too often it slowly heats up the sensor and it gives higher and higher readings. (Only just got mine so haven't tested this yet)

I haven't noticed this effect, I have had the unit running for over an hour with 2 other thermometers next to it and they were within 1 deg of each other. Once the sensor is in a thermowell and in liquid I would think the effect of self heating would reduce because there would be a large mass to take the heat away. On the braumiser when I was testing the temp reading of the DS18B20 stayed with my trusty lab thermometer all the way to about 86 deg then it started to vary and by the boil was low by about 1.5 deg.

if your worried about this you could change the code to

Code:
#include <OneWire.h>

#include <LiquidCrystal.h>

LiquidCrystal lcd(2, 3, 4, 5, 6, 7);





// global variables 



float sensor1;



float Temperature(int x){

  static boolean Conv_start;

  static unsigned double startTime;

  float Temp_c;

  byte data[2];



  OneWire ds(x);

  ds.reset();

  ds.skip();

  // start conversion and return

  if (!(Conv_start)){

	ds.write(0x44,0);

	Conv_start = true;

	startTime = millis();

	return 0;

  }

  // check for conversion if it isn't complete return if it is then convert to decimal

  if (Conv_start){

	  if( (millis()-startTime) >= 60000){

	   ds.reset();

	   ds.skip();

	   ds.write(0xBE);  

	   for ( int i = 0; i < 2; i++) {		   // we need 2 bytes

		 data[i] = ds.read();

	   } 

	   unsigned int raw = (data[1] << 8) + data[0];

	   Temp_c = (raw & 0xFFFC) * 0.0625; 

	   Conv_start = false;

	   return (Temp_c);

  }

return 0; 

}

}



void setup()

{

  lcd.begin(16,2);

}



void loop()

{

  sensor1 = Temperature(11);

  if (sensor1!= 0){

	lcd.setCursor(0,0);

	lcd.print(sensor1);

  }

}


which should read the sensor every minute, depending on your PID settings you might want to reduce the amount of times you call your PID function as well
 
In my opinion that would be way too slow for the pid algorithm to work well. I think it's best left the way it is.
 
In my opinion that would be way too slow for the pid algorithm to work well. I think it's best left the way it is.

I think your right Edak, anyway I did my own little experiment tonight , after 1.5 hrs

SANY1615.JPG

SANY1614.JPG

fairly close I would say.

also going off the thermal resistance of a to-92 package of 180degc/w in still air and a typical current during conversion of 1mA you get a temp rise of 0.9 deg now its only converting for a max of 750mS which would give you a temp rise of about 0.675 deg, which is a far call from the 2 deg that I have read
 
for anyone wanting to make a brauduino at home attached is a PDF with top and bottom traces and part location and parts list, I have made it so all the parts that can't be soldered both sides are only soldered on the bottom, all other parts should be soldered both sides. there are 2 jumpers labelled 12v and 5v with the relay in the parts list insert the 5v jumper and not the 12v one.

cheers steve

View attachment braumiser_homemade1.pdf
 
for anyone wanting to make a brauduino at home attached is a PDF with top and bottom traces and part location and parts list, I have made it so all the parts that can't be soldered both sides are only soldered on the bottom, all other parts should be soldered both sides. there are 2 jumpers labelled 12v and 5v with the relay in the parts list insert the 5v jumper and not the 12v one.

cheers steve

View attachment 53997
looks good matho. I'll be holding out for a manufactured one. I'm a big fan of solder masks ;)
 
looks good matho. I'll be holding out for a manufactured one. I'm a big fan of solder masks ;)
yeah mate I agree, they make they make soldering up a lot easier, I just posted it for the die hard DIY'er :)

edit: just looking at the pdf, page 1 is the bottom trace, page 2 is the top component, page 3 is the top trace and page 4 is the bottom component, the arduino is pluged in from the top, when you are making transfer style of traces it can get a bit confusing
oh and I couldn't find any 10k resistors on little bird electronics so they will be needed to be sourced from another location.

cheers
 
I have changed the code a little bit and fixed a few bugs after testing this morning

Brauduino code

cheers steve
 
added a pause option so any part of the auto mode can be paused
 
in the nextgen thread it was suggested that I put it in the original braumiser so I thought I would in this one, I have used it once or twice, just handy to have I guess and not hard to implement.
 
is a quick video of the setup menu sorry about the quality but you get the idea. To enter the setup menu I hold down the 'ENTER' button for 1 sec, to navigate between the 'Unit parameters' or the 'Auto parameters' its up button for auto and the down button for unit. Once inside the menu it is up or down to change the parameter and the 'ENTER' button to save and move to the next parameter and to quit it is pressing the up and down button at the same time, quitting will not save the parameter that is displayed at the time.

more video of the manual mode and the auto mode to come

cheers steve
 
Last edited by a moderator:
is a video of the manual mode. To enter manual mode I hold down the 'down' button for 1 sec. It then prompts me to add water, after confirming the prompt I can adjust the temperature with the up and down buttons, turn the heat on and off with the 'Start' button and the pump on and off with the 'Enter' button. To Quit I push the 'up' and 'down' buttons at the same time to take me back to the start screen.

I'm not 100% happy with how the PID library works, the problem is that the I component of the pid can wind out if there is an error for too long which is only clamped but the window size, which is ok if you have a small window size but if you have a large window size then the PID becomes slow to respond because it has to wind back the I. I'm going to have a bit of a play in a real life situation not just putting my finger on the end to simulate a heat source.
 
Last edited by a moderator:
is a video of the manual mode. To enter manual mode I hold down the 'down' button for 1 sec. It then prompts me to add water, after confirming the prompt I can adjust the temperature with the up and down buttons, turn the heat on and off with the 'Start' button and the pump on and off with the 'Enter' button. To Quit I push the 'up' and 'down' buttons at the same time to take me back to the start screen.so
I'm not 100% happy with how the PID library works, the problem is that the I component of the pid can wind out if there is an error for too long which is only clamped but the window size, which is ok if you have a small window size but if you have a large window size then the PID becomes slow to respond because it has to wind back the I. I'm going to have a bit of a play in a real life situation not just putting my finger on the end to simulate a heat source.


Both videos look good, I have the benefit of 4 lines on my lcd so the function of the buttons is always displayed and not ambiguous. I have finished the first iteration of the code, there were only a few lines from yours that I borrowed.
Will Make a video of the interface and let you see it. First I have to get my wireless programming working, because that is my priority.
 
Last edited by a moderator:
sounds good Edak,

is a video of the auto mode. To enter the auto mode I press the 'start' button for 1 sec, if there has been an uncompleted brewing cycle it will prompt for a resume. I selected no to start a new brewing cycle. It prompts me to add water and then goes onto the first stage 'Mashin', once the temperature has been reached it will start to count down the timer when finished it will prompt to add malt and wait for a confirm or quit. In any stage the set temperature can be increased or decreased if wanted. After the malt has been added and it has been acknowledged it will enter the stages, you can set it up to have 1 to 9 stages, 1 being mashin only, 9 being mashin plus 8 steps. I quit to show the resume function as you can see it picks up where it left off, at the end of all the stages it will prompt to remove the malt. After the malt has been removed it will enter the boil, the set temperature can be set between 94 deg and 120 deg, of course it will never get to 120 but set to 120 you will know that you have 100% power, up here at 600m above sea level water boils at 96 and wort boils at 98, I find that at 97 I get a simmer and at 101 I get a vigorous boil. There are up to 8 hop alerts that can be set up to go off during the boil. At the end of the boil an alert goes off and the resume function gets turned off so the next time you enter auto mode it will only prompt for water. During any part of the process I can quit by pressing the up and down buttons at the same time.

cheers steve

edit: in the video the screen looks light blue but in real life its a deep blue.
 
Last edited by a moderator:
Well I'll be damned! I haven't been brewing as of late because I've gone back to Uni (studying I.T) and what do I happen to stumble across? You guys are writing code for your brewing gear! And, if I'm not mistaken, it's in C++, the language I've been studying this semester. Interesting stuff.
 
yep arduino is based on c++, I'm only learning this stuff myself if you want to see some interesting code look at zizzle's stuff on github

here

cheers steve
 
so I have upgraded for arduino 0022 to arduino 1.0 and found a compiler error with the custom character instead of writing

lcd.Write(0);

I had to change it to

lcd.print((char)0);

but reading further I might change it to

lcd.write((uint8_t)0);

the v1.0 version is HERE

cheers steve
 
well I have been playing around with Kicad and have made up a board for the brauduino on it. Its an Ok PCB design software and even better cause its open source

HERE is the project, this isn't the design that I have used to get the boards made up but it looks ok

cheers steve
 

Latest posts

Back
Top