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.
Partial opens are possible by sending an open and stop. I am working on maintaining timings for valves to allow semi-precise positioning


I believe the guys over at brewtroller have/are working on partial openings set as a percentage value, I haven't perused the site for a while so I'm not sure of their progressbut might be woth checking out.
 
By recording and averaging the time from open to close etc I can record the timings of a specific valve (as they will all differ) as each of these valves and states lives in its own instance, its easy. Over a period of time (i.e. my startup / pre-brew clean routine) I can probably have a good stab at 25%, 50% and 75%. Of course when in the "manual / percentage" state, on-screen buttons can be used to step the motors if i need slightly more, having quite accurate level sensors (pressure / bubble) I can soon calculate flows etc and back off / advance any given valve


p.s. no progress today, too many hours at work!

I believe the guys over at brewtroller have/are working on partial openings set as a percentage value, I haven't perused the site for a while so I'm not sure of their progressbut might be woth checking out.
 
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

Awesome Andy! Your brewery sounds like it is coming along nicely.

When I built my first Automated Brewery electric Ball Valves were so exxy! so I end up using a couple of peristaltic pumps
to act as ball valves, that worked well but the CIP was just too much effort so I'm looking for a simpler solution.. at a bare
minimal i'd like to add a ballvalve or solenoid to my HLT so the Dough In will be looked after and I get a bit more of a sleep in.

I end up re-writing my code using a better Ethernet Library (EtherCard)
I'm really happy with how it is running, most of my bits have arrived from china just waiting on the Custom PCB to arrive.

auto.jpg

manual.jpg

http://www.halfluck.com/source/webserver/T...erWebServer.ino

Cheers Rob.
 
Rob in one of your earlier posts you said you were using a Dallas Ds18b20 One Wire for your temp sensor; do you have a sensor handy that you can measure? I'd like to grab e a few of these sensors, but I need to find out if they'll fit in my fermenter thermowell first.

Also, where did you get them for $1? I can't find them that cheap anywhere.

Edit: Scratch that, found quite a few on ebay, some with wire attached already: http://www.ebay.com.au/itm/Waterproof-DS18...=item231f330cd2
Not quite $1, but close enough :) That should actually do exactly what I need :)
 
hey votex,

the sensors are in a TO-92 package the dimensions are HERE
you can get cheap DS18B20 off ebay

cheers steve
 
Hey Vortex,

Yep thats the one, i just grabbed a bulk lot so got the cheaper price. They work well and fit inside the thermowells I got perfectly.

Cheers Rob.
 
Thats a good price for those, I was paying about $4.80 for those until recent, still good value, the basic sensor is $1 - $1.5 + wire + stainless cap + heatshrink.
If inside a thermowell (which you probably will anyway), then sensor + wire+heatshrink will do

I made my own for the latest rig as I wanted 2m cables, most pre-made are 1m and I didnt want to extend

Rob in one of your earlier posts you said you were using a Dallas Ds18b20 One Wire for your temp sensor; do you have a sensor handy that you can measure? I'd like to grab e a few of these sensors, but I need to find out if they'll fit in my fermenter thermowell first.

Also, where did you get them for $1? I can't find them that cheap anywhere.

Edit: Scratch that, found quite a few on ebay, some with wire attached already: http://www.ebay.com.au/itm/Waterproof-DS18...=item231f330cd2
Not quite $1, but close enough :) That should actually do exactly what I need :)
 
You could also try sureelectronics, they have the sensors in thermowells with screw fitting and 3m cable for cheap. I use them in my braumiser.
 
Guys over the weekend i've been hacking about with my Freetronics Arduino before my sensors get here and building an LCD interface of sorts. Anyway, I'm hoping someone can help me out with a syntax issue i've run into (Extensive PHP background, not so much C/C++...). Google hasn't revealed any answers either.

Sensor address below is a dummy (borrowed from Rob's code!) just to get selecting the right sensor correct at this point.

Code:
const byte ambientSensorAddr[8]	 = {0x28, 0x61, 0x24, 0xC5, 0x03, 0x00, 0x00, 0x51}; 

const byte fridge1WortSensorAddr[8] = {0x28, 0x61, 0x24, 0xC5, 0x03, 0x00, 0x00, 0x51}; 

const byte fridge1AirSensorAddr[8]  = {0x28, 0x61, 0x24, 0xC5, 0x03, 0x00, 0x00, 0x51}; 

const byte fridge2WortSensorAddr[8] = {0x28, 0x61, 0x24, 0xC5, 0x03, 0x00, 0x00, 0x51}; 

const byte fridge2AirSensorAddr[8]  = {0x28, 0x61, 0x24, 0xC5, 0x03, 0x00, 0x00, 0x51}; 



// setup() and loop() here.



int getSensorTemp(int fermVess, int sensorNumber) {

  

  // Define the variable for the sensor address here.

  byte sensorAddr;

  

  Serial.print("Getting sensor temp:");

  

  switch(fermVess) {

	case 0:

	  // Only one sensor for this one and that's the 

	  // Ambient sensor. We ignore the value of sensorNumber.

	  sensorAddr[] = ambientSensorAddr; 

	  break;

	case 1:

	  // Fermentation Vessel 1.

	  switch(sensorNumber) {

		case 0:

		  // Wort Sensor.

		  sensorAddr[] = fridge1WortSensorAddr; 

		break; 

		case 1:

		  // Fridge Air Temp Sensor.

		  sensorAddr[] = fridge1AirSensorAddr;

		break;

	  }

	break;

	// Fermentation Vessel 2.

	case 2:

	  switch(sensorNumber) {

		case 0:

		  // Wort Sensor.

		  sensorAddr[] = fridge2WortSensorAddr; 

		break;  

		case 1:

		  // Fridge Air Temp Sensor.

		  sensorAddr[] = fridge2AirSensorAddr;

		break;

	  }

	break;

  }



  // code to read the actual sensor is here.



}

Compile errors are as follows:
Code:
arduferm.cpp: In function 'int getSensorTemp(int, int)':

arduferm:95: error: expected primary-expression before ']' token

arduferm:102: error: expected primary-expression before ']' token

arduferm:106: error: expected primary-expression before ']' token

arduferm:115: error: expected primary-expression before ']' token

arduferm:115: error: expected primary-expression before '{' token

arduferm:115: error: expected `;' before '{' token

arduferm:119: error: expected primary-expression before ']' token

arduferm:119: error: expected primary-expression before '{' token

arduferm:119: error: expected `;' before '{' token

Full code is at http://www.vortex.id.au/arduferm/ if anyone wants to have a look.
 
Guys over the weekend i've been hacking about with my Freetronics Arduino before my sensors get here and building an LCD interface of sorts. Anyway, I'm hoping someone can help me out with a syntax issue i've run into (Extensive PHP background, not so much C/C++...). Google hasn't revealed any answers either.

Sensor address below is a dummy (borrowed from Rob's code!) just to get selecting the right sensor correct at this point.

Code:
const byte ambientSensorAddr[8]	 = {0x28, 0x61, 0x24, 0xC5, 0x03, 0x00, 0x00, 0x51}; 

const byte fridge1WortSensorAddr[8] = {0x28, 0x61, 0x24, 0xC5, 0x03, 0x00, 0x00, 0x51}; 

const byte fridge1AirSensorAddr[8]  = {0x28, 0x61, 0x24, 0xC5, 0x03, 0x00, 0x00, 0x51}; 

const byte fridge2WortSensorAddr[8] = {0x28, 0x61, 0x24, 0xC5, 0x03, 0x00, 0x00, 0x51}; 

const byte fridge2AirSensorAddr[8]  = {0x28, 0x61, 0x24, 0xC5, 0x03, 0x00, 0x00, 0x51}; 



// setup() and loop() here.



int getSensorTemp(int fermVess, int sensorNumber) {

  

  // Define the variable for the sensor address here.

  byte sensorAddr;

  

  Serial.print("Getting sensor temp:");

  

  switch(fermVess) {

	case 0:

	  // Only one sensor for this one and that's the 

	  // Ambient sensor. We ignore the value of sensorNumber.

	  sensorAddr[] = ambientSensorAddr; 

	  break;

	case 1:

	  // Fermentation Vessel 1.

	  switch(sensorNumber) {

		case 0:

		  // Wort Sensor.

		  sensorAddr[] = fridge1WortSensorAddr; 

		break; 

		case 1:

		  // Fridge Air Temp Sensor.

		  sensorAddr[] = fridge1AirSensorAddr;

		break;

	  }

	break;

	// Fermentation Vessel 2.

	case 2:

	  switch(sensorNumber) {

		case 0:

		  // Wort Sensor.

		  sensorAddr[] = fridge2WortSensorAddr; 

		break;  

		case 1:

		  // Fridge Air Temp Sensor.

		  sensorAddr[] = fridge2AirSensorAddr;

		break;

	  }

	break;

  }



  // code to read the actual sensor is here.



}

Compile errors are as follows:
Code:
arduferm.cpp: In function 'int getSensorTemp(int, int)':

arduferm:95: error: expected primary-expression before ']' token

arduferm:102: error: expected primary-expression before ']' token

arduferm:106: error: expected primary-expression before ']' token

arduferm:115: error: expected primary-expression before ']' token

arduferm:115: error: expected primary-expression before '{' token

arduferm:115: error: expected `;' before '{' token

arduferm:119: error: expected primary-expression before ']' token

arduferm:119: error: expected primary-expression before '{' token

arduferm:119: error: expected `;' before '{' token

Full code is at http://www.vortex.id.au/arduferm/ if anyone wants to have a look.


You have used sensorAddr[] but you defined is as a non-array. add [8] to your definition, then put the assignment into a for loop.

eg

for (int i=0;i<8;i++) sensorAddr = ambientSensorAddr;

since you cannot copy arrays in cpp like that.

and you should be good to go.
 
You have used sensorAddr[] but you defined is as a non-array. add [8] to your definition, then put the assignment into a for loop.

eg

for (int i=0;i<8;i++) sensorAddr = ambientSensorAddr;

since you cannot copy arrays in cpp like that.

and you should be good to go.


Perfect! Thanks :)
 
I did a google search for difference between bonjuino and brewtroller, and amazingly got zero documents.
Can someone please tell me?
 
I did a google search for difference between bonjuino and brewtroller, and amazingly got zero documents.
Can someone please tell me?
The bonjuino is just an arduino clone in kit form (with a few cool things that I like, and hopefully others like enough to want one too). It is based on an ATmega328 microcontroller. The brewtroller is based on an ATmega2560, which is a faster, bigger controller with more memory and more I/O pins.
 
The bonjuino is just an arduino clone in kit form (with a few cool things that I like, and hopefully others like enough to want one too). It is based on an ATmega328 microcontroller. The brewtroller is based on an ATmega2560, which is a faster, bigger controller with more memory and more I/O pins.
Don't talk the bonj down, it's very capable. :)
 
Back
Top