REMI

●●●Flotulopex & Co.

 

| Home | What is it | Inside | Schema | Code | How to | Use it |

 

 

 

 

 

Menu

 

 

Morse

REMI

SIMON

FairTime

24VDC Charger

T+T Tester

K2000

TZR Stop Light

PIC

T50 Code Lock

Clignotant

Buzzer "Deluxe"

OPTO-Coupler

SPI DOGM LCD

SPI DOGL GLCD

DCF77

GPS

Cook’s Timer

RF Ringer

Siren

Template

PCB Making

Tools

Miscellanous

 

Downloads

 

Contact

 

 

 

 

 

What is it?

 

 

 

REMI stands for REmote MIni. It is an infrared, ten commands, maybe "universal" self-learning remote.

 

Never been laying in your bed at night, all lights off, trying to find the right button on your remote to select this or that function and suddenly having the volume going up? Won't happen again with REMI…

 

REMI can learn infrared signals from most currently infrared-controlled consumer electronics. Almost any TV, DVD, stereo, garage door opener, shade-control and many other remotes can be learned by REMI.

 

 

    

 

 

REMI's programming example – TV & SAT are controlled by 1 remote (notice how you can mix TV & SAT controls)

 

 

"Nav-key"

or "Joystick"

 Unlike most infrared remotes, REMI hasn’t got any built-in code table; it is a self-learning infrared signal remote. Hence, you'll need to have the original remote of your electronic device to teach REMI.

 

REMI can store signals from different remotes at the same time. Every command is separately freely programmable.

 

The navigation-key (nav-key) has four Directions "A B C D" and one Centre-Push "E".

 

REMI can learn ten commands although the Nav-key has five positions. Each Direction and the Centre-Push store two commands (short and long press).

 Contrairement à la plupart des télécommandes à infrarouge, REMI ne possède pas de base de données en mémoire; c'est une télécommande programmable. Par conséquent, il est nécessaire d'utiliser la télécommande de votre appareil électronique d'origine pour apprendre à REMI.

 

REMI peut stocker des signaux de diverses télécommandes simultanément. Chaque commande est programmable séparément.

 

Le bouton de navigation (Nav-key) a quatre Directions "A B C D" et un Center-Push "E".

 

Bien que le Nav-key n'ait que cinq positions, REMI peut stocker dix commandes.

 

Chaque Direction et le Center-Push mémorisent deux commandes (courte et longue pression).

 Ungleich anderen Infrarotfernsteuerungen hat REMI keine bereits programmierte Kodes; REMI ist "selbstlernend" und muß daher von der Orginialen Fernsteuerung signale lernen.

 

REMI kann gleichzeitig von verschiedene Fernsteuerungen Signale lernen.

 

Der Steuerknopf (Nav-key) hat vier Richtungen "A B C D" un ein Druckknopf "E".

 

Obwohl der Steuerknopf vier Richtungen und eine Druckfunction hat kann REMI 6 Signale lernen.

 

Jede Richtung und der Druckknopf  lernen je 2 Signale (Langer und Kurzer Druck).

 

 

 

 

Inside

 

REMI generates infrared signals @ 38kHz carrier frequency (default setting). Its infrared led emits a 35° beam 94nm; the more you point precisely at your device you want to control, the greatest the distance will be.

 

Selectable carrier frequencies are (HW v2.1): 34kHz, 36kHz, 38kHz (default), 39kHz, 40kHz, 42kHz.

 

 

 

REMI v2-1

 

 

 

 

 

 

 

 

REMI v1-6

 

 

 

 

REMI as first prototype

REMI's beta PCB

 

 

 

This is an example of how an infrared signal can look like.

 

Depending on brand and protocol used, the number of bits and how the data is encoded will change.

 

The yellow trace shows a full signal pattern. In this example, there are 1 starting bit (marker) and 18 address & data bits.

 

The blue trace zooms into one (yellow) bit to make the carrier frequency visible. Here, the carrier frequency is 40kHz.

 

It is important to use a high-speed (<50ns) rise & fall IR led such as VISHAY's TSFF5210 model.

 

REMI is powered with 2x1,5V UM-4(AAA) batteries. Its standby power drain is les than 0,1µA (I just can't measure values lower than that…)

 

 

 

 

 

Schema

 

 

 

 

 

Code (PICBasic)

 

'****************************************************************
'*  Name    : REMI_v2-1-2-5_16LF88_8MHz                         *
'*  Author  : FLOTUL                                            *
'*  Notice  : Copyright (c) 2008 Flotulopex & Co.               *
'*          : All Rights Reserved                               *
'*  Date    : 15.03.2015                                        *
'*  Version : 0                                                 *
'*  Notes   : IR-Receiver is a TSOP32238 - 38kHz                *
'*          : use PIC 16LF88 for min VDD @ 2V                   *
'****************************************************************
 
DATA 2,1,2,5 'Identify HW-SW
 
'-------------------------------------------------------------------------------
' Fuses PIC16F88
@ DEVICE HS_OSC
@ DEVICE PROTECT_OFF
@ DEVICE WDT_OFF
@ DEVICE PWRT_OFF
@ DEVICE MCLR_OFF
@ DEVICE BOD_OFF
@ DEVICE LVP_OFF
@ DEVICE CPD_OFF
@ DEVICE DEBUG_OFF
@ DEVICE CCPMX_OFF
@ DEVICE2 IESO_OFF
@ DEVICE2 FCMEN_OFF
 
'-------------------------------------------------------------------------------
' Registers   76543210
OPTION_REG = %10000000 'PORTB Pull-Ups disabled
OSCCON     = %00000000 'External OSC
ANSEL      = %00000000 'Disable analog inputs
ADCON0     = %00000000 'A/D Module is OFF
CMCON      = %00000111 'Comparator Module is OFF
TRISA      = %00000010 'Set Input/Output
PORTA      = %00000000 'Ports High/Low
TRISB      = %00111110 'Set Input/Output
PORTB      = %00000000 'Ports High/Low
T2CON      = %00000100 'Timer2 = ON, prescaler = 1:1
CCP1CON    = %00001100 'Select PWM Mode
 
'_______________________________________________________________________________
' Defines
DEFINE OSC 8
DATA @16,49  'preload last PR2 used value (40kHz)
 
'_______________________________________________________________________________
' Variables
IRM_VDD VAR PORTA.0 'IR RX Module's VDD
IRM_Out VAR PORTA.1 'IR RX Module's OUT
S_Sw    VAR PORTA.2 'Soft-Switch
C_Led   VAR PORTA.3 'Control Led
IR_Led  VAR PORTB.0 'IR Led (CCP1)
N_Key_E VAR PORTB.1 'key CENTER-PUSH
N_Key_B VAR PORTB.2 'key LEFT
N_Key_A VAR PORTB.3 'key UP
N_Key_C VAR PORTB.4 'key DOWN
N_Key_D VAR PORTB.5 'key RIGHT
N_Keys  VAR PORTB   'alias for "PORTB"
Ctr_A   VAR WORD    'counter
Ctr_B   VAR WORD    'counter
Max_Bit VAR BYTE    'number of possible bits µc depending (max is 40)
L_Bit   VAR WORD(40)'incoming IR lo pulse (becomes the High Pulse when sent)
H_Bit   VAR WORD(40)'incoming IR hi pulse (becomes the Low Pulse when sent)
V_Tmr   VAR WORD    'temporary holding var in LEARN subroutine
MemStrt VAR WORD    'Starting prg memory address for button F1
Mem_Loc VAR WORD    'Memory Location Pointer
Dy_Cycl VAR BYTE    'CCPR1L's Duty-Cycle value
Dy_Rat  VAR BYTE    'Duty-Cycle ratio (% of PR2)
Itv_Bit VAR WORD    'Interval Bit (pause-time between incoming patterns)
Bit_Cnt VAR WORD    'number of bits in IR original pattern
Valid   VAR BIT     'Validation for 2nd command programming
Rep_Int VAR BYTE    'SEND pattern repetiion interval pause time in ms
Rep_Nbr VAR BYTE    'Number of time the SEND is repeated
Rescale CON 2       'Make elapsed time count equal to real time duration
 
'_______________________________________________________________________________
' Program
INIT:
CCPR1L  = 0         'percentage of Duty Cycle value from PR2
PR2     = 49        '@8MHz 58=34kHz/55=36kHz/52=38kHz/50=39kHz/49=40kHz/47=42kHz
Ctr_A   = 0
Ctr_B   = 0
Max_Bit = 39
MemStrt = 0
Mem_Loc = 0
Dy_Cycl = 0
Dy_Rat  = 4
Valid   = 0
Itv_Bit = 0
Bit_Cnt = 0
Rep_Int = 15
Rep_Nbr = 1
 
'________________________________
' Select Command (Button pressed)
IF N_Key_A = 1 THEN MemStrt = $900
IF N_Key_B = 1 THEN MemStrt = $CC0
IF N_Key_C = 1 THEN MemStrt = $A40
IF N_Key_D = 1 THEN MemStrt = $E00
IF N_Key_E = 1 THEN MemStrt = $B80
S_Sw = 1                          'keep PIC powered!
Mem_Loc = MemStrt
 
IF MemStrt = 0 THEN PRG_END:      'make sure the remote hasen't a "false-start"
 
WHILE (N_Keys & %00111110) <> 0   'check if the button is still pressed
    IF Ctr_A > 6000 THEN          'after 0.3secs, F2 is selected
        Mem_Loc = Mem_Loc + $A0   'Add $A0 to first address
        GOTO READ_DATA:
    ENDIF
    Ctr_A = Ctr_A + 1
WEND
 
'_____________________________________________________________________
READ_DATA: ' READ data from memory and load to L_Bit & H_Bit variables
READCODE Mem_Loc, Bit_Cnt   'first mem loc contains bits count
IF Bit_Cnt = $3FFF THEN CHECK_N_Key_PRESS: 'nothing in memory, skip SEND!
Mem_Loc = Mem_Loc + 1
READCODE Mem_Loc, PR2       'second mem loc contains carrier freq
Mem_Loc = Mem_Loc + 1
FOR Ctr_A = 1 TO Bit_Cnt
    READCODE Mem_Loc, L_Bit[Ctr_A]
    Mem_Loc = Mem_Loc + 1
    READCODE Mem_Loc, H_Bit[Ctr_A]
    Mem_Loc = Mem_Loc + 1
NEXT Ctr_A
 
'__________________________________________________________
SEND: 'PWM mode (only PWM signal - set or reset Duty-Cycle)
Dy_Cycl = PR2 / Dy_Rat     'set duty-cycle ratio (% of PR2)
FOR Ctr_B = 1 TO Rep_Nbr
    FOR Ctr_A = 1 TO Bit_Cnt
        CCPR1L = Dy_Cycl        'activate duty-cylce
        PAUSEUS L_Bit[Ctr_A]
        CCPR1L = 0              'de-activate duty-cylce = no signal transmission
        PAUSEUS H_Bit[Ctr_A]
    NEXT Ctr_A
    PAUSE Rep_Int
NEXT Ctr_B
          
'___________________________________________________________________
CHECK_N_Key_PRESS: ' Check if button is kept pressed during ~10 secs
' -> No, go to PRG_END:
' -> Yes, a btn is still pressed, go to LEARN:
Ctr_A = 0
WHILE (N_Keys & %00111110) <> 0 'check if a button is still pressed
    IF Ctr_A > 65534 THEN       'make a 10 seconds loop
        IRM_VDD = 1             'power-ON IR Module
        PAUSE 300               'allow IR Module to settle (VERY IMPORTANT!)
        Valid   = 1             'do allow 2nd command learning
        Mem_Loc = MemStrt
        Ctr_A   = 0
        Itv_Bit = 0
        Bit_Cnt = 0
        C_Led   = 0
        READ 16, PR2
        GOTO LEARN:
    ENDIF
    Ctr_A = Ctr_A + 1
    PAUSEUS 50                  'adjust the loop's time to match 10 seconds   
WEND
 
'________________________________________
PRG_END: ' Program END and PIC switch-OFF
CLEAR         'reset all
CCPR1L  = 0   'make sure the IR led is OFF!!!
IRM_VDD = 0   'power-OFF IR Module
TOGGLE C_Led  'make the led fade-out blinky
S_Sw    = 0   'switch-off circuit
GOTO PRG_END: 'make it stop for ever
 
'__________________________________________________
LEARN: ' Receive streaming IR pattern max (40 bits)
' First learned command is the "short Press" one
IRM_Out = 1                   'set port HIGH
FOR Ctr_A = 0 TO 6
    TOGGLE C_Led
    PAUSE 150
NEXT Ctr_A
WHILE IRM_Out = 1 : WEND      'Wait here until a LOW signal is incoming
FOR Ctr_A = 1 TO Max_Bit
    TMR1H = 0                 'Reset Timer 
    TMR1L = 0                 'Reset Timer 
    T1CON.0 = 1               'Start Timer
    WHILE IRM_Out = 0 : WEND  'stay here as long as input signal is LOW
    T1CON.0 = 0               'Stop Timer
    V_Tmr.LowByte  = TMR1L    ' \ 
    V_Tmr.HighByte = TMR1H    '  > Store data to LOW_BIT var
    L_Bit[Ctr_A]   = V_Tmr    ' /
    TMR1H = 0                 'Reset Timer 
    TMR1L = 0                 'Reset Timer 
    T1CON.0 = 1               'Start Timer
    WHILE IRM_Out = 1 : WEND  'stay here as long as input signal is HIGH
    T1CON.0 = 0               'Stop Timer
    V_Tmr.LowByte  = TMR1L    ' \
    V_Tmr.HighByte = TMR1H    '  > Store data to HIGH_BIT var
    H_Bit[Ctr_A]   = V_Tmr    ' /
NEXT Ctr_A
C_Led = 0
PAUSE 1000                    'wait before continue
 
'__________________________________________________________________________
' Rescale to real time values according to osc speed (@4MHz = 1, @8MHz = 2)
FOR Ctr_A = 1 TO Max_Bit
    IF L_Bit[Ctr_A] > 0 THEN L_Bit[Ctr_A] = L_Bit[Ctr_A]/Rescale
    IF H_Bit[Ctr_A] > 0 THEN H_Bit[Ctr_A] = H_Bit[Ctr_A]/Rescale
NEXT Ctr_A
 
'______________________________________
' Find the longest H_Bit = interval bit
'  This to determine how many bits in pattern
FOR Ctr_A = 1 TO Max_Bit
    IF H_Bit[Ctr_A] > Itv_Bit THEN
        Itv_Bit = (H_Bit[Ctr_A] + 100) 'store the highest H_Bit value in Itv_Bit
        Bit_Cnt = Ctr_A            'is the count of bits in the original pattern
    ENDIF
NEXT Ctr_A
 
'___________________________________________________
' Replace all "after pattern" bits with value "zero"
FOR Ctr_A = (Bit_Cnt + 1) TO Max_Bit
    L_Bit[Ctr_A] = 0
    H_Bit[Ctr_A] = 0
NEXT Ctr_A
 
'_________________________________________
OPTIMISE: ' Select if optimising is wanted
'  If a Nav_Key is pressed whithin 5 secs, start optimising process;
'   if not, keep default settings and store data
C_Led = 1
FOR Ctr_A = 0 TO 65534     'make a 5 seconds loop
    IF (N_Keys & %00111110) <> 0 THEN 'a key has been pressed, go optimise!
        C_Led = 0
        Ctr_B = 0
        PAUSE 1000         'MUST wait a little before going to optimise!!!
        GOTO SETTINGS:
    ENDIF   
    PAUSEUS 10             'adjust the loop's time to match 5 seconds
NEXT Ctr_A
C_Led = 0   
 
'___________________________________________
STORE_DATA: ' Store data into program memory
L_Bit[0] = Bit_Cnt 'number of bits in this command
H_Bit[0] = PR2     'set PR2 value
 
' Cleanup at least 80 memory locations
ERASECODE Mem_Loc
ERASECODE Mem_Loc + 32
ERASECODE Mem_Loc + 64
 
' Write data to program memory
FOR Ctr_A = 0 TO Max_Bit
    WRITECODE Mem_Loc, L_Bit[Ctr_A]
    Mem_Loc = Mem_Loc + 1
    WRITECODE Mem_Loc, H_Bit[Ctr_A]
    Mem_Loc = Mem_Loc + 1
NEXT Ctr_A
 
'_________________________________
' Program 2nd command "long press"
IF Valid = 1 THEN
    Valid   = 0              'do not allow further programming for this button
    Mem_Loc = MemStrt + $A0  'set mem pointer to next memory location
    Ctr_A   = 0
    Itv_Bit = 0
    Bit_Cnt = 0   
    PAUSE 2000
    GOTO LEARN:
ENDIF   
GOTO PRG_END:
 
'___________________________
SETTINGS: ' Set Carrier Freq
IF N_Key_A = 1 THEN  'increase PR2 (carrier freq) value
    LOOKUP Ctr_B,[58,55,52,50,49,47],PR2
    Ctr_B = Ctr_B + 1
    IF Ctr_B >= 6 THEN Ctr_B = 0
    GOTO CHECK_SEND:
ENDIF
IF N_Key_C = 1 THEN  'decrease PR2 (carrier freq) value
    LOOKUP Ctr_B,[58,55,52,50,49,47],PR2
    IF Ctr_B = 0 THEN Ctr_B = 6
    Ctr_B = Ctr_B - 1
    GOTO CHECK_SEND:
ENDIF
IF N_Key_B = 1 OR N_Key_D = 1 THEN 'test the setting (no modification)
    GOTO CHECK_SEND:
ENDIF    
IF N_Key_E = 1 THEN  'finish optimising process & store data
    C_Led = 0
    PAUSE 1000
    WRITE 16, PR2
    'write 17, ctr_b
    GOTO STORE_DATA:
ENDIF
 
'led blinking loop
Ctr_A = Ctr_A + 1
IF Ctr_A > 5000 THEN
    Ctr_A = 0
    TOGGLE C_Led
ENDIF
GOTO SETTINGS:
 
'__________________________
CHECK_SEND: ' Send for check
Dy_Cycl = PR2 / Dy_Rat         'set duty-cycle to 25%
FOR Ctr_B = 1 TO Rep_Nbr
    FOR Ctr_A = 1 TO Bit_Cnt
        CCPR1L = Dy_Cycl       'activate duty-cylce
        PAUSEUS L_Bit[Ctr_A]
        CCPR1L = 0             'de-activate duty-cylce = no signal transmission
        PAUSEUS H_Bit[Ctr_A]
    NEXT Ctr_A
    PAUSE Rep_Int
NEXT Ctr_B
PAUSE 800
GOTO SETTINGS:

 

 

 

How to

 

Teach REMI!!!

 

Using REMI is easy. Since REMI has only one control led and one button, programming it needs attention.

 

Follow the learning process to get best results from REMI.

 

Basically, REMI does following steps during the learning process:

  • it learns a command;
  • it loads default settings or optimises.

 

Depending on witch option you choose (default settings or optimise), the learning time for one command can take from 10 seconds up to 2 minutes.

 

Place the original remote about 10cm (4 inches) in front of REMI. Make sure REMI is not exposed to any important light source since this may disturb the infrared signal and affect the learning process.

 

 

 

Programing

 

To start the learning mode, press & hold (at least 10 seconds) the nav-key until the control led starts to blink 3 times then stays steady ON; now release the nav-key.

  1. Point the original remote towards the IRm (see fig. n) and press a key; the control led switches OFF when a signal has been received;
  2. After 2 seconds pause, the control led is ON for five seconds; now:
  • if you do not press any nav-key within those 5 seconds (=while the control led is ON), REMI will store a default setting and exit the learning mode
  • if you press any nav-key within those 5 seconds, REMI will start the optimizing process.

 

Have a look at the flowchart; this explains how you’ll get the best out of REMI.

 

 

 

Optimising

 

The aim of optimising is to find the best carrier frequency.

 

The infrared transmission is defined by three main parameters:

  • the wave length (between 830nm and 950nm);
  • the data sequence or pattern (data to be transmitted);
  • the carrier frequency (the "vehicle").

 

 

The wave length is dependent of the infrared led’s construction; REMI has a 940nm IR-led. This is hardware and can't be changed.

 

The data sequence is what is sent by the original remote. REMI will learn it and analyse it.

 

The carrier frequency can be compared to a radio channel; the more the frequency is matching both emitter and receiver, the better the link between them will be.

 

In its optimisation phase, REMI emits the learned command every time the LEFT or RIGHT nav-key is pressed.The more distance can be made between REMI and the receiver, the better are the chances to find out the best carrier frequency.

 

 

 

 

Good to know…

 

Once you've started the learning process, REMI stays in that mode until a command is sent… or you remove the batteries!

 

"I can't find my original remote…"

 

There still might be a solution for you. Use an opensource software such as WINLIRC; it will generate IR codes without (hopefully) having the need for your original remote.

 

Nevertheless, you'll have to build a tiny PC serial port RS232 transmitter such as this one on the right. Then look for LIRC (LINUX) or WINLIRC (version 0.6.5) and search for your IR remote database here.

 

 

 

 

 

 

 

 Any time a command is programmed, both first (short press) and second (long press) commands have to be learned in a raw; the short press command is learned first.

 

So if you want to reprogram the short-press B key, then you would have to program both first and second commands again.

 

TIP: if you plan to use REMI to control only one receiver and want to OPTIMISE, you won't have to set the Carrier Frequency for every command again.

 

As a matter of fact, REMI will remember the last carrier frequency value chosen and apply it to the current programmed key. In other words, REMI will use your last setting as default. Start your first programming key and set your preferred Carrier Frequency. All next commands will keep the settings unless you change it.

 

 À chaque fois qu'une commande doit être programmée, les deux commandes du même bouton doivent être programmées à la suite, la commande à courte pression en premier.

 

Si, par exemple, vous souhaitez uniquement reprogrammer la commande B courte (short), vous devez reprogrammer les deux commandes (la courte et la longue).

 

Truc: si REMI ne sert à piloter qu'un seul et même récépteur, vous n'avez pas à utiliser la fonction OPTIMISE à chaque programmation.

 

En effet, REMI garde en mémoire la dernière valeur de fréquence porteuse (carrier frequency) que vous avez utilisé et l'assigne par défaut. De cette manière, si vous avez choisi tel ou tel Carrier Freq pour votre première commande, dès la seconde et pour toutes les suivantes, le même paramètre est appliqué.

 Das kommt noch…

 

 

 

 

Use it

 

Point REMI towards your electronic device and press the nav-key for your specific command to be sent. Seems obvious…

 

The navigation-key differentiates a short and a long press. A key press less than 0,3 seconds equals a short press. Holding any nbav-key pressed for more than 0,3 seconds activates the "long press" command.

 

Be careful: don't press & hold any contact for more than 10 seconds or you will enter learning mode. If you did so and want to quit, you have to remove the batteries for a couple of seconds.

 

None of the nav-keys is repetitive; don't keep any contact pressed after the command has been sent since it won't be sent again until you release the nav-key.

 

To improve REMI's batteries life, the Control Led doesn't fully light-up each time a command is sent and there are several ways to detect weak batteries:

  • The transmission range has decreased;
  • The Control Led in learning mode doesn't light-up anymore;
  • Looking at REMI's infrared beam using a camera or any "night shot" capable video device will show a weak or absent infrared beam.