Linux Based PID

Need help with equipment usage or want to share your latest discovery?
napierzaza
Posts: 221
Joined: 13 years ago

#1: Post by napierzaza »

Was inspired to write a post about my project. Original post (I had to host the images somewhere): http://obaru.tumblr.com/post/3748881704 ... -based-pid

Creating a Linux based PID
I figured I'd make a post for my new project, creating a Linux-based PID. Not sure why, I'm waiting for xCode 4 to download and I have nothing else scheduled. Basically a PID is something that can measure the heat of an object (coffee roaster, espresso machine) and control the heat by activating the heating element and controlling it more finely than the simple thermo switches the machines come with (thermistor? I don't know).

Basically at this point I have gotten quite far in the project, maybe half-way. I've researched the chips, built the circuit board, and learned enough about Linux development to get an application more or less complete. It compiles, and appears to measure the temperature at the end of the wire and appears to activate an LED which we can imagine is the electrical supply.

Guess what, Linux dev is hellish. Mac OS X does a lot of the header garbage for you. Not to mention this thing they call documentation. I now have about a dozen forum/mailing l list posts throughout the internet. Don't search for them, I didn't get any responses.

Here is a rundown of the project, and why it's maybe not the best idea. There are existing 200-300$ PID kits on the market, I could have been up and running 70 hours ago.

1. HEADLESS. I did not plan this project based on having a LCD screen or any buttons. I still have the GPIO space to include up to three buttons and one pot, but I don't have an absolute certainty of needing it. I want to not have to work with the espresso machine's case or damage how it's built.

Pretty much 90% of the PIDs out there include a big ugly box that slaps onto the side of the case, or others make you modify the case to include it in the front. For my project I want to have it be entirely invisible. You won't know it's there unless you notice...

2. THE ANTENNA. It's based on a wireless router that runs OpenWRT. So it can either be its own access point, or connect to your network as a client. It will have a little wifi antenna out the back and feasibly can have a HTML interface too if I get around to it.

I had considered a HTML interface before, but I've reconsidered since I think this will ultimately be just for me. Having a Linux system means I can have a network-time synced device that is on all the time. I can have cron scripts or other scripts that activate the heater or do other tasks. But the end result for the interface will be in my hand.

3. iPHONE. If you have a wifi enabled PID device and you're already an iPhone developer... why not combine the two? You can have a very advanced configuration utility that is easily configurable just by getting the iPhone involved. It sounds like something that I can probably do quite simply really. Some of the setup might be kind of manual, kind of broken, kind of specific... but why not?

plamberti
Posts: 34
Joined: 14 years ago

#2: Post by plamberti »

Seems interesting; a full operating system and a network connection gear up for cool ideas... I was looking for something like this as well, even if they are an overkill for a temp control IMO.

What kind of board/processor/manufacturer did you used?
How does your diy board interface with the main board?
Can you post schematics of the additional board and source code?

Pierluigi
Pierluigi

randytsuch
Posts: 502
Joined: 15 years ago

#3: Post by randytsuch »

Interesting idea.

I was thinking about building an Arduino based PID for my machine, but I may upgrade machines before I get to it. I was thinking of the more traditional Display and push button interface approach, but a WIFI interface to a iphone would be cool. It's beyond my capabilities, but I wish you luck in this project.

Randy

napierzaza (original poster)
Posts: 221
Joined: 13 years ago

#4: Post by napierzaza (original poster) »

Currently I'm using a Meraki Mini. It's an Atheros based system that has one G wifi and a ethernet cable.

Main qualities:

1. About the size of a deck of cards.
2. Has 7 usable GPIO pins sticking straight out of the board. Regular pin headers! Other APs have you removing LEDs and capacitors all over the board to find them.
3. Serial header coming right out the board that includes GND and 3.3 volt.

They're really cool, but unfortunately last week they announced they'd be phasing out this product. I wanted to use it for some other small stuff in the future, but unfortunately not.

As for the source and schematics, I plan on making it GPL. It's just still quite messy. I can't get the gpio for controlling the SSD work properly, and there are a few details about the circuit board which are perhaps, undesirable.

But if you're interested I can do it.

As for the benefits, I'm looking forward to setting a timer on my machine. A real easy-to-program one. From here the sky is the limit in my opinion. I'm going to hook it up to my machine to at least monitor in the next few days.

napierzaza (original poster)
Posts: 221
Joined: 13 years ago

#5: Post by napierzaza (original poster) »



Update: I now have the mini connected to my machine with a thermocouple going inside the case. I've compared my measurements to some info about the Silvia online, and my machine is going between 95F and 251F so that seems pretty similar to other peoples information.

Some annoying stuff with setting up wifi on it, but my house has cat6 so for now that's not an issue. I have to figure out how to get it working as a client on my network, they're built to be hosts. :-\

Cleaned the code up a lot, I had done some funny stuff because of my earlier troubles with the development. So far I'm slightly worried about a failsafe in case the daemon is quit or crashes and leaves the element on.

In fact, brief Todo:
- Failsafe
- Functional daemon support
- Being able to feed it settings
- iPhone/web interface
- Probably more!

napierzaza (original poster)
Posts: 221
Joined: 13 years ago

#6: Post by napierzaza (original poster) »

Update. I've been refining the system quite a bit. Had some coffees with it too. I'm a little uncertain in regards to how I can calibrate the system without a accurate thermometer. So I might have to do something about that.

But it is functional, and I have just set up some cron timers so that it turns on for me in the mornings, a different time for the weekdays and different times on the weekend.

napierzaza (original poster)
Posts: 221
Joined: 13 years ago

#7: Post by napierzaza (original poster) »

Okay wow. I'm pretty sure this is some of the mildest Epic Espresso I've ever made. I've never had brew water this cool coming out of my machine. It's funny because I always noticed that I could drink espresso immediately at my local cafe, but always had to let it cool a little when from my Silvia. Hopefully not anymore.

User avatar
jknotzke
Posts: 101
Joined: 13 years ago

#8: Post by jknotzke »

Have you thought about using an Arduino as a main box to start ?

It's perfect really for this type of thing. I have one that I coded that essentially acts as a timer to turn on and off my espresso machine at certain times of the day..

Also take a look at Sparkfun.com. They have really user friendly parts..

J

napierzaza (original poster)
Posts: 221
Joined: 13 years ago

#9: Post by napierzaza (original poster) »

Not sure what you're talking about. The system is programmed, installed, and working.

I just have to SSH into the router to do any special tasks.

I now have a PID, logging, timed activation etc.

It works.

EDIT: In addition to that, it works better than a Arduino device. It already has a complex date system, so the machine comes on at different times on weekdays and weekends. It can easily log a week of data and I can easily access the information remotely. etc. I just need to do some tuning which would be the same issue with an Arduino or even a stock PID bought anywhere.

In the future it can only become even better. If I had done Arduino, which has been done a dozen times, I would have wasted my time with its limitations.

User avatar
jknotzke
Posts: 101
Joined: 13 years ago

#10: Post by jknotzke »

It really was just a suggestion.

Arduinos are cheap. They are also very easy to program. You had mentioned that cost for you was an issue and that programming in Linux was also difficult.

I come from a background of both. I've also done my fair share of Linux and Embedded programming on various platforms. I've also hacked several Arduinos.

My suggestion, was only a suggestion. If your solution works well for you, then that's fantastic. I know full well that achieving something like this is really rewarding.

So Kudos to you for having pulled it off.

J

Post Reply