Monday, October 10, 2011

Hot plate PI controller - Part 2: The temperature sensor

The thermometer I am using is the typical stove thermometer that you can buy from any kitchenware store. Mine came with our IKEA / Whirlpool kitchen stove.



I have no idea of the resistance of the thermistor probe that came with the thermometer so I had to set up a little experiment to find the resistance range.

I put 1 litres of water in a pot on an induction plate, turn on the heat for a while, turn it off to let the temperature settle and then measure temperature with the thermometer. Next I measure the resistance with a multimeter.

With four measurements I got this curve:


Excel shows the fitted linear curve and the nice little formula:

Rt=0.2*T-2.7

Where Rt is the termistor resistance and T is the temperature measured in centigrades.

I want to use the thermistor with a resistor and measure the temperature by setting them up as a voltage divider. Input voltage will be 5V:


By setting the second resistor to the value of 5 ohm I get the greatest difference between the lowest and highest measured voltage (2,85V) and thus the best resolution. The curve for voltage measured over the thermistor for the optimal resistor is shown below: 


Defining:
F=Vout/Vin=Rt/(Rt+R)

Calculating for Rt:
1) Rt=R*F/(1-F)

From previous excel linear fitting for measured temperature:
2) T=(Rt+2.7)/0.2

1) and 2) put together:
T=25*F/(1-F)+13.5, where F=Vout/Vin

Finishing with an example:
What is the temperature when you are suppling the voltage divider with 5V and you get an ADC reading is 511?

A reading of 511 in the ADC is a measured voltage of 5V*511/1023=2.5V with a supplied voltage of 5V.

F=2.5V/5V=0.5

T=25*F/(1-F)+13.5=25*0.5/(1-0.5)+13.5=38.5 degrees celcius, which corresponds very well with the curve above.


The real excitement begins when I get a 5 ohm resistor, set up a measurement system and start measuring realtime temperature data. Is boiling temperature still measured to 100 degrees celcius?

_____________________________

Update:

Yesterday I tried setting up the voltage divider with the arduino. I found a 4.7 ohm resistor to use with the thermistor and was ready for measuring temperature with the arduino. 

I had thought very little about the consequences of using such small resistors: When I hook up a 4.7 ohm resistor with a thermistor that has close to zero ohm resistance at room temperature I get a current of 5V/5ohm=1A!! So when I set up the bridge and inserted the USB I got smoke coming out of the arduino or resistor. The arduino seems to be working fine afterwords, though, so I learned my lesson.

So I should rather find a resistor that has as low as possible reistance, without destroying the arduino. How low can it be?

Here are some of the limits:
- The USB 2.0 standard has a maximum current limit of 500 mA. 
- In the summary for the arduino UNO the I/O ports are rated for 40 mA. 
- In the data sheet for the Voltage regulator (LM340) I see a maximum current of 1 A at 5 V.
- I think the resistors I am using is 0,25 W type based on the thickness => Maximum current 50 mA.

I think the input impedance of the ADC pins are quite high, so there will not be much current going through to the ADC. That makes the resistors I am using the weakest link with maximum current 50 mA.

My new resistor will have to be at least 5 V / 0.05 A=100 ohm.

The new temperature chart will be like this:

The voltage range is too low, which means I get bad resolution (about 0.7 deg C) . I either need a different thermistor or a resistor with higher power rating.

In summary: Don't try to reuse the measurement probe from a thermometer. It's cheaper and easier to buy a thermistor with an available datasheet.

Hot plate PI controller - Part 1: The start

I want to make a hot plate controlled by a PI controller. The reasons are primarily to master the PI controller practically with the bonus of being able to control the boiling process when making home made beer.

Yesterday I boiled my first batch of wort and got the feeling of what it takes to control the temperature with several liters of wort (about 30 litres) on a small 1,5 kW old fashioned hot plate. The process was pretty slow, so it is absolutely possible to control it manually, but I want to set it at a specific temperature and let a home made controller do the rest of the job.

The parts I want to use for the project is:

  1. Controller: An old Arduino NT that I got lying around. This will be permanently used for brewing purposes in the future.
  2. Actuating element: A 1,5 kW hot plate of the old kind with built in on/off controller and stepless adjustment of power.
  3. Actuator: A 180 degrees adjustable Hitec HS-325HB RC servo for attaching to the power knob.
  4. Temperature sensor: A termistor type termometer that I want to reverse engineer and use the probe from.

Wednesday, January 05, 2011

How to set up VirtualBox shared folders with Windows 7

Start by adding shared folders in settings before starting the VM:

Next install guest additions after windows 7 VM has started:

If you are using autoruns you will be asked to install guest addition. Otherwise open the cd rom drive and run installation. You will be asked to restart the VM when finished.

After restarting you should now find your shared folders under Network\VBOXSVR within the Explorer (windows key+E).

Tuesday, April 13, 2010

How to change payment information in itunes when caught in an endless loop

I have been sufferig the latest couple of week by not being able to change my billing information in either iTunes or directly on my iPhone. I kept trying to change my old credit card info to a different card or setting the payment method to none, but every time I returned to my payment information nothing had changed. A message allways appeared in iTunes stating that "there were errors or omissions". I was unable to buy anything from iTunes or update apps on my Iphone.

The solution: I am currently an iphone developer and opened my web browser to developer.apple.com/iphone. I then resent my programmer status and contact information and accepted the latest agreement from apple. I suddenly was able to change my billing information to whatever I wanted.

Monday, January 11, 2010

Valg av varmeløsning

Jeg har i den siste tiden hatt mye å tenke på angående hvordan vi skal varme opp det nye huset vi skal bygge. I den siste tiden har det dessuten vært en glohet diskusjon angående varmekilder, noe takket være den kalde perioden vi har vært gjennom nylig.

Til å begynne med ble jeg svært fristet av å installere en vannbåren varmeløsning, med varme i alle golv i begge etasjene, totalt 190 m^2. Jeg har blant annet hørt om denne fantastiske lunheten man får med bruk av rørlagt vann i gulvene.

Vi ba utbygger om å komme med pris på luft-vann varmepumpe og vi fikk prisantydning på ca 170000, noe jeg personlig synes var styggdyrt. Etter å ha sett på NRK og FBI fikk jeg høre at prisen på strøm antagelig ville øke med 25% de neste ti årene. Jeg antok at merkostnaden for ei bergvarmepumpe kommer på prisen for borring, kanskje 50000. Jeg ønsket dessuten å sammenlikne med ei habil luft-luft varmepumpe på 25000. Pellets eller sentral vedfyring ble først vurdert, men disse falt bort da vi ikke har kjeller eller plass til silo for disse løsningene.

Etter å ha gjennomgått energikalkylen for vårt planlagte hus (205 m^2 BRA) hos energimyndigheten.se fikk jeg mengen energi som kunne spares for hvert år. Med beregnet prisøkning for strøm fikk jeg følgende kurver:



På kurven ser vi at det tar ca 4 år å spare inn en luft-luft varmepumpe, 12 år for luft-vann og 14 år for vann-vann. Det tar dessuten ca 20 år før alle løsningene er like lønnsomme. Dette forutsetter selvsagt at anlegget holder i hele perioden. De beste garantiene for varmepumper gjelder for 10 år, så du skal være heldig dersom pumpen varer en hel investeringsperiode.

Etter en prat med utbygger i dag ble jeg til slutt overbevist: På grunn av den nye byggenormen av 2010 vil huset være svært godt isolert og ventilert. Gulvene vil også være lune. Med elektriske panelovner på alle rom og varme i golv på bad og vaskerom burde vi ha et hus som er lett å holde passe varmt. Vi vil dessuten installere en god ovn med gratis fyring og evt en luft-luft varmepumpe dersom vi ser at strømforbruket blir høyt allikevel.

Friday, January 01, 2010

Mini review of "The Power of LESS" by Leo Babauta


Personal productivitiy systems have been very popular the latest years, kickstarted by David Allen's massive success "Getting Things Done". The book probably made Allen a very rich man and started a cult of GTD followers. Every follower had their own little twist of change to what Allen wrote in his book and websites and blogs like 43 folders and lifehacker introduced readers to new systems on how to adapt to GTD. Leo Babauta also started his own site Zen Habbits where he wrote about his own experiences with GTD.

I first found Zen Habbits about a year ago, when I was looking for other GTDers stories about how they made GTD work for them. I had been an avid user of the system about two years then, and was looking for a new GTD software system to change to.

Leo Babauta identified some flaws with Allen's orignal system. The most important ones being the lack of priorities amongst different projects and thus the lack of focus on each individual task. Even though Allen have suggestions for selecting projects based on long term goals and a "someday maybe list" for those projects you cannot work with right now, he never seem to mention anything about minimizing the amount of simultaneous projects and reducing the number of tasks you are saying yes to. I think Leo Babauta is into something when he asks you to limit yourself to the essentials in order to get the maximum out of everything you do.

Ok, so I was about to tell you about feelings about the book "The Power of Less". It would be impossible to write something about it without the former introduction. If you allready are a user of GTD today I would say that you can find everything extra you need to know from reading the most important articles at Zen Habits. I have a slight feeling that some of the articles might be word by word the same as on the web site. If you are new to GTD or don't know about Zen Habits on the other hand, I would highly recommend you pick up the book and start reading. It is a quick read (about a day for me) and adds good wisdom in today's fast lane society.

Tuesday, December 29, 2009

Mini review of "Brain Rules" by John Medina



I am not sure how I came across the book "Brain Rules" by John Medina, but I had put it on my Christmas wish list and got it as a gift. My hopes before starting reading it was that I was going to pick up a few tips and be inspired to change my ways of doing things in a more brain friendly way.

The book chapters are sectioned in what Medina calles "brain rules" or principles of how the brain is working. The chapter titles are exercise, survival, wiring, attention, short-term memory, long-term memory, sleep, stress, sensory integration, vision, gender and exploration. The actual brain rules for each topic can be found on medinas site: http://www.brainrules.net/. The videos on the site are quite good for catching the essence of each rule too and for repetition as well.

Each chapter usually uses plenty of examples of how the brain is working, usually experienced by the author himself. The examples are coupled to brain research and brain anathomy in a humorous way. At the end of each chapter Medina has a few ideas on how the brain rules can be put to practical use.

Many chapters are quite captivating and I found myself fascinated on how complex the brain actually is. The most important points I picked from the book are:

  • Learning is better done while exercising. Try to combine the two if possible.
  • Create strong pictures when you really want to remember things.
  • Teach and learn in periods of about 10 minutes at a time. The brain loses attention and gets bored after this time.
  • Recreate the environment of where you learned something when you want to recollect it.
  • Understand every word in a sentence that you want to understand.
  • In a presentation: Catch the audience's attention at an early moment.
  • Use plenty of examples when you want to explain something.
  • Multitasking is a waste of time.
  • Learn by doing. The brain is an expert at adapting to new tasks.
  • The best way of really learning something: Repeat every 10 minutes for three times and then repeat the most important things every 3-4 days.
  • Get sufficient sleep.
  • Avoid long term stress. Ask the question "am I in control?" if you are not sure if you are stressed.
  • Strengthen learning by using many senses at a time.
  • Your learn much by watching pictures in combination with relevant text, but more with narration and videos.
  • Reduce the amount of text in powerpoints - The brain is lazy and avoids reading text.
  • Vision is the most powerful sense and actually uses half of the brain's processing power.
  • Women capture the emotional details while men see the gist when experiencing acute stress.
So was the book worth reading? I think it was ok reading the book, but I think Medina got a little to detailed for my taste. I never wanted to be a brain scientist. I got what I wanted in the end: some great techniques for improving learning backed up with science. I will put it to practise - no doubt about it.