Skip to main content

Programming Raspberry Pi by Examples



Example 1: Programmatically controlling the LED




  • Join the Raspberry Pi Course (link
  • Implement LED connection in the course week 2 lecture (link) .








Example 2: Using the DHT11 - Humidity and Temperature Sensor with Raspberry Pi:


The example in Uugear (link) did not work because my DHT11 had the pins in different order the pins were marked + and - rather than S, V and G.

So I connected :


  • + symbol in DHT11 ------> 3.3V
  • - symbol in DHT11 ------> GND
  • out symbol in DHT11 ------>  pin GP4

Also I used this github library (easy to understand) : https://github.com/szazo/DHT11_Python


Example 3: IR Controlling your TV and AC with Raspberry Pi


These 2 tutorial were followed to do this example:

1. http://www.raspberry-pi-geek.com/Archive/2015/10/Raspberry-Pi-IR-remote (main)
2. http://alexba.in/blog/2013/01/06/setting-up-lirc-on-the-raspberrypi/ (helped to resolve issues)
3. https://blog.bschwind.com/2016/05/29/sending-infrared-commands-from-a-raspberry-pi-without-lirc/ (to learn about IR reciever)


Extra Steps :

The above tutorial 1 had 2 missing steps that I am documenting below.

Step 1: Run the following command before restart (or I was getting the error [1]):


lircd -d /dev/lirc0 
[1] irsend: hardware does not support sending raspberry pi

Step 2: The key blocker I was facing was that the IRSEND command was working fine but the TV was not getting any signal. Eventually, the issue was fixed by doing the following (from the 2nd link above):
//edit the /boot/config.txt and add: 
dtoverlay=lirc-rpi,gpio_in_pin=23,gpio_out_pin=22

Notes:

My TV Remote Control: irsend SEND_ONCE LG_AKB73715601 KEY_MENU

Notes: When trying to control the Air Condition using Raspberry Pi, I was unable to find the config files for my particular AC model from the current lirc repo. Eventually purchased and IR receiver LED and recorded the IR signals from original remote control using lirc record feature (already documented in the above links). Later it was very simple to fire the recorded keys and the AC was controlled successfully. 

Popular posts from this blog

ICFAI Sikkim Distance MBA Review From My Experience

After a long research I joined for the ICFAI distance MBA program in 2012. Now I've completed 2 semesters ( as of 2013 ). I wanted to write this review so that people who are looking for a good MBA program can get a hand-on review about the distance MBA offered by the ICFAI Sikkim. I've been through all the cycles of this program and this review might help you make the right choice about the program. This article presents my own ( and unbiased ) view of the program and is in no way associated with the course provider.


Is the MBA ICFAI Sikkim Approved By UGC?  As per the latest AICTE regulations, a distance education program must have the approval of a joint commission of  UGC- University Grant CommissionAICTE- All Indian Council for Technical EducationDEC- Distance Education CouncilICFAI Sikkim doesn't have this approval (don't get disappointed, it's not over yet). Only institutes and colleges affiliated to a University are required to take AICTE approval. So ICFAI be…

Is MacBook Air Good For Programming / Blogging ?

I'm a passionate java developer who just migrated from a Windows PC netbook ( Dell mini ) to a 13 inch MacBook Air. Before the netbook I owned a Dell inspirion 1501. I'm quite a bit of an avid blogger as well. I purchased Dell mini just as it was launched hoping that it's compact and mobile architecture would solve all of my need as a programmer and a writer. Unfortunately it turned out that it was a worthless device.The rest of the story goes...



Do Not Compare a Netbook With MacBook AirMacBook's astonishing features far exceeds anything that of a normal Netbook.Before
Buying a netbook for programming and blogging was one of the biggest blunders I ever made on choosing a machine. The screen was 11 inch and clumsy icons of the Windows were a disgrace all the time.The tightly arranged keys in the keyboard made typing a pain. It's slow Intel Atom Processor is too sluggish to run even VLC player.


After  The Mac's backlit spacious keyboard layout, 1440x900 resolution d…

Best Places To Eat at Trivandrum

Are you searching for the most amazing places to eat at Trivandrum? Well, this article is a collection of places from where I've carried the taste after eating. All of them are located in Trivandrum. There is no specific focus for a single kind or restaurant, I've written about the latest hot-spot cafes to ethnic and traditional places at the heart of the city and people for decades.
General Places Azad Hotel Azad Hotel is a hotel-chain all over India and they are one of the best hotels in Trivandrum too. They claim to have introduced the popular dish 'biriyani' in India. However, they provide a good ambience and tasty food. There are all kind of popular non-vegetarian dishes available here. They have a long tradition of serving quality food and that's what makes them the best. There are
Zam Zam This is the most sought after destination in city for the best cooked chicken dishes. The 'Shawai' is the all time best seller of Zam Zam. It's very rushy alwa…