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
Smarter Life
  • Challenges & Projects
  • Design Challenges
  • Smarter Life
  • More
  • Cancel
Smarter Life
Blog Smarter Life Challenge - Brainwaves based appliance controller - Update 7
  • Blog
  • Forum
  • Documents
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: ciorga
  • Date Created: 9 Dec 2013 3:43 AM Date Created
  • Views 422 views
  • Likes 0 likes
  • Comments 1 comment
  • smarter_life_challenge
  • brainwave_controller
  • smarter_life
Related
Recommended

Smarter Life Challenge - Brainwaves based appliance controller - Update 7

ciorga
ciorga
9 Dec 2013

First, thank you DAB and cy.gul for your comments on my last week's update.  It turned out that the Manchester encoder that I built last weekend is not used in the infrared protocol of my TV remote.  After more reading I actually found out that there are various other encoding standards used in home appliances (like TVs, Cable boxes, satellite receivers, audio equipment …).  So first thing I looked into was how to transform the Manchester encoder into a more universal encoder.  To do this I built an experiment using an infrared receiver (I used Vishay TSOP38238) to decode the signal from my TV remote control, and I also opened the remote control and soldered two wires on the transmitter LED so I could probe the raw signals on the oscilloscope the same time with the decoded signals.  This is how my experimental setup looked like:

 

image

 

The Vishay TSOP38238 IR decoder has a block diagram as shown below:

 

image

 

With this setup I could measure the signal that my remote control sends to turn ON/OFF the TV:

 

image

 

The upper waveform is the raw signal on the infrared LED and the lower waveform is the signal at the output of the Vishay TSOP decoder.  The data sequence begins with a start pulse, then it has the coded bits, after which there is a pause and then it ends with a pulse similar to the starting pulse.  Zooming on the x-axis I could then see the correspondence between 38kHz modulated raw signal and decoded logic bits, as shown in the figure below:

 

image

 

So the difference between the logic “1” and logic “0” bits is not the modulated pulse position within a cycle, like for Mancester decoder, and it is not the length of the modulated pulse.  Logic “1” bits have longer spacing in between than logic “0” pulses, and all LED_ON pulses have the same length (1/2 cycle).  I have tried to think of a way to transform my shift register that I built one week ago to generate this sequence of pulses, but I couldn’t find an easy way since basically I had to create logic “1” pulses with different clock period than logic “0” pulses.  So I decided to remove the shift register and instead to build a subroutine in the CPU that creates these pulses using the CyDelay(x) command.  So my schematic has changed:

 

image

 

And the encoding is now done in a function that takes two inputs: the code that needs to be sent and the number of bits that needs to be sent.  This is because the code can be 8, 16, 32 … bits format (a register inside CPU that is multiple of 8 bits), but there might be cases when the number of bits that needs to be sent to a particular appliance/command to have an arbitrary number of bits not multiple of 8.  So my function takes the first N bits from the code to be sent:

 

image

The main advantage I see now, by using a “software” encoder versus the previous “hardware” Manchaster encoder is that I have the flexibility to cover various standards of IR transmission protocols by just creating similar functions for each type of protocol that I want to use.

 

The new design provides the desired encoding as I am showing in the following screenshot, which I have obtained by turning around my IR LED to point into the Vishay TSOP38238 receiver:

 

image

We can see now how logic "1" bits are encoded by having twice the spacing of logic "0" bits.

 

This was part of what I worked on this weekend; besides this I worked on a PCB that will hold the front end amplifier between electrodes and PSoC 4 comparators.  I am trying to get this board fabricated this week, so next weekend I can solder the parts and connect it to the PsoC Pioneer kit.

 

That’s it for this update; I will post more info as I get more work done.

Best Wishes,

Cosmin

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

    Hi Cosmin,

     

    Nice post. IR protocols can be 'challenging in their simplicity'. I created an open source receiver for the LEGO power functions toys,  and it was amazing to find out what LEGO had cramped in 16 bits of data.....  Also, LEGO's protocol is a bit different than most others, and has a minimum burst length of 6 cycles, limiting the amount of IR receivers I could use.

     

    Seems you're going well in the IR transmission department, I bet you're switching your television on and off in the next post!! Looks very promising.

    • 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