Professional Documents
Culture Documents
IRremote Controller
IRremote Controller
Embedded Systems
IR Remote Controller
Homework
Authors
Mário Mesquita PG 47499
João Ferreira PG 47307
Teacher
Tiago Gomes
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.
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 “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.
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.
● 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.
● 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
● 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.
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.
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€
TOTAL 2.4€
3 Design phase
3.1.1 Battery
7
3.1.2 MCU - 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.
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.
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
10