 |
|
05-31-2008, 05:04 AM
|
#1
|
|
Nothin' like a lil 60 grit...
Feedback Score: 0 reviews
Join Date: Jul 2006
Location: Southwest
Posts: 13,325
Liked 380 Times on 237 Posts Likes Given: 40
|
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.
|
|
|
05-31-2008, 05:11 AM
|
#2
|
|
Feedback Score: 0 reviews
Join Date: Jan 2007
Location: Cereal City, USA
Posts: 2,646
Liked 8 Times on 7 Posts
|
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
|
|
|
05-31-2008, 05:13 AM
|
#3
|
|
Nothin' like a lil 60 grit...
Feedback Score: 0 reviews
Join Date: Jul 2006
Location: Southwest
Posts: 13,325
Liked 380 Times on 237 Posts Likes Given: 40
|
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).
|
|
|
05-31-2008, 01:25 PM
|
#4
|
|
Feedback Score: 0 reviews
Join Date: May 2007
Location: Nashua, NH
Posts: 1,637
Liked 6 Times on 5 Posts
|
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.
|
|
|
05-31-2008, 02:05 PM
|
#5
|
|
Nothin' like a lil 60 grit...
Feedback Score: 0 reviews
Join Date: Jul 2006
Location: Southwest
Posts: 13,325
Liked 380 Times on 237 Posts Likes Given: 40
|
Quote:
Originally Posted by Funkenjaeger
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...
|
|
|
05-31-2008, 04:34 PM
|
#6
|
|
Feedback Score: 0 reviews
Join Date: Oct 2007
Posts: 196
Liked 1 Times on 1 Posts
|
yuri, are you into reprap? are you building one?
|
|
|
06-02-2008, 12:08 AM
|
#7
|
|
Nothin' like a lil 60 grit...
Feedback Score: 0 reviews
Join Date: Jul 2006
Location: Southwest
Posts: 13,325
Liked 380 Times on 237 Posts Likes Given: 40
|
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.
|
|
|
06-02-2008, 12:38 PM
|
#8
|
|
Feedback Score: 0 reviews
Join Date: May 2007
Location: Nashua, NH
Posts: 1,637
Liked 6 Times on 5 Posts
|
Quote:
Originally Posted by Yuri_Rage
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.
|
|
|
01-26-2013, 09:34 PM
|
#9
|
|
Feedback Score: 0 reviews
Join Date: May 2010
Location: Chicago, Illinois
Posts: 263
Liked 13 Times on 9 Posts Likes Given: 22
|
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.
|
|
|
01-27-2013, 10:24 AM
|
#10
|
|
Nothin' like a lil 60 grit...
Feedback Score: 0 reviews
Join Date: Jul 2006
Location: Southwest
Posts: 13,325
Liked 380 Times on 237 Posts Likes Given: 40
|
It'll work with any PWM capable microcontroller. Use PWM to drive a transistor/MOSFET circuit that switches the power supply current.
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
|
|
|