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 like your modal code, very good job and I see how it will replicate the Braumeister almost perfectly. I really love how you have handled the buttons, very simple!

I am curious to how much ram gets used in your program because every string is loaded into memory and you have nearly 700 characters which get displayed on the LCD.
If you are using arduino 1.0 then it is possible to load them into flash memory (it increases program size, but doesn't use anywhere near this much ram.) using the F().

eg.
lcd.print(" Add Hops");

becomes
lcd.print(F(" Add Hops"));


Going through your code it's probably not a problem, but just a note... I am really finicky about reducing ram requirements because I have been bitten in the past with some huge data transfer programs.


EDIT:

Where you use delays (eg for the 1_sec buttons), have you considered using a while and reading millis() instead? This way, if the user changes their mind or goes from one button to another there is no risk of having a dead delay.

thanks for the ideas edak I'll keep them in mind I'm still learning.

cheers steve
 
so Here is the code I have been working on for the brauduino, there is some more work to do but it seems to be working well, after a bit of advice from zizzle and bonj I have reduced the size of the code from 16.8k to 14.4k compiled.

cheers steve

Not really needed but you could use some resistors to make the different buttons only use one analog input (like http://cdn.shopify.com/s/files/1/0045/8932...LCDShieldv2.pdf )
Might free some up if people want to add a few other sensors?
 
Well, I have finally got a few bits together and got a very basic setup going. A Freetronics LCD shield and a DS18B20 temp probe reading the current temp.

The shield I am using has the buttons setup in the way Deebo is talking about. You read in the voltage from the input pin and that tells you which button is currently being pressed. I end up with 6 free pins after the LCD shield, so not many left. I may end up having to look at a shift register to free up more pins if required, although that adds to the overall complexity.

I think the next purchase is a Freetronics terminal shield. This will improve my current setup of the wires twisted around the header pins. I'll probably order a relay board at the same time and one of the Craft Brewer elements at the same time and I should then be able to work on an extract brewing automation.

My goal is to be able to programme in boil time, extract and hops addition alerts with a piezzo element.

brewton.png


Oh, and the name is derived from an 80s cartoon called Astroboy. I did toy with the idea of Mashtroboy, but decided that was pretty crap.

Angus.
 
Well, I have finally got a few bits together and got a very basic setup going. A Freetronics LCD shield and a DS18B20 temp probe reading the current temp.

The shield I am using has the buttons setup in the way Deebo is talking about. You read in the voltage from the input pin and that tells you which button is currently being pressed. I end up with 6 free pins after the LCD shield, so not many left. I may end up having to look at a shift register to free up more pins if required, although that adds to the overall complexity.

I think the next purchase is a Freetronics terminal shield. This will improve my current setup of the wires twisted around the header pins. I'll probably order a relay board at the same time and one of the Craft Brewer elements at the same time and I should then be able to work on an extract brewing automation.

My goal is to be able to programme in boil time, extract and hops addition alerts with a piezzo element.

brewton.png


Oh, and the name is derived from an 80s cartoon called Astroboy. I did toy with the idea of Mashtroboy, but decided that was pretty crap.

Angus.

You can get cheaper versions of those same design LCD+keypad combo from dealextreme.com (search for arduino).

is that 6 free digital pins? I wouldn't have thought so given that the LCD is a parallel type. Personally I prefer to use the I2C LCD screens, which effectively use ZERO digital pins (I2C uses the analog pins).

I LOL'D so hard when I read Mashtroboy. I am a huge fan.
 
6 free analogue pins and (I think) 3 free digital pins so the LCD uses quite a lot of pins. At the moment, that is not an issue and I have the LCD working so I will continue down this track.

No-one has really stated what SSR they use? Edak is using a 10A relay shield, but I think that is a bit close to the amps used by the Craftbrewer 2200W element (9.8A if my calcs are correct, which they probably aren't he he). So I was looking at this 25A SSR: http://www.ebay.com.au/itm/SSR25A-SOLID-ST...#ht_2498wt_1164

Is this OK to use?
 
6 free analogue pins and (I think) 3 free digital pins so the LCD uses quite a lot of pins. At the moment, that is not an issue and I have the LCD working so I will continue down this track.

No-one has really stated what SSR they use? Edak is using a 10A relay shield, but I think that is a bit close to the amps used by the Craftbrewer 2200W element (9.8A if my calcs are correct, which they probably aren't he he). So I was looking at this 25A SSR: http://www.ebay.com.au/itm/SSR25A-SOLID-ST...#ht_2498wt_1164

Is this OK to use?

Actually, for my fridge I used that, but for my Ardumiser (I like that name) I will be getting a 2400-3600W element and want to use PID, so I have a 25A SSR relay with heatsink for that. Both came from evilBay (the cheap ones you see there are what I used). Similarly to Matho, I will also be using a 10A standard relay for the pump, given that it does not get controlled by PID.

I can't wait to get all my kit, it will be fun to put together, unless there are problems, in which case it will be SUPER fun!
 
ah, yes, that was for your fridge controller.

I have yet to decide on a heating element. I was going to grab one of the Craft Brewer ones, but the "Keg King" thread has me a bit worried about the reliability of them. I am thinking now I might grab one of the DIY ones and bend it up myself. Perhaps a stupid question: can you unbend them?

So I bend it up for my current Big W pot, and then later on, I purchase a new bigger pot and want to use the Big W pot as a malt pipe. I would then want to run the heating element in the outside pot and not inside the malt pipe. I am guessing you might get some metal fatigue and run the risk of snapping the heating element.

I am looking at the Auberins site at their SSRs and just wondering if they would be more reliable than the cheap eBay ones..
 
Is anyone using dallastemperature library for the 18b20 running it on multiple buses?
There are plenty of examples of multi-dropping on a single bus but I want to have them on separate buses.
 
yeah I have been wondering that too I think you would have to make up a function that would include this
Code:
// Data wire is plugged into port 2 on the Arduino

#define ONE_WIRE_BUS 2



// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)

OneWire oneWire(ONE_WIRE_BUS);



// Pass our oneWire reference to Dallas Temperature. 

DallasTemperature sensors(&oneWire);

get rid of the #define and make it so when you call the function you pass on the bus you want to read then rest would be the same. I don't use the dallas library I just use the one wire library.

I have just tried out this bit of code and it seems to work

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;

  float Temp_c;

  byte Busy;

  byte data[2];

 

  OneWire ds(x);

  ds.reset();

  ds.skip();

  // start conversion and return

  if (!(Conv_start)){

	ds.write(0x44,0);

	Conv_start = true;

	return 0;

  }

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

  if (Conv_start){

	Busy = ds.read_bit();

	if (Busy == 0){

	  return 0;

	}

	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);

  } 

}



void setup()

{

  lcd.begin(16,2);

}



void loop()

{

  sensor1 = Temperature(11);

  if (sensor1!= 0){

	lcd.setCursor(0,0);

	lcd.print(sensor1);

  }

}


so it seems you can pass on the pin that the 18b20 is connected too and it works

cheers steve
 
Edak,

enoch wants to use different buses (i.e. different pins) to run multiple sensors , suppose doing that way you don't have play around with ROM codes
 
I would imagine then it would go something like this:

Code:
#define TEMPERATURE_PRECISION 11

#define ONE_WIRE_BUS_1 3

#define ONE_WIRE_BUS_2 4

OneWire oneWire1(ONE_WIRE_BUS_1);

OneWire oneWire2(ONE_WIRE_BUS_2);

DallasTemperature sensorBus1(&oneWire1);

DallasTemperature sensorBus2(&oneWire2);



DeviceAddress ambientThermometer= { 0x28, 0x4F, 0xDF, 0xA9, 0x03, 0x0, 0x0, 0xA0 }; //BLUE

DeviceAddress beerThermometer={ 0x28, 0x3D, 0xDB, 0xA9, 0x03, 0x0, 0x0, 0x49 }; //283DDBA903000049 WHITE



void setup(){

  sensors.begin();

  sensorBus1.setResolution(beerThermometer, TEMPERATURE_PRECISION);

  sensorBus2.setResolution(ambientThermometer, TEMPERATURE_PRECISION);



float temp1=sensors.getTempC(beerThermometer);

float temp2=sensors.getTempC(ambientThermometer);

}
...
 
I have set myself a quite nice franken-circulator which is set up for holding a pot at a controlled via PID (Sous Vide).
I want to also be able to drop it in a pot with the HE coil for a HERMS and plug it into a different DS18b20 in a thermowell.
I have played the "what sensor is that" game with a few sensors on the same bus but it is just a bit to much hassle when you want to control the HERMS pot temp or the HERMS outlet temp or the something else temp and monitor the ones you aren't controlling.

photo.jpg

Oh and thanks for the helpful replies above. I will have a crack so can get the DSB back in action.
 
I am going to make a Sous Vide for my wife also, but simply using one of the off the shelf (eBay) cheapo PID controllers controlling a kettle element and maybe using a aquarium bubbler to move the water around. I haven't thought much further than that..

Perhaps I could just use my braumiser when I complete it, we already have the vacuum sealer..
 
I am going to make a Sous Vide for my wife also, but simply using one of the off the shelf (eBay) cheapo PID controllers controlling a kettle element and maybe using a aquarium bubbler to move the water around. I haven't thought much further than that..

Perhaps I could just use my braumiser when I complete it, we already have the vacuum sealer..

It is worth the effort. I started using my hlt, then a mashmaster and a crock pot.
New circulator with pump, element, float switch is almost safe for the kitchen :excl: .
 
when I looked at the dallas library I didn't like the 750ms delay for the 12bit read , I know you can turn it of and time it yourself but there is a function in the DS18b20 that if you issue a readbit command when conversion is still taking place it will return a 0 and once it is finished it returns a 1, this only works in powered mode. This allows me to keep polling the sensor until it is finished and for the processor to continue to exitcute different code whilst conversion is taking place.
 
when I looked at the dallas library I didn't like the 750ms delay for the 12bit read , I know you can turn it of and time it yourself but there is a function in the DS18b20 that if you issue a readbit command when conversion is still taking place it will return a 0 and once it is finished it returns a 1, this only works in powered mode. This allows me to keep polling the sensor until it is finished and for the processor to continue to exitcute different code whilst conversion is taking place.

All true, although 12 bits is not necessary. I was using 11bits and having 0.125C resolution at 325ms intervals. That is probably not necessary either but I do like the idea of removing the delay altogether so I wil see how your code works for me. I noticed that the codespace dropped by about 2K when I removed the Dallas library.

Good job!
 
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)
 
Back
Top