Raspberry Pi: GPIO driving 6V 10A Relay

Video:

Pics:

Relay Spec - 6V 10A

Relay Spec – 6V 10A

Relay Circuit - to drive 5V logic with 3.3V control

Relay Circuit – to drive 5V logic with 3.3V control

I had wanted to drive a relay ( an electronic component that can be used as a electro-mechanical switch to control AC mains) ever since I realised the potential of the GPIO pins on the RPi. The led on/off through the gpio was baby steps towards achieving this.

I stumbled on to a blog by Kevin, with detailed schematic and more ( http://www.susa.net/wordpress/2012/06/raspberry-pi-relay-using-gpio/ ). It should have been dead simple to do what I wanted following the instructions in his blog. I had slightly different components ( transistor was BC547B, diode was 1N4007), but  Kevin had in reply to other comments mentioned that any similar transitor/diode should work.

Since yesterday, I had been trying to get it to work. It wouldnt.

To debug I did:

1.Check that the relay itself was working fine by connecting the 5V pin and GND to the relay – and could hear the click of the switch working.

2. Check that the circuit was wired up correct – I was able to light up an LED ( in series with a 470 ohm resistor) with the 5V pin grounding through the transistor.

I went and bought a multi-meter today ( I was trying to avoid it, because I dont want to get too deep) to do more debugging. Couldnt. Posted a comment on Kevin’s blog, asking for help – he replied immediately suggesting I try with another transistor or with decreased resistance connecting the 3V3 pin to the base.

As I was pullnig out the only other transistor that came in the kit I bought on ebay ( a BC557 ) and looked up the pin arrangement for the EBC – I realised that I had previously swapped the E & C pins on the circuit.

I turned the transistor around on the breadboard – and heard the reassuring click of the relay engaging. Moved the 3v3 lead to GPIO and turned on/off realy from webiopi.

Possibilities of this are immense – home automation being key – and I already have a couple of real world needs.

1.Turning on my washing machine – I have a 6 year old washing machine that takes about 2 hours for a quick wash. My wife Janani and I, are only able to wash clothes on weekends – as other days, it takes too long to finish up before we have to rush to the office. So setting up the machine the previous night ( stuff the clothes, detergent ), and through RPi-Relay turn it on at say 5am in the morning – will enable us to wash weekdays too.

2. A friend of mine wants to be able to turn/off lights in his independent house  when he and his family are not in town. For security reasons. RPi to the rescue.

Raspberry Pi: Hello GPIO

Video:

I  bought the raspberry pi ( rpi) on a whim when a friend of mine mentioned it to me in passing.  I bought it on ebay ( a kit for INR 4000 i.e. ~ US$80) – about 2 months ago. I initially set up raspbmc ( custom xbmc on debian for raspberry pi), and had it connected up to my tv, but soon the novelty wore out. It was then i realized that the possibilities were immense if you consider the GPIO ports on the rpi.

I have been reading up on electronics, and making a further purchase – a electronics components package I saw on ebay.in for about INR700, that included a breadboard, leds, resistors, etc.

I got the package today, and wanted to do the following;

1. get a single led turn on/off through the gpio on rpi

2. control the led turn on/off through a web interface.

Theres a bunch of tutorials, youtube videos, and more to help do this, but in the process of trying to do 2, i stumbled on webiopi, and the whole process of doing 1 and 2 above took about 30 minutes.

Heres a video of the same – not really useful, poor voice and more, still putting it out – because the countless videos of rpi enthusiasts, and electronic hobbyists, and more have been the shoulders I stood on to achieve this. Shoulders of Giants and YouTube university.

Video: http://youtu.be/y3u8AR2Bb-M

Some pictures:

1.  Led always on – 3v3 to positive of led, through 440 ohm resistor to ground in rpi.

WP_000560

2. The setup – RPi is connected to my laptop  – running Guest Ubuntu 12.04 in a Virtual Box sharing the ethernet.

 WP_000561 WP_000562

WordPress Blog using MS Word

I enjoyed blogging using word on SharePoint blog in my last assignment. Microsoft Word rocks. And blogging on Word takes away all the complexities of formatting especially. I have decided to start blogging again – I want it to be my online journal for

  1. Summarizing and reviewing books, articles I read – to internalize them and share with the wider world
  2. Keep track of my personal projects
  3. Keep track of my ideas

Features I was looking for in my blog provider are:

  1. Tagging – to organize my posts into categories
  2. WYSIWYG formatting especially for tables and images
  3. Personal/Private post support.

WordPress supports all 3 requirements. I looked up quickly at a couple of comparisons on wordpress vs livejournal (and blogger) ( http://blog-services-review.toptenreviews.com/ ). A quick check seemed to indicate wordpress is the better alternative. Interestingly, I see that MS Word supports wordpress as a blog service provider out of box. So all in all a good deal. So here is to ongoing blogging on MS Word and WordPress.

Shree: Hello WordPress

First post on WordPress. So far so good.

Taking the advice of more than one wellwisher, plan to start blogging again – about anything and everything that I think about.

Welcome to my blog where I plan to share my thoughts on whatever interests me at that time – maybe technology, business, current affairs, religion, politics, anything.