0

SousViduino
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

SousViduino

by blackfab on Fri Aug 02, 2013 1:47 pm

Hi,
Yet another newbie here on a steep learning curve.
Is it possible to use the Arduino Leonardo instead of using the Uno as described in the "What is Sous Vide?" tutorial.

blackfab
 
Posts: 2
Joined: Sun Jul 21, 2013 9:37 am

Re: SousViduino

by adafruit_support_bill on Fri Aug 02, 2013 2:30 pm

Yes. The Leonardo should work fine.

adafruit_support_bill
 
Posts: 74337
Joined: Sat Feb 07, 2009 10:11 am

Re: SousViduino

by blackfab on Fri Aug 02, 2013 2:41 pm

Cheers Bill and thanks for the prompt response.

blackfab
 
Posts: 2
Joined: Sun Jul 21, 2013 9:37 am

Re: SousViduino

by ytoff57 on Thu Aug 08, 2013 2:51 am

Just to add... I've had some problems with the build of a Sous-Viduino using a Atmel 32u4 based board (I'm using the Teensy 2.0 but the Leonardo uses the same chip.) Basically the code provided by Adafruit directly talks to the chip to enable timer2:

Code: Select all | TOGGLE FULL SIZE
// Run timer2 interrupt every 15 ms
  TCCR2A = 0;
  TCCR2B = 1<<CS22 | 1<<CS21 | 1<<CS20;
 
  //Timer2 Overflow Interrupt Enable
  TIMSK2 |= 1<<TOIE2;


That code won't work because there is no timer2 on the 32u4 (or it is used for another purpose). The interrupt will never get triggered and the PID controller won't be able to drive the output. I've corrected this with the following code instead:

Code: Select all | TOGGLE FULL SIZE
#include <TimerOne.h>
//...
void setup()
{
  //...
  Timer1.initialize(15000);
  Timer1.attachInterrupt(TimerInterrupt);
}
//..
void TimerInterrupt()
{
  if (opState == OFF)
  {
    digitalWrite(RelayPin, LOW);  // make sure relay is off
  }
  else
  {
    DriveOutput();
  }
}


So there you go. Like I said I'm using a different board so maybe you won't have any problems, but I thought I would post it anyway to avoid any head scratching (which I had to endure ;-) )
ytoff57
 
Posts: 5
Joined: Tue Jul 23, 2013 9:50 pm

Re: SousViduino

by adafruit_support_bill on Thu Aug 08, 2013 6:14 am

Doh! I had forgotten about the timer differences. Thanks for the feedback!
I'll add this note to the tutorial. :D

adafruit_support_bill
 
Posts: 74337
Joined: Sat Feb 07, 2009 10:11 am

Re: SousViduino

by SneevlietCj on Tue Dec 17, 2013 12:30 pm

I have been using the "Example code for multi-button checker with debouncing", posted October 20, 2009.
This uses the same Trigger2 and it worked for me on Uno en Mega's, I now have some Leonardo's and now I have a problem.

// Run timer2 interrupt every 15 ms
TCCR2A = 0;
TCCR2B = 1<<CS22 | 1<<CS21 | 1<<CS20;

//Timer2 Overflow Interrupt Enable
TIMSK2 |= 1<<TOIE2;
}

SIGNAL(TIMER2_OVF_vect) {
check_switches();
}

What can I use on the Leonardo to get it to work ?
SneevlietCj
 
Posts: 1
Joined: Tue Dec 17, 2013 12:21 pm

Re: SousViduino

by adafruit_support_bill on Tue Dec 17, 2013 12:49 pm

See this post from above: viewtopic.php?f=8&t=42273#p210829

adafruit_support_bill
 
Posts: 74337
Joined: Sat Feb 07, 2009 10:11 am

Please be positive and constructive with your questions and comments.