char1es.net

musings of a peripatetic

Lesson 4: Hoto pare bristi hoi

It’s storm season. It’s almost over from what I understand, but we’re kind of on the edge of the end of storm season and about to move into the rainy season. During storm season localized thunderstorms spin up and create mischief before moving on. For me these storms are quite welcome because it cools things off, but it also tends to knock over rice and ruin crops so it’s a mixed blessing. Today we had a nice little storm. I was in my Bangla lesson in the library when the power went out. Now the library is the only room in the office that has AC. It’s been hot. Really hot. I don’t think that I’m suffering as much as some of the other poeple around here, but it has made for some uncomfortable nights. Especially when the power goes out… which it does… a lot. It makes the library a nice place for a Bangla lesson. It doesn’t have any windows though, so when the power goes out, it’s time to leave.

We haven’t had rain for a week or so and I was surprised to hear rain as I walked out the door. I went out to the office door way to watch the rain. There’s a huge mango tree right outside the office. It’s branches almost reach to the roof of the 5 story MCC office here in Bogra. It’s quite startling when a mango falls 5 stories onto the tin roof of the storage shed in the middle of the night.

We’ve had some service worker staff changes recently. Daniel is the newest MCC service worker in Bogra although he was actually born in Bangladesh so he’s sort of a special case as service workers go. He’s obsessed with fruit and is always buying “litchu o am” (litchi and mangos) this is nice because it means there is generally fresh fruit around. Amar litchu bhalo lage (I like litchi.) I don’t think I’ve ever had them in the states, but they’re a little spiky round fruit that you peal and eat. They’re quite juciy, a bit like a grape and there’s a large seed in the middle that you have spit out afterward. Anyway, so it’s raining and gusting, mangos are dropping out of the trees and a bit of a competition gets started to see who can find and eat the most fallen mangos. Daniel’s going over the roof’s, the office staff scurrying around the yard and a few children are trying to come over the roof cause they think they can take mangos since it’s raining and no one will stop them. I had 4 and apparently I didn’t do so well, but it’s good enough for me and I was well sated.

I love rain. I’m a bit curious to see what rainy season is going to be like, whether I’ll get tired of the rain or not. I’ve heard that it’s not as hot, but that the humidity stays up close to 100% all the time. I’ll miss a good chunk of it though, because I’ve just bought a plane ticket to go back to the states for my brother Michael’s wedding in July. Since it’s a long flight I decided to take some vacation while I’m there… Hoto pare brishti hoi. (Maybe it will rain)

1 Comment
- ❦ -

Low cost data logging with Arduino

I’ve been wanting to play around with an Arduino for a while, so I bought a Duemilanove without a set goal in mind. Recently I’ve been working with Solar thermal and I needed to measure several temperatures simultaneously so decided this would be as good a project as any. I bought some “4700 ohm” thermistors and hooked them up with some other 4700 ohm resistors in a voltage divider configuration. The output of which is hooked up to the analog inputs on the Arduino. I found a Thermistor Example in the Arduino playground which I had to modify somewhat to make work with my configuration. I was confused for about a day as to why my thermistor equation T=\frac{\beta }{\ln \left ( \frac{R_{T}}{R_{25C}}\right )+\frac{\beta}{298.15}}-273.15 was giving me garbage. After doubting my ablity to do math pretty severely I finally figured out that my math was indeed correct and as it turns out the “4700 ohm” thermistor package was incorrectly labeled and were actually only 470 ohm. Anyway, I modified the code so it would work with my thermistors and pass multiple temperatures back across the serial line.

Arduino Thermistor Sketch

Then I wrote some quick and dirty python code to read the values coming off the serial line and write it to a csv file which I could open with OpenOffice.

import serial
import time
ser = serial.Serial('/dev/tty.usbserial-A6008dxP', 9600, timeout=1)
logfile = open('test.csv', 'a')

while 1:   # read a 'n' terminated line 
   line = ser.readline()   # read a 'n' terminated line
   if not line:
      break
   words = line.split()
   now = time.strftime("%d/%m/%Y %H:%M:%S", time.localtime())
   a =  "%s, %s" % (now, line)
   if line.find(',') != -1:
        logfile.write(a)
        logfile.flush()

logfile.close()
ser.close()

The resolution isn’t that great because the inputs are only a 10bit ADCs but it’s more than enough to get trends. Without a more accurate thermometer, I can’t tell for certain how accurate it is, but as far as I can tell it reads faster and more accurately than the mercury thermometer we have. In university I would have done this with a fairly expensive LabVIEW system. The impressive thing is that I can get good enough information for what I need with Python and less than $30US in parts including the Arduino.

No comment
- ❦ -

It’s about to get Hot!

The weather will be sunny ...

The weather will be sunny ...

No comment
- ❦ -