ChuckJaxFL's PWM - Home Brew Forums
Home Brew Forums > Home Brewing Beer > DIY Projects > ChuckJaxFL's PWM

Reply
 
Thread Tools
Old 08-01-2012, 12:46 AM   #1
chuckjaxfl
Recipes 
 
Feb 2010
Jacksonville, FL
Posts: 327
Liked 22 Times on 14 Posts



I finally put together a PWM.

A friend wanted a PWM to use alongside the PID already installed in his awesome BIAB system. He's more than capable of building his own, but I told him I wanted to throw one together for him.

He didn't want a DPDT between the PID & the PWM. I forget now why, but that was one of the design goals. We started, initially, to consider just putting diodes on the +'s of both the PWM and PID. Once the PWM was turned on, the temp would rise and the PID would stop sending signals. I wanted a tighter control, so this is what I came up with.


CS223 Likes This 
Reply With Quote
Old 08-01-2012, 12:51 AM   #2
chuckjaxfl
Recipes 
 
Feb 2010
Jacksonville, FL
Posts: 327
Liked 22 Times on 14 Posts


Some pics
Click image for larger version

Name:	image-4055375811.jpg
Views:	1178
Size:	60.1 KB
ID:	70330   Click image for larger version

Name:	image-192077746.jpg
Views:	1160
Size:	32.5 KB
ID:	70331  

 
Reply With Quote
Old 08-01-2012, 02:27 AM   #3
chuckjaxfl
Recipes 
 
Feb 2010
Jacksonville, FL
Posts: 327
Liked 22 Times on 14 Posts


The PWM can run on 7-12vdc. The PID is wired into the PWM, rather than the SSR. When the switch is in the "off" position, the PID controls the SSR. Once turned "on", the PWM takes over control of the signal.

The schematic & board were drawn in Cadsoft Eagle (freeware version). I used iTead's CAM files to create the gerber files for the boards, and then had them produce the boards for me. I emailed the files on 7/8/12, the boards arrived 7/30/12. 10 boards cost me $18.90 to the door. It would have been less, but I got them in black, just because.

I considered using a 555, but went with an ATtiny85 instead. With a 555, I'd have to recalculate resistors and capacitor values, and then actually break out a soldering iron again to change anything. With this chip, I can change the code on it in seconds if I want to change the function. The downside is the ATtiny85 costs a little more and requires a voltage regulator.

It was going to be all through-hole parts, but CS223 encouraged me to try using these surface mount components. The parts on the back (that 8 pin chip, the two brick shapes pieces and the voltage regulator) were a breeze. Much easier than expected. On the front, there's 8 or 9 components in that little area behind the potentiometer. They are 0603 components (0.06" x 0.03"). This is the LAST time I'll use them. WOW those are tough to handle. The take-home lesson is to stick with the surface mount stuff (small & cheap), but use the more manageable 0805 or 1206 parts. I've got enough parts to make a handful of these PWM's. Maybe once I'm done, I'll have had enough practice to think differently.

If there's some way to do it, I'll zip the Eagle files and post them here. I put the OSHW logo on there, and the CC-SA license in hopes that someone will take the files and build something more impressive.

The code is stupidly simple:

Code:
#define potPin 1
#define ssrPin 4
#define windowTime 1000
unsigned long markTime=millis();

void setup(){
  pinMode (potPin,INPUT);
  pinMode (ssrPin,OUTPUT);
}
void loop(){
  int period = map(analogRead(potPin),0,1023,0,windowTime);
  if ((millis()-markTime)<period) digitalWrite(ssrPin,HIGH);
  if ((millis()-markTime)>period) digitalWrite(ssrPin,LOW);
  if ((millis()-markTime)>windowTime) markTime=millis();
}

The code could easily be modified, though. For instance, you could have the knob start at 30% instead of 0%. Or max out at 80% if you wanted to. Or reverse direction.

For my own copy, I will have the first 10% of the knob cover from 0-40%, the last 10% cover 80-100%, and then have doubly fine control from 40-80% (the range where I suspect most of us are boiling).

 
Reply With Quote
Old 08-01-2012, 01:21 PM   #4
CS223
HBT_LIFETIMESUPPORTER.png
Recipes 
 
Feb 2012
Gainesville, Florida
Posts: 256
Liked 41 Times on 11 Posts


Such a clean elegant solution. Congrats on going with the SMT, it's not that difficult once you try. Can't wait to put it to use.
__________________
My BIAB RIMS E-Brewery Build : My spunding valve build : My shamelessly cheap stir plate build : Cereal Killer Mill Tear-down : My Temp Controller Build : My awesome LHBS

Of all the things I've learned from HBT the single most important lesson has been: RDWHAHB.

 
Reply With Quote
Old 08-01-2012, 07:58 PM   #5
stamandster
Recipes 
 
Jun 2011
springfield, ma
Posts: 763
Liked 53 Times on 44 Posts


Dude can I buy one?? that's awesome!

 
Reply With Quote
Old 08-02-2012, 12:56 AM   #6
chuckjaxfl
Recipes 
 
Feb 2010
Jacksonville, FL
Posts: 327
Liked 22 Times on 14 Posts


I'll barter one instead? Click on my name and do the "donate" thing for a membership for me, and I'll send you one. That way, the board here actually gets the money. Sound fair?

Wait until I get another one put together, though. I've got some family here with health issues. If you do send the money, then I disappear for a week or more before I get it to you... that would bother me a lot.

 
Reply With Quote
Old 08-02-2012, 05:32 AM   #7
NiteOwlBrewing
Recipes 
 
Jul 2008
Dayton, OH
Posts: 145

Will this work as a stand alone element controller? It seems it would.

 
Reply With Quote
Old 08-02-2012, 12:27 PM   #8
chuckjaxfl
Recipes 
 
Feb 2010
Jacksonville, FL
Posts: 327
Liked 22 Times on 14 Posts


Quote:
Originally Posted by NiteOwlBrewing
Will this work as a stand alone element controller? It seems it would.
Sure it would. But if that's your plan, you can leave out all but just a few components.

 
Reply With Quote
Old 08-02-2012, 08:15 PM   #9
stamandster
Recipes 
 
Jun 2011
springfield, ma
Posts: 763
Liked 53 Times on 44 Posts


Quote:
Originally Posted by chuckjaxfl View Post
I'll barter one instead? Click on my name and do the "donate" thing for a membership for me, and I'll send you one. That way, the board here actually gets the money. Sound fair?

Wait until I get another one put together, though. I've got some family here with health issues. If you do send the money, then I disappear for a week or more before I get it to you... that would bother me a lot.
Pm sent! How do you connect to the chip to adjust the PWM? I like the idea of the fine tuning of the percentages but looking for a full off and then full on @ 0 and 100% respectfully.

 
Reply With Quote
Old 08-02-2012, 09:26 PM   #10
chuckjaxfl
Recipes 
 
Feb 2010
Jacksonville, FL
Posts: 327
Liked 22 Times on 14 Posts


Quote:
Originally Posted by stamandster

Pm sent! How do you connect to the chip to adjust the PWM? I like the idea of the fine tuning of the percentages but looking for a full off and then full on @ 0 and 100% respectfully.
I'll have to do that for you before I send it. I temporarily solder a six pin header into the corner and hook up a programmer as I'm assembling it.

Where would you want the center of your 'fine control' band to be?

 
Reply With Quote


Reply
Thread Tools



Forum Jump