Month: September 2011

My experience of Win8 on VMWare workstation 8

I followed this blog to install Win 8 on Vmware workstation 8.0 (30-Day-Trial)
http://www.kunal-chowdhury.com/2011/09/step-by-step-tutorial-to-setup-windows8.html

Only issue i faced during installation was Vmware asking for product key, to work round that you can select install the operating system later option. That worked like a charm.

Moving ahead, this time i choose to use my live id instead of creating a local account, it was little slow but not a big deal.

After logging in, I faced couple of issues

1. Metro apps do not respond to click
2. Green screen appears after accessing metro app

I have seen #1 on my colleagues box, did a search and found these are known issues:

http://social.msdn.microsoft.com/Forums/en-US/windowsdeveloperpreviewgeneral/thread/cc30d822-042b-4873-9817-3947df7db717

For # 1 workaround is to reduce the resolution to 1024 by 768 for #2 increasing the UAC to one higher level resolved the issue.

Thats it i have for now, if you have better solution for these two issues, please post

Twittering weather station using Arduino and C#.net

This is my first post on Arduino that I purchased recently. In this project I am capturing temperature information using LM 35 sensor and tweeting it through a .net program.

This is my how my weather station looks like in twitter:

Twitter

To set this up you will need following hardware and software

1. Arduino Uno Board, three wires, bread board and a USB cable

2. LM35

Software :

1. Visual Studio (express will also work)

2. TweetSharp library

Essentially you need these things to talk with each other.

1. Setting up LM35 sensor on Arduino board.

2. Arduino program that writes to serial port.

3. .Net program that reads from serial port.

4. TweetSharp library to tweet the temperature information.

I would say implementing above three was not difficult, most of the code is already available as a form of sample code in web.

Let me try to explain step by step in case you any one wants to try this:

Setting up LM35 sensor on Arduino Board

A search on web and you will find lot of articles showing how to set up LM35 on breadboard.  This is how I set this up.

Arduinotmp36pinout

You need three wires, one for connecting to ground in Arduino Board.  Second to 5Volt voltage input on Arduino Board and third for connecting to Analog Input.

Arduino Program to write temperature to serial port

I used following program to write temperature information to serial port, its easy to understand and calculates value in both Celsius and Farenheit.

http://www.danielandrade.net/2008/07/05/temperature-sensor-arduino/

image

.Net program to read serial port data

System.IO.Ports.SerialPorts is the class which reads serial data.  If you are using Winforms then you can simply drag and drop the SerialPort from toolbox. This is how you can use serial port to read data

a) Declare the serial port

private System.IO.Ports.SerialPort serialPort1;

b) Initialize

private void InitializeSerialPort()
{
this.serialPort1 = new System.IO.Ports.SerialPort();
serialPort1.PortName = “COM7”; // In my system Arduino is on COM7 port
serialPort1.BaudRate = 9600;
serialPort1.Open();
this.serialPort1.DataReceived += new System.IO.Ports.SerialDataReceivedEventHandler(this.serialPort1_DataReceived);
}

c) Read the serial port data in data received event

private void serialPort1_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e)
{

temperatureReceived = serialPort1.ReadLine();

}

Tweeting the temperature to your twitter account

If you are able to read data through serial port then next thing to do is to tweet your results.  These are the steps required to set up twiiter application and development environment.

1. Login to you twitter account in twitter developer portal

http://dev.twitter.com/

2. Go to my applications and create new applications

3. Fill in the required information to create the application

4. On the details page click on “Create my access token”

image

because twitter requires OAuth authntication you need to copy paste values from settings screen to appsettings of you application.

<appSettings>
<!–Keys for OAuth authenticiation–>
<add key=”ConsumerKey” value=”ConsumerKey”/>
<add key=”ConsumerSecret” value=”ConsumerSecretValue”/>
<add key=”AccessToken” value=”AccessToken”/>
<add key=”AccessTokenSecret” value=”AccessTokenSecret”/>
</appSettings>

There are lot of libraries available to tweet using .net, after trying couple of libraries I found TweetSharp to be very straight forward.  Here is the link to download TweetSharp

https://github.com/danielcrenna/tweetsharp

I followed this blog to set up the c# code required for tweeting.

http://geekswithblogs.net/TarunArora/archive/2011/06/19/tfs-2010-sdk-integrating-twitter-with-tfs-programmatically.aspx

Once you have set up the source the last thing to do is tweet the temperature value, here is the code.

private void Tweet(string currentTemperature)
{
twitterService = TwitterProxy.ConnectToTwitter();
var result = twitterService.SendTweet(String.Format(“The current temperature in my home is {0} degree celsius, – Bangalore, India : {1}”,
currentTemperature, DateTime.Now));
}

After doing this you should see the temperature posted on your twitter account, you can modify this program to send direct message instead of tweeting.

Possibilities

I feel this is a basic and a good project for getting started with Arduino and your first step to InternetOfThings.  These are various ways I can think off to enhance it, if you have some more geeky ideas, I would love to hear them.

1. Plot a graph for temperature changes and post it live on web.

2. Make Arduino Wireless and let it talk to a system directly.

3. Attach a display to Arduino to show the current temperature.

4.Once the temperature has reached below a certain limit (<24), make sounds, blink LED’s… etc.

5. Display location information by converting your IP address to location or you can also attach a GPS with Arduino.

Installing Windows 8 Developer Preview

After hearing the news that Windows 8 developer preview is available I downloaded the iso file from MSDN web site.  I was interested in installing it on a Virtual Machine, it always allow you to switch between your guest machine and host machine quickly.

I already had VMWare workstation installed on my box, my first attempt was to install the iso using workstation however it failed due to error :  “vcpu-0:NOT_IMPLEMENTED”  error. A quick search on web and I was able to find that Vmware workstation will not work.

Lot of forum posts suggested VirtualBox, using that installation was straight forward.  You can follow this article and you should be up and running.

http://www.addictivetips.com/windows-tips/how-to-install-windows-8-on-virtualbox/

194774_205800656153765_100001714959125_587679_1813394233_o