Project 365 – Day 155
January 9th, 2011Project 365 – Day 154
January 9th, 2011Arduino
December 12th, 2010This is my first winter in my new place. I’m finding the living area difficult to keep warm. I wanted to get an idea of how the temperature changes in my living room throughout the day. I decided to build a simple thermometer that would sample and record the temperature.
I purchased an Arduino starter kit from RobotShop.ca. The kit came with an Arduino UNO board, the serial->USB cable, power adapter, and a small breadboard. I also purchased a temperature sensor. I wasn’t sure which board to get, so I went with the starter kit. The board has various features such as a few analog and digital inputs/outputs and an LED.
The initial setup was amazingly simple. I followed the getting started guide, and it all went according to plan. The Arduino appears as a serial device on my Mac. Within minutes, I had a sample script running on the Arduino that would toggle the LED every second.
The temperature sensor is a DFRobot LM35 Linear Temperature Sensor. It has three pins: power, ground, and signal, so it is super simple to connect to the board. However, this sensor has a JST connector for the pins, so it isn’t as easy to connect to the board as a sensor with three bendable legs. I ended up buying a DFRobot analog sensor cable which had a JST connector on one end, and three female headers on the other.
Once the temperature sensor was connected, I wrote a script to read the signal from the sensor and write the temperature. There is a serial console in the Arduino software, so you can see what is being written to the serial port.
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.println((analogRead(A0) * 500) >> 10);
delay(1000 * 10);
}
This snippet reads from the analog pin, does some math on the value, and writes it to the serial port. This is done every 10 seconds. I verified that is was working correctly by looking at the output using the serial console.
Now I wanted to read the data from my computer. I installed the py-serial Python module on my Mac. The interface is simple: blocking and non-blocking calls to read a byte at a time. Sort of a very simple socket-like interface, without nice things like reading a line at a time. My Python script would read ten values, calculate their average, and then send the result to a web service. The web service stored the data points and created nice graphs using the Google Charts API. Using this service, I was able to see how long it took my living room to heat up and cool down.
There are lot of possibilities going forward. It would be cool to build a smart thermostat. One that knows how long it takes to heat my living room, and can be smarter about the schedule; perhaps it can get hints by learning my routine, or by reading my availability from my calendar, or I could give a hint using an Android app by saying “I’m coming home at 9 tonight, I want the place to be 20 by then.”.
The ultimate end goal would be to be able to control various aspects of my home using my phone; the TV, the heating, and the PS3.
POP Montreal
September 29th, 2010Midnight Poutine is doing a marathon of podcasts this week for POP Montreal events. I only recently started to listen to Midnight Poutine, and I think it’s great. Minimal chatter, great music.
I’m listening to the podcast right now, trying to figure out which show I want to see tonight.
Pakora Recipe – Draft
August 24th, 2010I’m visiting the family this week in British Columbia. I learned how to make butter chicken from my mom during one of my previous visits. This time, I’m determined to learn at least two more recipes. I require detailed instructions and quantities, whereas my mom works without a written recipe or measuring cups. I’m more like a scientist in a lab, measuring liquids as precisely as possible, and she’s more like a magician.
Here are some notes I took while helping her make some Pakoras. She was making a huge quantity, so I’ll have to work on the numbers later.
- Potatoes, thinly sliced
- Cut up spinach
- Onion, long and thin
- Little bit of ginger
- Cumin seeds
- Salt and pepper.
- Chickpea flour – called “Channah”
- Little bit of baking soda
- When the wet stuff is ready, add some yogurt and ketchup.
- When making the potato balls, try to make them with two potatoes and whatever other goodies you can get into them (spinach, onion, etc).
- Big pot of vegetable oil
- Add one potato ball to the oil, wait for it to rise, then start adding more
Project 365 – Day 153
July 9th, 2010
Project 365 – Day 152
July 9th, 2010
Project 365 – Day 151
July 9th, 2010
Project 365 – Day 150
July 9th, 2010
Project 365 – Day 149
July 9th, 2010



