Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

University Of Minho

Embedded Systems

IR Remote Controller
Homework

Authors
Mário Mesquita PG 47499
João Ferreira PG 47307

Teacher
Tiago Gomes

October 11th, 2021


Contents

1 Problem Statement ........................................................................................................ 3


2 Analysis Phase .............................................................................................................. 3
2.1 Problem Statement analysis ................................................................................... 3
2.2 System Overview .................................................................................................... 4
2.2.1 Functional Requirements ................................................................................. 4
2.2.2 Non Functional Requirements.......................................................................... 4
2.2.3 Technical Constraints ...................................................................................... 5
2.2.4 Non Technical Constraints ............................................................................... 5
2.2.5 Future constraints ............................................................................................ 5
2.3 Hardware and software specification ...................................................................... 6
2.3.1 Hardware ......................................................................................................... 6
2.3.2 Software .......................................................................................................... 6
2.4 Budget .................................................................................................................... 7
3 Design phase ................................................................................................................. 7
3.1 Hardware Specification ........................................................................................... 7
3.1.1 Battery ............................................................................................................. 7
3.1.2 MCU - ATTINY402 ........................................................................................... 8
3.1.3 IR Emitter ......................................................................................................... 9
3.1.4 Hardware overview .......................................................................................... 9
3.1.5 Other considerations ........................................................................................ 9
3.2 Software Specification ............................................................................................ 9
3.3 Flowcharts ............................................................................................................ 10
3.4 Tools ..................................................................................................................... 10

2
1 Problem Statement
Samsung asked us to design a remote control with three buttons that can remotely
control a television (TV). It should be very light, powered by batteries and able to control a
Samsung TV via an infrared emitter. The TV has a built-in infrared receiver. A button on the
remote control switches the TV on/off and will be labeled with the word "Power". The other two
buttons are used to scroll up/down and select the available channels and they are labeled with
the arrows up/down.

2 Analysis Phase
In this chapter it’ll be provided a brief overview of what the system should be, as well
as formulating and formalizing the system requirements. It’s at this phase where the tasks will
be separated into more detailed requirements and where we define the overall direction that
the project will take.

2.1 Problem Statement analysis


Samsung wants a remote controller with only 3 buttons, making us believe they want
a small and simple device. They did not ask for a way to control the volume of the TV, but, in
our opinion, that is a crucial requirement for a TV remote.

With all that in mind, we will develop an IR Remote Controller for a Samsung TV, with 4
buttons, keeping the footprint small, but adding more functionality.

- A “Power” button to turn the TV on/off.

- A “Vol” button that toggles the volume mode on/off. The “Vol” button must be transparent
and illuminated by a LED to easily identify if the volume mode is on.

- A “↑” button to scroll up on the channels or raise the volume if volume mode is on.

- A “↓” button to scroll down on the channels or raise the volume down if volume mode is
on.

The controller should be small, ergonomic, and very easy to use.

3
2.2 System Overview
After interpreting the problem that was presented, a sketch of the system’s mode of
operation was designed. The user will interact with the product via tactile buttons that will be
laid out in the remote control.
After the press of a button the processing unit selects the corresponding command
that was previously stored in the onboard memory and through PWM modulation, sends it to
the IR Emitter to communicate with the TV.

2.2.1 Functional Requirements

● ON/OFF button.
● Two buttons to change channels and the volume level.
● Button to toggle between volume and channel control.
● Fast operating speed.
● Low power consumption.

2.2.2 Non-Functional Requirements

● Light.
● Reliable and robust.
● Small for convenience of use.
● Needs to be ergonomic.
● User friendly.
● Low production cost.
● Silent button operation.

4
2.2.3 Technical Constraints

● Uses an IR emitter with a wavelength between 830-880nm.


● Powered by batteries.
● Uses Samsung IR Protocol.
● TV uses BPV22NF photodiode.

2.2.4 Non-Technical Constraints

● Only 2 elements on the team.


● Not familiar with the subject.
● Limited Budget.
● The team has no 3D modelling experience, needed to design the controller case.

2.2.5 Future constraints

To be prepared to some eventualities we thought about some possible setbacks such


as:

● The device will probably need to be certified (CE, ROHS, UL, FCC). We need to have
that in mind through the whole design and implementation phases. Failing the
certification tests will result in a major setback and probably force us to change the
whole system.
● The range of the remote might be low so it’s important to test the IR emitter range and
efficiency.
● If the battery life is shorter than expected, there’s got to be more space to fit a bigger
battery.
● Due to the worldwide chip shortage, the MCU and transistor may be hard to find and
need to be replaced for similar ones.
● The LED brightness will probably need to be adjusted so it’s visible in all sorts of light
conditions.
● The durability of the tactile buttons may be shorter than expected. The buttons should
be easily swappable without modifying the PCB or changing the keycaps.
● Different buttons/keycaps or case material may need to be used if the noise they
produce is too loud.

5
2.3 Hardware and software specification

2.3.1 Hardware

The remote controller we are developing must be cheap and low power, so we must
be rigorous with the hardware components.

We opted for a ATTINY402 from Microchip, as our processor. It is an 8-bit


microcontroller, with a small footprint, low power consumption and enough I/O pins for our use
case. It features a sleep controller and PWM generation, so it can perform every task we need
to have a functional, low power remote controller.

The IR emitter should have a good beam angle and a wavelength of 830-880nm, to
match the photodiode specification.

For the buttons, it is important to choose silent but tactile buttons. The user must feel
that he pressed the button but must not be disturbed by the sound it makes. The volume button
will be illuminated with a blue LED. The debounce of the buttons will be made using software.

2.3.2 Software

We will be using the Samsung IR Protocol to control the TV with our controller.

A typical Samsung IR Protocol sequence consists of a start bit, 16-bit address, 16-bit
data and a stop bit. In total there are 32 bits containing address and data, after the start bit.
The frequency of transmission is precisely 37.9Khz.

Samsung IR Protocol sequence

For most of the time, the system will be sleeping. Pressing a button will trigger an
interruption. A 32-bit word is created depending on what button was pressed, and then
encapsulated between a start and stop bits to form a sequence. The sequence is then sent to
the output pin using a PWM module.

The debounce of the tactile buttons must be done by software, to keep the production
costs as low as possible.

6
2.4 Budget
A universal remote controller can be bought for as low as 8€ on Amazon. If we weigh
out the profit margin and the development cost, it is safe to assume that the production costs
are between 1€ and 1.5€.

We can afford to spend more with our device, since it is a bespoke product made for
a specific customer. With that in mind, the production cost for the device should not go over
2.5€.

MCU 0.5€

IR Emitter 0.2€

PCB/Other components 1€

Buttons 0.4€

Plastic case 0.3€

TOTAL 2.4€

BBudget for each component of the controller

3 Design phase

3.1 Hardware Specification


In this section we will specify all the major hardware components in detail.

3.1.1 Battery

We will be using a CR2450 battery, rated at 3V and with 600-620mAh.

7
3.1.2 MCU - ATTINY402

The ATTINY402 is a low-power AVR RISC architecture microcontroller. It is capable


of running at up to 20 MHz with 4 KB Flash, 256 bytes of SRAM and 128 bytes of EEPROM
in a 8-pin package. The operating supply voltage is from 1.8V to 5.5V and it features three
sleep modes, two level interrupt controller, 3 channel event system, 2 16-bit Timer/Counter,
USART, SPI, an analog comparator, a 10-bit ADC and 6 programmable I/O lines.

Pinout for ATTINY402

We need 4 pins to interface with the buttons, 1 pin for the VOL button LED and 1 pin
for the output. The ATTINY402 has exactly 6 programmable I/O pins, so its perfect for our use
case.

8
3.1.3 IR Emitter

We chose an infrared emitter from kingbright, with a wavelength of 850nm and a beam
angle of 20 degrees.

3.1.4 Hardware overview

3.1.5 Other considerations

The programming pins of the MCU must be placed as exposed pads on the PCB, in
order to program the microcontroller on the assembly line.

3.2 Software Specification


The Samsung IR Protocol can be represented like this:

- Start bit: 4.5ms ON, 4.5ms OFF


- 32-bit data stream
- Level HIGH: 560μs ON, 1690μs OFF
- Level LOW: 560μs ON, 590μs OFF
- Stop bit: 560μs ON, 560μs OFF

9
The 16-bit data for each specific button will be stored in the MCU flash.

Power: 0x10001
Channel Up: 0xffcc0021
Channel Down: 0xffcc0024
Volume Up: 0xffcc001f
Volume Down: 0xffcc0022

A routine called “create_seq” will be responsible for creating the 32-bit sequence
encapsulated between a start and stop bits. The “send_seq” routine will then output the
sequence using PWM modulation. The PWM is configured by the “PWM_config” routine.

3.3 Flowcharts

3.4 Tools

- Microchip studio for AVR - for AVR development


- Altium Designer - for PCB design

10

You might also like