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.
In the interests of no longer polluting this Arduino thread with my Windows development crud (;)), I have started a separate thread for my system.

I have ended up finding a PID sample so will use that and see how it works. At the moment I have a temp over-shoot problem using straight temp measurement so will have to do something about that before moving toa full-sized vessel. At the moment I am driving my kitchen kettle and the temp ramps very quickly.
 
I just noticed that in the brauduino code the PID was receiving only a 0.25 deg resolution which wasn't my intent so I have changed the code so it receives the 12bit resolution

brauduino code

I haven't added the changed the PID library in it, probably should.

cheers steve
 
I just noticed that in the brauduino code the PID was receiving only a 0.25 deg resolution which wasn't my intent so I have changed the code so it receives the 12bit resolution

brauduino code

I haven't added the changed the PID library in it, probably should.

cheers steve

Steve,
What's the reason for leaving the display at .25 degC resolution?
Cheers dan
 
Steve,
What's the reason for leaving the display at .25 degC resolution?
Cheers dan

its because of screen formatting, if I displayed the full 12 bit resolution then it would be 4 decimal places (I think), 0.25 just seems neater

cheers
 
The 0.25 deg display was bugging me a little, so i came up with this. Not sure it's the most elegant way to go about it, but it appears to work ok for me.

// reads the DS18B20 temerature probe
void Temperature(void){
float tempcalc;
ds.reset();
ds.skip();
// start conversion and return
if (!(Conv_start)){
ds.write(0x44,0);
Conv_start = true;
return;
}
// 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;
}
ds.reset();
ds.skip();
ds.write(0xBE);
for ( int i = 0; i < 2; i++) { // we need 2 bytes
data = ds.read();
}
unsigned int raw = (data[1] << 8) + data[0];
tempcalc = (raw & 0xFFFF) * 6.25;
abs(tempcalc);
Temp_c = tempcalc / 100;
Conv_start = false;
return;
}

}

Cheers
 
cool mate,

so does that keep it to 2 decimal places?
 
cool mate,

so does that keep it to 2 decimal places?

Yep,

Appears to change in .06-.07 deg increments and it should round down to the nearest .01 deg.
I know the sensor probably isn't that accurate, but it's easier to see the temp trending up or down with the smaller increments.

I'm hoping to finally give the new controller a test run this weekend (long overdue). I might just jump straight in with a brew rather than water tests, POR ale, nice and simple.

Cheers
Dan
 
sounds good mate, just go for a brew, what's the worst thing that could happen :)
 
haha, I feel like an idiot.
I was just playing with the lcd.print and had a look at print.cpp and it seems that if you print a float it defaults to 2 decimal places so me anding 0xFFFC to the raw didn't keep it to 2 decimal places it was automatically doing it in the print function. If you want more or less decimal places you simply put a comma after the float variable and then the number of decimal places you want like this

lcd.print(Temp_c,1);

if you keep it to 1 decimal place and use the full 12 bit resolution the displayed temp rises but a nice and neat 0.1 degs

cheers steve
 
Nice to see this thread is still going. It's been quite a while since I have posted on it.. Probably back in 2008..

Anyway I spent the last few days coding up a Browser Based Controller for the Arduino (saves having to purchase & wire up buttons, LCD Screen etc & has remote access!)
with the Aim of using several of them for different purposes throughout my house. So I made the code as generic as possible. I plan on using one to control a HLT (Hot Liquor Tank) on a Brewery, One for Fermentation Control and one to simply switch on my Coffee Machine remotely but I can think of a multitude of uses if I can knock up my own boards/enclosures cheap enough.

I grabbed the cheapest parts I could find on eBay so I'm using an Arduino Nano Clone ($15) , Enc28J60 Ethernet ($5), Dallas Ds18b20 Temperature Sensor ($1) & an
LED (to replicate a Solid State Relay - SSR ($5), still waiting on mine to arrive form the slow boat from china)

Parts - Ethernet Board on the left, Arduino on the Right. I'm going to solder all the parts onto one PCB.

arduinosm.jpg

Browser Output (Auto Mode)

webserver_auto.png

Browser Output (Manual Mode)

webserver_manual.png

Source Code ==> http://www.halfluck.com/source/webserver/T...erWebServer.ino

Cheers Rob.
 
Nice one Rob! I'll have a look at your code. I have been thinking about getting an ethernet shield for my HERMS controller. I have been using IR remote control, but it isn't very reliable and I have to slow the main loop down with a delay(); to get it to read... even using interrupts, which is odd.
 
Nice to see this thread is still going. It's been quite a while since I have posted on it.. Probably back in 2008..

Anyway I spent the last few days coding up a Browser Based Controller for the Arduino (saves having to purchase & wire up buttons, LCD Screen etc & has remote access!)
with the Aim of using several of them for different purposes throughout my house. So I made the code as generic as possible. I plan on using one to control a HLT (Hot Liquor Tank) on a Brewery, One for Fermentation Control and one to simply switch on my Coffee Machine remotely but I can think of a multitude of uses if I can knock up my own boards/enclosures cheap enough.

I grabbed the cheapest parts I could find on eBay so I'm using an Arduino Nano Clone ($15) , Enc28J60 Ethernet ($5), Dallas Ds18b20 Temperature Sensor ($1) & an
LED (to replicate a Solid State Relay - SSR ($5), still waiting on mine to arrive form the slow boat from china)

Parts - Ethernet Board on the left, Arduino on the Right. I'm going to solder all the parts onto one PCB.

View attachment 55873

Browser Output (Auto Mode)

View attachment 55874

Browser Output (Manual Mode)

View attachment 55875

Source Code ==> http://www.halfluck.com/source/webserver/T...erWebServer.ino

Cheers Rob.
Thanks for sharing Rob, good to hear from you again. :icon_cheers:
 
Hey Guys,

I just wished all these parts were soo cheap a couple of years ago would have saved soo much time!

Knocked up a quick shield during lunch & sent it of to get fabbed. It will allow me to keep everything together and a small footprint (51cmx51cm)
It has screw down Terminals for 4 x SSR's and as many Temperature sensors as I want, a pin header for Ethernet as well which supports both
ENC28J60 & Wiznet Chips & 2 pin headers for each pin on the Arduino.

shield.png

Cheers Rob.
 
Hey Guys,

I just wished all these parts were soo cheap a couple of years ago would have saved soo much time!

Knocked up a quick shield during lunch & sent it of to get fabbed. It will allow me to keep everything together and a small footprint (51cmx51cm)
It has screw down Terminals for 4 x SSR's and as many Temperature sensors as I want, a pin header for Ethernet as well which supports both
ENC28J60 & Wiznet Chips & 2 pin headers for each pin on the Arduino.

View attachment 55910

Cheers Rob.
Tell me you've integrated this with brewmate :party:
 
Received my Bonjuino today. Thanks Ben. Going to the Bunya mountains for the weekend so I will be working on this and the brauduino sheild on the weekend.

Cheers
 
Hey Guys,

I just wished all these parts were soo cheap a couple of years ago would have saved soo much time!

Knocked up a quick shield during lunch & sent it of to get fabbed. It will allow me to keep everything together and a small footprint (51cmx51cm)
It has screw down Terminals for 4 x SSR's and as many Temperature sensors as I want, a pin header for Ethernet as well which supports both
ENC28J60 & Wiznet Chips & 2 pin headers for each pin on the Arduino.

View attachment 55910

Cheers Rob.
Nice one Rob. Custom PCBs make things so much easier and neater. I had one made in the standard arduino form factor. It makes the LCD, DS1820 etc so much easier to connect. I used the 2.54mm screw terminal connectors from modtronix. Screw terminals rock.

Hard to see it with the bonjuino in the way, but you get the idea:
herms_rv2_2.jpg
 
Received my Bonjuino today. Thanks Ben. Going to the Bunya mountains for the weekend so I will be working on this and the brauduino sheild on the weekend.

Cheers
Good to hear it arrived quickly, Brad. Can't wait to see all these Braumisers in operation!
 
All,

I have just created an arduino library for motorised ball valves (if anyone is inetrested). Its made to work with two relays per valve so polarity can be reversed & for the 5 wire devices where we get signals when fully open / fully closed.

Comprises of a couple of C++ classes to allow them to be named & referenced by name


You implement like this:-
Code:
  // Global

  BallValves cValves;



  // In setup

  cValves.AddValve ("Valve1", FirstpinNumberGoesHere);  //This assumes +2 per pin, so 22,24,26,28, i used a SIL pin header to connect to relay module / valve inputs

  // or

  cValves.AddValve ("Valve2", 22,23,24,25,26);		  // This allows individual pins to be specified, so can map how you like



  cValves.OpenValve("Valve1"); // Open / close can be done anywhere of course after valve is added





   // in loop

  cValves.Run();

The AddValve creates a valve object, chucks it the valves container and sets up the pins / states etc

The run method checks if any of the valves added need to do anything, gets called each loop and maintains states of valves etc, so no waiting around in loop for things to happen, you can just query the valve state to see what its upto

Still testing it somewhat (and cleaning it up) , happy to share it with anyone interested

Andy
 
All,

I have just created an arduino library for motorised ball valves (if anyone is inetrested). Its made to work with two relays per valve so polarity can be reversed & for the 5 wire devices where we get signals when fully open / fully closed.

Comprises of a couple of C++ classes to allow them to be named & referenced by name


You implement like this:-
Code:
  // Global

  BallValves cValves;



  // In setup

  cValves.AddValve ("Valve1", FirstpinNumberGoesHere);  //This assumes +2 per pin, so 22,24,26,28, i used a SIL pin header to connect to relay module / valve inputs

  // or

  cValves.AddValve ("Valve2", 22,23,24,25,26);		  // This allows individual pins to be specified, so can map how you like



  cValves.OpenValve("Valve1"); // Open / close can be done anywhere of course after valve is added





   // in loop

  cValves.Run();

The AddValve creates a valve object, chucks it the valves container and sets up the pins / states etc

The run method checks if any of the valves added need to do anything, gets called each loop and maintains states of valves etc, so no waiting around in loop for things to happen, you can just query the valve state to see what its upto

Still testing it somewhat (and cleaning it up) , happy to share it with anyone interested

Andy

Thanks for sharing Andy, I can't figure out what you meant by "This assumes +2 per pin".

How many of these valves do you have in your system? Also, can they be partially opened (for flow control)?

Cheers.
 
Thanks for sharing Andy, I can't figure out what you meant by "This assumes +2 per pin".

How many of these valves do you have in your system? Also, can they be partially opened (for flow control)?

Cheers.

The way the mega is arranged, it has two rows of pins (A DIL connector) . I have 5 valves, will be 6 or 7 by the time I am done.

22 23
24 25
26 27
28 29
30 31

So I have SIL plugs for my valves, so for example valve #1 will occupy pins 22,24,26,28 (motor, motor, sensor, sensor)

Partial opens are possible by sending an open and stop. I am working on maintaining timings for valves to allow semi-precise positioning
 

Latest posts

Back
Top