New Giveaway - Wort Monster Conical Fermenter!

Home Brew Forums > Home Brewing Beer > DIY Projects > Arduino Stir Plate (digital speed control)




Reply
 
LinkBack Thread Tools Display Modes
Old 05-31-2008, 05:04 AM   #1
Yuri_Rage
Gritty.
HBT_MODERATOR.png
Feedback Score: 0 reviews
 
Yuri_Rage's Avatar
Recipes 
 
Join Date: Jul 2006
Location: Southwest
Posts: 13,869
Liked 578 Times on 359 Posts
Likes Given: 52

Default Arduino Stir Plate (digital speed control)

I haven't made one, and I'm not sure if I will since I already have a nice stir plate, but I wrote and tested the code today with an LED (sheer boredom), and I have sourced all the parts, so I thought I'd share.

You'll need:
Arduino board ($35)
PWM driver (kit - $12)
12VDC muffin fan (lots of sources - $5)
9-12VDC (500mA min) power supply (electronics store - $5)
10k ohm linear taper potentiometer (electronics store - $1)
2 strong magnets (old hard drive, eBay, science surplus - $1)
An enclosure (cigar box, plastic tub, cardboard box, etc - practically free)
Wire + soldering skills
Glue (epoxy)
USB cable
Computer

Parts total: $69-ish (much cheaper if you have parts laying around or if you elect to use an Arduino kit board instead of the pre-assembled one linked above)

Code:
/*
  Arduino Stir Plate
  Uses PWM to control motor speed
  This is much more efficient and motor friendly than resistive speed controls
  It may also allow slower motor speeds to be achieved
  30 May 08 - Yuri_Rage - www.homebrewtalk.com
*/

int driverPin = 9;  // PWM driver connected to digital pin 9
int potPin = 0;     // potentiometer connected to analog pin 0
int oldValue = 0;   // store an old analog value
int newValue = 0;   // store a new analog value for comparison
float divisor;      // divide analog input by this value
float castFloat;    // for type conversion

/*
   NOTE: Increase minValue to keep the motor from stalling and give higher fidelity adjustment.
         The min value is 0 and will give full range adjustment (including off).
         The max value is 254 and will result in full speed regardless of adjustment.
         A minValue between 20 and 100 should be adequate.
*/
int minValue = 0;  // minimum PWM value - read above

void setup() 
{ 
  divisor = 1024.0 / (255.0 - (float)minValue);  // analog inputs are 10 bit while PWM are 8 bit, so we need some division
  //Serial.begin(9600);                          //uncomment for debugging
} 
 
void loop() 
{ 
  castFloat = (float)analogRead(potPin) / divisor + (float)minValue;  // use the divisor already calculated, then add the min value
  newValue = (int)castFloat;
  if (pow((newValue - oldValue), 2) > 1) { // only change state if the PWM value has changed by more than 1 (simple noise reduction)
    analogWrite(driverPin, newValue);      // make the new PWM value active
    oldValue = newValue;                   // store the new state
    //Serial.print("PWM value: ");         // uncomment for debugging
    //Serial.println(newValue);            // uncomment for debugging
  }
  delay(10);                               // wait a little - no need to run full tilt
}
Sorry, no schematic, but it's pretty simple. You'll wire the potentiometer to analog pin 0 on the Arduino. One of the PWM driver's inputs gets wired to digital pin 9. The fan is powered by the driver board output. The DC source can power both the driver board and the Arduino. I can take a picture of the breadboarded circuit with the LED if anyone is interested.


__________________
Homebrewed Blog..........YouTube Channel .......... Shirts, posters, etc
Yuri_Rage is offline
 
Reply With Quote Quick reply to this message
Old 05-31-2008, 05:11 AM   #2
eriktlupus
Feedback Score: 0 reviews
 
eriktlupus's Avatar
Recipes 
 
Join Date: Jan 2007
Location: Cereal City, USA
Posts: 2,648
Liked 9 Times on 7 Posts

Default

yuri you have to much time on your hands again!



__________________

primary1 :UTOPIA BABY(still searching for it)
secondary:middling bastard ipa
kegged:simcoe blonde, crystal pale ale, yellow jacket golden ale, lemon shandy blonde
DRINKIN DAWG BREWERY
LET'S GO RED WINGS


join michigan mashers here

extraction calculator
grains in pounds(G) X 36(average points per gallon of grains) / batch size in gallons(g) = maximum efficiency(ME)
OG / ME = brewhouse efficiency

eriktlupus is offline
 
Reply With Quote Quick reply to this message
Old 05-31-2008, 05:13 AM   #3
Yuri_Rage
Gritty.
HBT_MODERATOR.png
Feedback Score: 0 reviews
 
Yuri_Rage's Avatar
Recipes 
 
Join Date: Jul 2006
Location: Southwest
Posts: 13,869
Liked 578 Times on 359 Posts
Likes Given: 52

Default

Yeah, I know. But I got another Arduino board for a new project, and I wanted to test it out. This was a simple way to do it.

The cool thing about PWM is that it's very efficient for things like stir plate control. Because it pulses full power in short, rapid bursts, slower motor speeds MIGHT be possible (in comparison to the LM317 circuits or simple potentiometer controls).

__________________
Homebrewed Blog..........YouTube Channel .......... Shirts, posters, etc
Yuri_Rage is offline
 
Reply With Quote Quick reply to this message
Old 05-31-2008, 01:25 PM   #4
Funkenjaeger
Feedback Score: 0 reviews
 
Funkenjaeger's Avatar
Recipes 
 
Join Date: May 2007
Location: Nashua, NH
Posts: 1,637
Liked 8 Times on 7 Posts

Default

Well that's certainly one way to do it (and believe me, I'm a microcontroller fan), but you can build a PWM controller with a 555 timer for like <$10. On the one I built, the whole PCB is 1" x 3", and there's about 15-20 components.

PWM definitely does let you get down to nice low motor speeds. The problem you face there is that the motor can sustain movement at that speed, but it can't start up, so you need to kind of jump-start it, which normally involves cranking the speed up higher to start it spinning, and then dropping it back down. On my board, a couple passive components do it automatically by giving it a high duty cycle for a couple seconds on power-up, but you could do the same thing in firmware on your design.

__________________
Funkenjaeger is offline
 
Reply With Quote Quick reply to this message
Old 05-31-2008, 02:05 PM   #5
Yuri_Rage
Gritty.
HBT_MODERATOR.png
Feedback Score: 0 reviews
 
Yuri_Rage's Avatar
Recipes 
 
Join Date: Jul 2006
Location: Southwest
Posts: 13,869
Liked 578 Times on 359 Posts
Likes Given: 52

Default

Quote:
Originally Posted by Funkenjaeger View Post
Well that's certainly one way to do it (and believe me, I'm a microcontroller fan), but you can build a PWM controller with a 555 timer for like <$10. On the one I built, the whole PCB is 1" x 3", and there's about 15-20 components.
Oops, I meant to mention 555 based circuits as a means of keeping cost down in my original post. I know this particular design is a little bit of overkill. In fact, it's almost a waste of a perfectly good microcontroller board and multi-output driver to use them for something so simple. On the other hand, it would make a great microcontroller intro project.

However, if you've seen my other projects, you know that overkill should probably be my middle name...
__________________
Homebrewed Blog..........YouTube Channel .......... Shirts, posters, etc
Yuri_Rage is offline
 
Reply With Quote Quick reply to this message
Old 05-31-2008, 04:34 PM   #6
stevecaaster
Feedback Score: 0 reviews
Recipes 
 
Join Date: Oct 2007
Posts: 196
Liked 2 Times on 2 Posts

Default

yuri, are you into reprap? are you building one?

__________________
stevecaaster is offline
 
Reply With Quote Quick reply to this message
Old 06-02-2008, 12:08 AM   #7
Yuri_Rage
Gritty.
HBT_MODERATOR.png
Feedback Score: 0 reviews
 
Yuri_Rage's Avatar
Recipes 
 
Join Date: Jul 2006
Location: Southwest
Posts: 13,869
Liked 578 Times on 359 Posts
Likes Given: 52

Default

Actually, I found the RepRap site by looking for thermocouple circuits and PWM examples for Arduino. However, I quickly became fascinated by the RepRap project. I'm not building one, but I may look into it at some point.

__________________
Homebrewed Blog..........YouTube Channel .......... Shirts, posters, etc
Yuri_Rage is offline
 
Reply With Quote Quick reply to this message
Old 06-02-2008, 12:38 PM   #8
Funkenjaeger
Feedback Score: 0 reviews
 
Funkenjaeger's Avatar
Recipes 
 
Join Date: May 2007
Location: Nashua, NH
Posts: 1,637
Liked 8 Times on 7 Posts

Default

Quote:
Originally Posted by Yuri_Rage View Post
On the other hand, it would make a great microcontroller intro project.
I was just thinking the same thing... Especially given the huge popularity of the Arduino recently.
__________________
Funkenjaeger is offline
 
Reply With Quote Quick reply to this message
Old 01-26-2013, 09:34 PM   #9
fc36
Feedback Score: 0 reviews
Recipes 
 
Join Date: May 2010
Location: Chicago, Illinois
Posts: 332
Liked 18 Times on 13 Posts
Likes Given: 26

Default

Resurrect... Yuri, do you think this would work with a pro mini or a lilypad board? That way you can keep costs close to a 555 build and still mess around with arduino.

__________________
fc36 is offline
 
Reply With Quote Quick reply to this message
Old 01-27-2013, 10:24 AM   #10
Yuri_Rage
Gritty.
HBT_MODERATOR.png
Feedback Score: 0 reviews
 
Yuri_Rage's Avatar
Recipes 
 
Join Date: Jul 2006
Location: Southwest
Posts: 13,869
Liked 578 Times on 359 Posts
Likes Given: 52

Default

It'll work with any PWM capable microcontroller. Use PWM to drive a transistor/MOSFET circuit that switches the power supply current.



__________________
Homebrewed Blog..........YouTube Channel .......... Shirts, posters, etc
Yuri_Rage is offline
 
Reply With Quote Quick reply to this message
Reply


Quick Reply
Message:
Options
Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
What Magnets/Stir Bar do you use for your Stir Plate? Stevorino Equipment/Sanitation 28 10-04-2013 05:32 PM
Arduino for kegerator temperature control. Orfy DIY Projects 19 04-21-2010 12:18 PM
Arduino with 2wire/SMBUS digital thermometer Spine DIY Projects 11 12-30-2009 03:01 PM
My arduino fridge control build. simpleton DIY Projects 4 01-09-2009 04:40 PM
DIY Stir Plate speed control - high/low switch knowltonm Equipment/Sanitation 5 10-05-2008 03:30 PM



Newest Threads