element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Rocking Raspberry Pi
  • Challenges & Projects
  • Design Challenges
  • Rocking Raspberry Pi
  • More
  • Cancel
Rocking Raspberry Pi
Blog Raspberry Pi and Karaoke Machine (Setting Up LIRC)
  • Blog
  • Forum
  • Documents
  • Files
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: babusingh9211
  • Date Created: 8 Mar 2014 4:14 PM Date Created
  • Views 607 views
  • Likes 2 likes
  • Comments 1 comment
  • rockingraspberrypi
  • raspberrypi
  • rocking_pi
Related
Recommended

Raspberry Pi and Karaoke Machine (Setting Up LIRC)

babusingh9211
babusingh9211
8 Mar 2014

Hello everyone,

 

As in last post I posted about how to use LCD in Pi-face CAD.
Now this post covers how to configure and use IR receiver using Pi-Face CAD.


First of all update and upgrade your raspbian using command.


sudo apt-get update

sudo apt-get upgrade


The second step is to install LIRC and to configure it. Enter the following command in terminal.


sudo apt-get install lirc


In the Pi-Face CAD the infrared module is connected to pin 23 of Raspberry GPIO pin. We have to set raspbian to use GPIO pin 23. For that enter the following command.


sudo modprobe lirc_rpi gpio_in_pin=23


Or you can add this to your /etc/modules


lirc_dev
lirc_rpi gpio_pin=23


Change your /etc/lirc/hardware.conf file to


# /etc/lirc/hardware.conf
#
# Arguments which will be used when launching lircd
LIRCD_ARGS="--uinput"

# Don't start lircmd even if there seems to be a good config file
# START_LIRCMD=false

# Don't start irexec, even if a good config file seems to exist.
# START_IREXEC=false

# Try to load appropriate kernel modules
LOAD_MODULES=true

# Run "lircd --driver=help" for a list of supported drivers.
DRIVER="default"

# usually /dev/lirc0 is the correct setting for systems using udev
DEVICE="/dev/lirc0"
MODULES="lirc_rpi"

# Default configuration files for your hardware if any
LIRCD_CONF=""
LIRCMD_CONF=""


You can test that it is working or not by entering the following command


mode2 –d /dev/lirc0


And press buttons from your remote.
If you get some output like this


space 16300

pulse 95

space 28794

pulse 80

space 19395

pulse 83

space 402351

pulse 135

space 7085

pulse 85

space 2903

 

That means your IR receiver is working.

 

Now configure IR module to work with your remote model. For this download your remote code from http://lirc.sourceforge.net/remotes/

Rename the file to lircd.conf and place the file in /etc/lirc/


After this restart your Raspberry Pi to use the work with your remote model.
Now you can test your remote by entering

 

irw

 

Press the buttons on your remote and you’ll get pressed buttons values in terminal windows.

Alternatively you can create a small program to use the lirc

 

sudo nano ~/lircexample

 

Enter the following in the file and save it.

 

begin

    prog = irexec

    button = KEY_1

    config = echo "You pressed one"

    repeat = 0

end

begin

    prog = irexec

    button = KEY_2

    config = echo "You pressed two"

    repeat = 0

end

begin

    prog = irexec

    button = KEY_3

    config = echo "You pressed three"

repeat = 0

end

 

Make the file executable by entering

 

sudo chmod +x ~/lircexample

 

Execute the file by entering following in terminal

 

./lircexample

 

Now if you press 1 from remote you’ll get “You pressed one” as output. You can also perform a task by making suitable changes in the file.

 

This is all how I setup my LIRC using Pi-Face CAD. If you have any problem and query regarding this don’t hesitate to ask. If you have any suggestion’ please comment below.

 

Regards,

Sumit Rai

  • Sign in to reply
  • mmohit00007
    mmohit00007 over 11 years ago

    Finaly image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube