Arduino Development Thread

Australia & New Zealand Homebrewing Forum

Help Support Australia & New Zealand Homebrewing Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

bonj

Premier Ipswich Mash Proponent (PIMP)
Joined
1/12/06
Messages
2,816
Reaction score
13
I got my arduino reading my DS18S20+ temperature sensors today.

Let's put all the arduino based stuff in here, and give Zizzle's thread a break.

I'm looking forward to seeing what others come up with. (randyrob)

If you're after a cheap board, check out the "Really Bare Bones Board". Probably as cheap as they come, but don't forget a USB to serial cable with it :p
 
Some Arduino and Temp sensor links:

DS18B20 (parasite power only) AUS$4.15ea : Modtronix (AU) (Also check for analog sensors, such as LM35 for around AU$1)
DS18B20 AUS$6.50ea : Microzed (AU)
DS18S20 (powered or parasite) AUS$12ea : Ocean Controls (AU)

Really Bare Bones Board (and other stuff including blue LCDs): Modern Device Co. (USA)
Australian Distributor for official Arduino Diecimila boards (note: GST NOT INCLUDED IN PRICE): Little Bird Electronics (AU)
Various breakout boards: Sparkfun Electronics (USA)
Arduino Website (inluding the playground, and forum which are a wealth of information for interfacing devices): http://www.arduino.cc/
Various Arduino boards, shields and breakout boards: Adafruit Industries (USA)
 
Nice Work Bonj

The World Famous Index of Arduino & Freeduino Knowledge --> http://www.freeduino.org/

FREEDUINO (Arduino Compatible) Products --> http://wulfden.org/freeduino/freeduino.shtml



i'm going to go with the RBFK (Rock Bottom Freeduino Kit) for the prototype of HABS (Halfluck Automated Brewing System!)

Rob.
Sounds good. I noticed that the freeduino and the really bare bones board are the same thing, jointly developed.

Don't forget to get either the USB cable with FTDI TTL chip in it, or the RS232 serial programmer. Can't program the sucker without one of those.

I like the look of the freeduino/RBBB and they're quite cheap if you buy them in bulk. I can forsee buying a few of them for different projects.
 
Interesting little script for the mash logic, however....Its basically an on/off script, turning the heater off once mash temp is reached. This is the same logic I originally had in my VB software to drive my RIMS system, but found that overshoots over 4c or more were recorded based on that logic.

I have since put some steps in that start pulsing the relay that controls the heater elements, the closer to temp its reached, the further apart and the shorter the pulses are. Kind of emulating a PID, but nowhere near as accurate, right now I have it down to about a 0.5c overshoot, but if its less than 2c till desired temp, it ramps to final temp very slowly, so I need to change the software a bit more!

Just something to think about when writing yours!
 
By pulsing, I'm assuming you mean like a slow pulse width modulation? eg. 50% duty cycle would be something like on for 1 second, off for 1 second.

An interesting idea. I'm guessing that a 50% duty cycle would get you less than 50% power due to the lag in heating the element.
 
By pulsing, I'm assuming you mean like a slow pulse width modulation? eg. 50% duty cycle would be something like on for 1 second, off for 1 second.

Exactly, I have about four bits of logic that test how far away from set point it is, based on that it turns the relays off for a % of the time till the next sample.

Using Google at the moment to find a decent bit of PID logic, found some, but it assumes a variable power output control, ie 50% of 1000watts. I suppose this could be translated into 50% of time till next sample???

I think getting some good PID software going would be the bees knees for us software writers over buying a PID unit!
 
I wrote an article on my HERMS for Circuit Cellar magazine a couple of years ago. The source code is available here. The file you want is Nesdoly-191.zip. I implemented a PID algorithm from scratch. The source code is in CCS C and shouldn't be too hard to figure out. PM me with your email address if you want a copy of the article - it may help to figure out the code.

I used PWM to cycle the heating element. To make the math easier, I used a 0 (off) - 63 (full power) scheme. Those of you familiar with binary will understand why. This number translates to a heating drive that varies from no (0) AC mains cycles up to 63 mains cycles. Because the mains are 60Hz here, this is roughly once per second. I chose to limit the smallest time quanta to integer multiples of the mains to eliminate EMI. I used a solid state relay to actually drive the heating element. You don't have to worry about any lag in the heating element.
 
I wrote an article on my HERMS for Circuit Cellar magazine a couple of years ago. The source code is available here. The file you want is Nesdoly-191.zip. I implemented a PID algorithm from scratch. The source code is in CCS C and shouldn't be too hard to figure out. PM me with your email address if you want a copy of the article - it may help to figure out the code.

I used PWM to cycle the heating element. To make the math easier, I used a 0 (off) - 63 (full power) scheme. Those of you familiar with binary will understand why. This number translates to a heating drive that varies from no (0) AC mains cycles up to 63 mains cycles. Because the mains are 60Hz here, this is roughly once per second. I chose to limit the smallest time quanta to integer multiples of the mains to eliminate EMI. I used a solid state relay to actually drive the heating element. You don't have to worry about any lag in the heating element.

Is the mains drive preset at 0-63 or could it be modified for a 0-50 to suit our power? Why is it 0-63 and not 0-60?

If you use a zero crossing SSR then doesn't that take care of the EMI caused by power switching regardless of what the logic is telling the SSR to do, it won't switch until it is at zero?
 
I chose 0 - 63 because that's 6 bits and is easy to handle on an 8 bit processor. It also happens to correspond to roughly one seconds' worth of AC waves and that's the primary reason I chose it. Yes, you can modify the code to correspond to 50Hz power.

I don't know what I was thinking when I mentioned EMI before. Yes, you're right - the SSR I used is a zero-crossing type, so EMI is irrelevant. I think I got confused with another project I've done. Sorry about that.
 
Nice article. I havent looked through the code yet. I use commercial PID units from auberins. They have a setup function on them that measures and records the temperature increase/decrease and times and then sets the P, I and D. this is done in-situ and provides real world values and gives a great starting point of the values. It also means that if I change the setup, like install hose insulation, I re-run the setup and it provides new values based on the modified heating system.

I wonder if you could incorporate a setup function in your code that measures and records the systems heating capability and the effect that whatever number of descrete pulse trains has on the system. This could be made to provide (if needed) different P, I and D values around the common mashing temperatures.

Just some thoughts.
 
I've just discovered something interesting.

I have three DS18S20 chips on powered mode.
I have discovered that the DS18B20 chips return 12bit temperatures (.0625 degree precision), whereas the DS18S20 only returns 9bit (.5 degree precision).
edit: The DS18B20 can be powered. They're also still only accurate to within 0.5 degrees, they just have a higher precision measurement.

I may have to get some of these DS18B20's to test them out.
 
The setup/learn capability is possible, but I never really investigated it. This system worked for me right off the bat, so I left it as it was. I remember looking into the basics but that was it. The biggest key to this thing's success was the excel spreadsheet that I developed to predict the system response. It's part of the package available on the CC website.
 
FTP is blocked at my work site, so will have to download it later :(

But, I might just add this code to my VB source and dump the parameters to a file so I can at least see how it modify my SSR output... http://www.jashaw.com/pid/code.htm

Sorry Bonj, did not mean to hijack your thread with software design issues!
 
FTP is blocked at my work site, so will have to download it later :(

Sorry Bonj, did not mean to hijack your thread with software design issues!

Blocked here as well. NEwguy emailed it to me, if you can't raise him, PM me with your email and I will forward it to you.

Sorry for hijack Bonj.
 
No need to apologise fellas. Software design is as much a part of the development as the hardware is. I'm a software guy, so much of the hardware stuff is learning for me.

Anyway, an update by way of photos.

Arduino Diecimila and 2x DS18S20's on the breadboard. (The third is in a pre-production thermowell (no photo, sorry)).
arduino_1.jpg


LCD readout for an as yet fictional HERMS system.
arduino_2.jpg
 
Great thread guys.

I'm pretty sure I have DS18S20s in my rig and get better than 0.5 degree accuracy.

The DS18S20 data sheet says:

"Resolutions greater than 9 bits can be calculated using the data from the temperature, COUNT REMAIN
and COUNT PER C registers in the scratchpad."

Brad and I also implemented the PID algorithm in C for our brewbots. The algorithm itself is pretty simple, it is tuning the parameters to your system that is harder.
 
Great thread guys.

I'm pretty sure I have DS18S20s in my rig and get better than 0.5 degree accuracy.

The DS18S20 data sheet says:

"Resolutions greater than 9 bits can be calculated using the data from the temperature, COUNT REMAIN
and COUNT PER C registers in the scratchpad."

Brad and I also implemented the PID algorithm in C for our brewbots. The algorithm itself is pretty simple, it is tuning the parameters to your system that is harder.
I've been using DS18B20s with picaxes for a long time now and while the specs are something like +- 1 degree over the range, they can read to several decimal points. I've calibrated them against known references and they seem to stay calibrated. I'm confident I can really tell the difference between 67.0 and 67.1 in my mash - but the calibration at the desired temp is important.

cheers, Arnie
 

Latest posts

Back
Top