[Nathan] had an small router kicking around and thought that he might as well put it to good use. He had always been interested in getting a better handle on his espresso machine, and figured that the router would be a perfect Linux-based PID controller.
He installed OpenWRT on the router, then disassembled it in order to get access to the router’s GPIO pins. He built a small PCB that allows him to get temperature info from the machine to the router using i2c. [Nathan] put together a PID package for OpenWRT, allowing him to control the machine over SSH, though he may build in a user-friendly web interface sometime in the future.
He says that most espresso machine PID controllers he has seen come in the form of big ugly boxes slapped on the side of the machine’s case, though we have to disagree with him on that point. Opinions aside, he is going for a minimalist design, and while he says that he is only about half way through the project, we think things are looking promising so far.
When everything is said and done, we hope to get a much closer look at all of his code, schematics, and more information on the router he used as well.
23 thoughts on “Using A Router As A Linux-based PID Controller”
Wow really light on details. What model and brand router? details on the schematic? how about a bit of code?
Don’t worry. HaD says it looks promising, so it must be good.
@fartface I say what it is on my blog. It’s a Meraki Mini With OpenWRT Backfire loaded on it. It’s an Atheros based router
When your only tool is a hammer mill every problem looks like a car body. This obsession of using Linux to do basic stuff is maddening. Why my Panasonic Plasma TV runs a Linux kernel is beyond me.
I don’t want to respond to everyone, but I probably will. Basic stuff now reads as doing PID calculations and maintaining an even temperature? I could buy a generic PID box, but it wouldn’t :
– Be able to have a time to turn it on/off at a certain time
– Can be extended to have a web interface / iPhone interface.
PIDs are annoying to program and are either an ugly box next to the machine or are placed in a giant hole you cut in the frame. This is more elegant in many ways.
Use Linux to only blink one single LED
Not quite. You have to measure the temperature with an ADC chip and a ambient temperature chip, and decide for how much of that second the “LED” should be on.
I really do not see the issue with people using Linux to do simple things. I brought forth the kernel from my sweaty loins so that you all may do with it what you wish, however you wish.
Some people use paint brushes to make a picture, others choose to throw paint through a weed whacker. The result is a painting, regardless of how you cut it. Different tools can still yield the same results.
That said, this guy clearly had a small router on hand that is crappy at routing, but good at being a small computer that runs Linux. Why should he purchase a PID or build one from the ground up when he already has a perfectly good tool at his disposal? Can you really justify going out and buying all the components he would need to build the PID when he already had everything he needed on hand? Why buy buy buy when you can re-use, re-purpose, and recycle?
Screw the web interface, this thing needs a HTCPCP (Hyper Text Coffee Pot Control Protocol) interface:
There is absolutely nothing wrong with using more than you need to do a job. It’s about using what you *HAVE*.
uhh, using linux gives you a ton of flexibility….
…unless you hate flexibility.
do you hate flexibility?
whats a PID?
I like the idea of boiling an egg with a nuclear pile. It comfort the soul to know who is the hunter and who is the prey.
Never heard of a Meraki Mini, but at a glance it appears virtually identical to the original Fonera.
@Andrew: PID = Proportional-Integral-Derivative. A way of controlling something that has inertia (in this case thermal inertia) with minimal over/under shoot. Also used for motor control and many other things. Modeled after how we naturally steer cars, ships, or move our own limbs to desired positions. For a more detailed summary, look up “PID Loop” on Wikipedia.
Nice work. I’m going to pass this along to a friend who is working on a self-tuning PID SousVide controller.
I miss the old photos of hackaday.com, black and white, with clear tape in the corners
A slightly less overkill solution might be to use the Arduino PID Library (full disclosure, I’m the author)
And because this is HaD and the Arduino is… frowned upon, let me also mention that did an extensive blog series accompanying the latest library release. It details all the steps necessary to turn a basic pid algorithm in to something of industrial quality.
dunno…maybe I’m the idiot… but at 45 yrs old, I always thought the art of hacking was to take what you have and make it do something it wasn’t intended for, i.e. using a router for a PID!
I remeber when Tardis BBS (I think that was the boards name, but the name unimportant), there was OP named Zaphod (again i think that was the name, or it may have been Arthur Dent! ) had a ongoing thread about daily hacks and simple hacks.
Simple hacks were like taping a plastic can cover over a scraped together speaker box to make it water proof (albeit marginally!). I guess he’d get the flaming of his life if he ever sent that stuff here….
My point is hacks are hacks, and when people stop trying to one up the next guy, especially when you are not adding any value, just saying ‘I could name the tune in 3 notes’ is getting prety lame and some of you ‘hackers’ need to grow up…
GOOD JOB NATHAN.
@Brett it’s overkill if you don’t want to do more than the limited Arduino hardware can do.
– Have the PID on a timer that is different each day (I DO!)
– Turn your coffee machine on/off while away from home (I DO)
– Have the ability eventually have a simple iPhone interface for it (I DO)
But sure, I should have written Arduino sketch instead of a OpenWRT package, though the work would be the same, and I’d have to buy and Arduino…
Hell yes! rereading my post my tone is way off. this project is insanely awesome.
I guess a better way to say it would have been “if you think this is overkill, perhaps a slightly less… blah blah blah”
A real he-man hardware hacker woulda done it using 555s, like this dude is working on: http://www.paleotechnologist.net/?cat=248
Sign o-the times: LinDuino,coming soon from some Hardwin*Fruit w/8-bits instead of just two…
*Hardwin = Arduino in English = “Strong Man”, makes one say, “Hmmm”
I really like this idea. I wonder how many other Linux-capable routers have GPIO pins.
This is never going to come close to full awesomeness until it includes a Kalman filter as well. For filtering that coffee, obviously, and just because we can.
…oh wait, it’s an espresso. Right…
Please be kind and respectful to help make the comments section excellent. (Comment Policy)