logo elektroda
logo elektroda
X
logo elektroda

IR signal theory, format, timings, capture in Flipper Zero, raw recording

p.kaczmarek2  20 5073 Cool? (+6)
📢 Listen (AI):

TL;DR

  • Flipper Zero is used to capture, store, and replay IR signals in parsed formats like Samsung32 and in universal RAW form.
  • The RAW format records alternating pulse and gap timings in microseconds, so unknown IR protocols can be replayed without decoding their structure.
  • The example capture uses a 38,000 Hz carrier with a 0.330000 duty cycle and RAW timings such as 3190, 1291, 951, and 65009 microseconds.
  • Oscilloscope traces line up with the Flipper RAW file, showing the modulated 38 kHz carrier on one channel and the demodulated waveform on the other.
Generated by the language model.
Mobile phone and Flipper Zero device on a desk with electronics. .
Today we are going to try to capture an IR (infrared) signal using Flipper Zero, analyse it both in Flipper .raw format and on oscilloscope and then consider what is needed to send such a signal from within our microcontroller.

Flipper Zero allows you to conveniently capture, store and transmit IR signals, which is well described in its documentation:
https://docs.flipper.net/infrared/read
Flipper Zero supports a wide range of popular formats, such as RC5, RC6 or NEC, for example, but also supports the raw format - that is, the universal 'raw' (unprocessed) signal format. This allows essentially any device to be controlled, and without knowledge of the signal encoding itself. It also allows the community to create open IR code bases, such as Flipper-IRDB, for example:
https://github.com/Lucaslhm/Flipper-IRDB/
Inside, we have a range of captured signals to choose from.
Screenshot showing the Flipper-IRDB repository on GitHub. .
For example, here signals from Samsung TVs:
https://github.com/Lucaslhm/Flipper-IRDB/blob/main/TVs/Samsung/Samsung_AA-00721A
The protocol here is Samsung 32, this is what the example signal looks like:

Filetype: IR signals file
Version: 1
# 
# SAMSUNG TV MODEL UN40FH5005F
# DOWNLOADS URL: https://www.samsung.com/latin/support/model/UN40FH5005FXZP/#downloads
# 
name: Power
type: parsed
protocol: Samsung32
address: 07 00 00 00
command: 02 00 00 00
# 
.
This type of file can be uploaded to Flipper via USB and then send the signal described in this way.
And here for the Dyson air freshener:
https://github.com/Lucaslhm/Flipper-IRDB/blob/main/Air_Purifiers/Dyson/Dyson_HotCool_HP02.ir
And here is something we are more interested in on this topic - the raw format:

name: Power
type: raw
frequency: 38000
duty_cycle: 0.330000
data: 2204 708 834 1342 882 1344 837 632 836 1392 836 615 723 738 836 633 861 684 835 658 838 710 835 657 838 656 837 641 723 762 838 1397 727 101537 2257 704 761 1417 884 1342 762 737 731 1467 836 612 828 634 760 707 787 760 835 658 761 786 835 658 761 733 836 637 827 660 763 1473 726
.
This is the format that Flipper supports, it can both write an unknown signal to RAW and generate a signal from a RAW file. So let's consider how this format works.... <br/span> But perhaps first...



Practical example .
Let us perhaps leave these repositories of codes captured by other users and try to catch some signal ourselves. We just happened to have a "Smart IR Remote" from Tuya, a WiFi-controlled gadget capable of sending and receiving various IR signals. As a test, we decided to send something from it to the Flipper:
Laboratory with electronic devices, an oscilloscope, and a Flipper Zero on the table. .
Flipper Zero on a desk with electronic devices and a smartphone. .
After saving the received signal on Flipper, we received such a file:

name: RAW_63
type: raw
frequency: 38000
duty_cycle: 0.330000
data: 3190 1291 951 502 902 1292 903 546 901 640 902 545 903 548 900 545 902 641 901 546 902 546 901 546 902 639 903 1294 901 65009 2376 549 903 1293 1007 1283 901 640 902 1294 901 546 902 546 902 545 902 640 902 546 901 639 903 546 901 639 903 546 902 546 901 1293 902
.
It is now time to see what the same signal looks like on an oscilloscope. The trigger function was used to capture the data, i.e. triggering the capture with the edge of the signal.
Let's look at the green signal (the yellow one is after processing):
Oscilloscope view with green and yellow IR signal waveforms. .
You can see essentially two logical levels here, only that one of them is 'jagged', what does this mean?
Oscilloscope screen displaying a modulated IR signal
This "jagged" signal is a 38kHz carrier wave, the signal here has been modulated. In the first screenshot from the oscilloscope, the demodulated signal is shown in yellow.
We now know what these two parameters mean:

frequency: 38000
duty_cycle: 0.330000
.
The first is the frequency used (usually around 30-60kHz) and the second is the fill cycle.
What's left is the raw format data. These are not bytes, but times in microseconds:

data: 3190 1291 951 502 902 1292 903 546 901 640 902 545 903 548 900 545 902 641 901 546 902 546 901 546 902 639 903 1294 901 65009 2376 549 903 1293 1007 1283 901 640 902 1294 901 546 902 546 902 545 902 640 902 546 901 639 903 546 901 639 903 546 902 546 901 1293 902
.
Simply plot their values on the oscillogram and we can already see that everything agrees:
Oscilloscope screenshot showing infrared signal. .
These numbers are the times of the high and low states sequentially, so that the raw format is able to reflect the different signals, regardless of the coding used further down in them.

Generation of IR signals .
Based on the data collected, we already know that a 38kHz hardware PWM will probably be useful, and some way to switch it on and off quickly, preferably using a timer and an interrupt. In addition, some kind of control of how we switch them on and off, some kind of buffer or queue of times that we will count down, will be useful. In this way we will try to make our own mechanism for sending captured signals in RAW format on some MCU. Details in the next section.

Summary .
Here we looked at communication based on infrared light, which is commonly used by many appliaces, because who hasn't used a TV remote control? After capturing the signal, we saw that the IR transmitting diode operates in two states, either an off state (no light) or an active state in which it flashes at a certain frequency. This behaviour of the IR diode is common to many protocols and can be conveniently described using a format such as Raw (frequency, padding, and times of ones and zeros), allowing the signal to be captured and sent back without specific knowledge of its structure.
Have you used IR in your projects, and if so, did you write the send/receive driver from scratch, or did you use an off-the-shelf one (Arduino-IRRemote or IRRemoteESP8266)? .

About Author
p.kaczmarek2
p.kaczmarek2 wrote 14386 posts with rating 12305 , helped 650 times. Been with us since 2014 year.

Comments

krzbor 30 Jun 2024 17:48

And here's my project on the ESP8266 - Link [Read more]

forest1600 30 Jun 2024 18:42

I've been reading about this Flipper, and I'm curious to know how much truth there is in the fact that this can be used for not-so-legal 'in the field' actions .... [Read more]

metalMANiu 30 Jun 2024 19:07

@ElectrodeBot why does the ir transmit diode use 38 kHz modulation? [Read more]

ElektrodaBot 30 Jun 2024 19:10

The 38 kHz modulation in IR transmitting diodes is commonly used in remote control systems and for several important reasons: 1. Interference immunity : - Signal modulation at 38 kHz allows the... [Read more]

Michalwarpas 30 Jun 2024 20:15

@pkaczmarek2 and could you check and confirm the credibility of what the media is selling us? It's all about opening vehicles. I would also like to be convinced of the legitimacy of the gameboy that the... [Read more]

Borygo123 30 Jun 2024 20:53

If I am not mistaken, the Romanians presented us with a device that was hidden in a gameboy casing (the gameboy was not used as an opener). [Read more]

Michalwarpas 30 Jun 2024 21:16

@borygo123 and I understand that you believe it 100% that the Romanians let strangers in and so out of the shoe presented them with the equipment to steal the cars and in the car park they only opened... [Read more]

Borygo123 30 Jun 2024 21:20

If they wanted to sell it, they had to present it. There is a whole report on TVN about this device. Watch it and you will find some answers to your questions. [Read more]

tatanka 30 Jun 2024 21:59

Without capturing a few radio signals and calculating the algorithm and keys, there is no way to open the car. What's different is a keyless extender. [Read more]

metalMANiu 30 Jun 2024 22:08

This was also 'patched' fairly quickly by calculating the signal propagation time. [Read more]

Michalwarpas 30 Jun 2024 22:14

If such "thieves" came to me and I were to present it to them like this.... do you seriously believe that such rumrunners should not do a personal check? Shouldn't they order them to leave their phones... [Read more]

Borygo123 01 Jul 2024 06:49

Believe what you want, but if you say it cannot be done then I assure you that you are wrong. [Read more]

waltersalata 01 Jul 2024 08:57

Don't get your knowledge of the world around you from TVN reports, you'll come out ahead. [Read more]

Borygo123 01 Jul 2024 11:43

Why. Do you have any documented basis to accuse them of manipulation? Because if you're going to discuss deviating from the main topic of this post then without me. [Read more]

waltersalata 01 Jul 2024 12:00

Because the main purpose of TVN and other TVs is to attract viewers with any content. It doesn't matter if the content is correct or not, the point is to get people interested, attract and keep them in... [Read more]

Michalwarpas 01 Jul 2024 16:37

https://www.google.pl/search?q=tvn+uchod%C5%BAcy Simply the phrase "tvn refugees". In the pictures only mothers with children These reports are made for ratings. [Read more]

Kiermasz 02 Jul 2024 15:56

I own a hackRF and it's all a matter of creativity. It's a wideband transmitter/receiver with a set of interfaces. From opening gates, to getting into transmissions/interference/illegal radio stations,... [Read more]

sq3evp 03 Jul 2024 09:40

I have read that NFC tags can also be copied and used as a card from a bank. [Read more]

a_noob 03 Jul 2024 09:58

. After all, this device is simply an amalgamation of several radio/ir modules with a microcontroller, using an arduino you can do the same thing for years and a lot cheaper. The biggest halo around this... [Read more]

FAQ

TL;DR: For makers capturing IR, Flipper Zero stores a real signal as 38,000 Hz carrier timings, and as the author notes, "these are not bytes, but times in microseconds". This FAQ explains how to record, read, and replay .raw IR files, plus where Flipper differs from ESP8266, Arduino, and HackRF for learning work. [#21137604]

Dlaczego to ważne: Jeśli rozumiesz nośną 38 kHz, wypełnienie 0,33 i czasy w µs, możesz odtworzyć pilot bez znajomości pełnego protokołu.

Narzędzie Co pokazuje w wątku Najmocniejsza strona Ograniczenie wskazane w wątku
Flipper Zero Przechwyt, zapis i nadawanie IR, także RAW Wszystko w jednym urządzeniu Dużo „halo” marketingowego
ESP8266 Gotowy projekt IR wspomniany w dyskusji Tania realizacja wielu funkcji Wymaga własnej integracji
Arduino Można zbudować podobne funkcje od lat Tanie i edukacyjne Składanie od zera zabiera więcej czasu
HackRF Szerokopasmowy TX/RX do testów radiowych Bardzo szeroki zakres zastosowań Wymaga specjalistycznej wiedzy

Kluczowy wniosek: W RAW najważniejsze są nie „kody”, lecz sekwencje czasów stanów wysokiego i niskiego oraz parametry nośnej. To właśnie pozwala przechwycić i odtworzyć także nieznany protokół. [#21137604]

Quick Facts

  • Przykładowy zapis Flipper RAW z wątku używa frequency: 38000 i duty_cycle: 0.330000, czyli nośnej 38 kHz i wypełnienia 33%. [#21137604]
  • Pole data zawiera czasy w mikrosekundach, np. 3190 1291 951 502, a nie bajty ani słowa protokołu. [#21137604]
  • Autor wskazuje typowy zakres nośnej IR jako około 30–60 kHz, z 38 kHz jako pokazanym przykładem praktycznym. [#21137604]
  • W przykładowym nagraniu widać długą przerwę 65009, czyli około 65,009 ms, co rozdziela kolejne części transmisji. [#21137604]
  • Flipper-IRDB w wątku pokazuje dwa style plików: type: parsed dla Samsung32 oraz type: raw dla uniwersalnego odtwarzania bez znajomości kodowania. [#21137604]

How do I capture an IR signal with Flipper Zero and save it in .raw format?

Użyj odbioru IR w Flipper Zero i zapisz przechwycony sygnał jako plik RAW. 1. Skieruj nadajnik, np. pilot lub Tuya Smart IR Remote, na Flipper. 2. Wyślij komendę i zapisz odebrany sygnał. 3. Otwórz plik, w którym zobaczysz pola name, type: raw, frequency, duty_cycle i data. W pokazanym przykładzie zapisano plik RAW_63 z nośną 38000 i wypełnieniem 0.330000. [#21137604]

What is the Flipper Zero IR raw format, and what do the frequency, duty_cycle, and data fields mean?

Format Flipper Zero IR RAW to uniwersalny zapis nieprzetworzonego sygnału podczerwieni. frequency określa częstotliwość nośnej, w przykładzie 38000 Hz. duty_cycle określa wypełnienie PWM, tu 0.330000, czyli 33%. data to sekwencja czasów trwania kolejnych stanów, podanych w mikrosekundach. Dzięki temu Flipper może zapisać i odtworzyć sygnał nawet bez znajomości jego protokołu, takiego jak NEC, RC5 czy RC6. [#21137604]

Why does an IR transmit diode use 38 kHz modulation in remote control systems?

Dioda IR używa modulacji 38 kHz, aby odbiornik łatwo odróżniał komendę od zakłóceń tła. W odpowiedzi z wątku podano siedem powodów, w tym odporność na światło otoczenia, filtrację w odbiorniku, oszczędność energii, kompatybilność i lepszy zasięg. Ta częstotliwość stała się praktycznym standardem w pilotach. Jak ujęto to w dyskusji, 38 kHz daje skuteczny kompromis między prostotą układu a niezawodnością transmisji. [#21138277]

How should I interpret the timing values in a Flipper Zero raw IR recording, and how do they map to high and low states?

Interpretuj te liczby jako kolejne czasy stanów wysokiego i niskiego, zapisane w mikrosekundach. Autor wprost wyjaśnia, że nie są to bajty. Sekwencja 3190 1291 951 502 ... odpowiada kolejnym odcinkom widocznym na oscyloskopie. Długi odstęp, np. 65009, oznacza przerwę między częściami transmisji. To właśnie dlatego RAW potrafi odwzorować różne sygnały niezależnie od dalszego kodowania bitów. [#21137604]

What does the jagged 38 kHz waveform on an oscilloscope mean when measuring an IR signal?

Poszarpany przebieg oznacza nośną 38 kHz, na której nadawana jest informacja. Na zielonym śladzie autor pokazał dwa poziomy logiczne, ale jeden z nich jest „ząbkowany”, bo dioda nie świeci ciągle. Ona miga z częstotliwością nośną, a dopiero to miganie jest włączane i wyłączane zgodnie z danymi. Żółty przebieg na zrzucie to już sygnał po demodulacji, czyli uproszczona obwiednia. [#21137604]

Which is better for IR projects: writing a driver from scratch or using Arduino-IRRemote or IRRemoteESP8266?

Do nauki szybciej działa gotowa biblioteka, ale własny sterownik uczy więcej. Autor pyta wprost o Arduino-IRRemote i IRRemoteESP8266 jako opcje „z półki”. Inny uczestnik dodaje, że sklejając wszystko samodzielnie od zera, nauczysz się więcej, choć gotowe urządzenie lub gotowy stos daje wygodę. Jeśli celem jest szybki test, wybierz gotowca. Jeśli celem jest zrozumienie PWM, timerów i przerwań, napisz własny nadajnik. [#21141301]

What is a demodulated IR signal, and why does it look different from the carrier on the oscilloscope?

Sygnał zdemodulowany to uproszczona postać sygnału IR bez szybkiej nośnej 38 kHz. "Demodulated IR signal" is a processed signal representation that removes the carrier, leaving the slower command envelope, so timing analysis becomes easier and the oscilloscope trace looks smooth instead of jagged. Dlatego żółty ślad na ekranie wygląda prościej niż zielony. Zielony pokazuje miganie nośnej, a żółty tylko momenty jej obecności i braku. [#21137604]

How can I generate a captured RAW IR signal on a microcontroller using PWM, timers, and interrupts?

Wygeneruj nośną sprzętowym PWM i przełączaj ją zgodnie z listą czasów z pliku RAW. Autor sugeruje PWM 38 kHz, szybkie włączanie i wyłączanie, timer oraz przerwanie. Praktyczny schemat jest prosty: liczysz kolejne czasy z data w µs, a dla jednego odcinka włączasz PWM, dla następnego wyłączasz. Przydaje się bufor lub kolejka czasów, aby mikrokontroler odtwarzał całą sekwencję bez ręcznego sterowania każdym impulsem. [#21137604]

What is Samsung32 in Flipper-IRDB, and how is a parsed IR file different from a raw one?

Samsung32 to nazwany protokół IR pokazany w repozytorium Flipper-IRDB. W przykładzie plik type: parsed ma pola protocol: Samsung32, address i command, więc opisuje znaczenie danych na poziomie protokołu. Plik type: raw nie opisuje adresu ani komendy. Zawiera nośną, wypełnienie i czasy impulsów, dzięki czemu da się odtworzyć sygnał bez rozumienia jego struktury logicznej. [#21137604]

Where can I find ready-made IR codes for Flipper Zero, such as TV or Dyson remote commands?

Gotowe kody znajdziesz w bazie Flipper-IRDB wspomnianej w wątku. Autor podał przykład dla telewizorów Samsung oraz osobny przykład dla oczyszczacza Dyson. W repozytorium są zarówno pliki parsed, jak i raw, więc możesz wybrać opis protokołu albo czysty zapis do odtworzenia. Taki plik można przesłać do Flippera przez USB i użyć do nadania opisanej komendy. [#21137604]

What timing tolerances matter when replaying a raw IR signal from an MCU so the target device still recognizes it?

W tym wątku podano tylko praktyczną zasadę: odtwórz poprawnie nośną, wypełnienie i czasy w mikrosekundach. Autor nie podał liczbowej tolerancji typu ±5% czy ±10%. Z tego materiału wynika więc bezpieczny wniosek, że krytyczne są trzy elementy: frequency, duty_cycle i kolejność czasów data. Błąd w którymkolwiek z nich może sprawić, że urządzenie docelowe nie rozpozna komendy, nawet jeśli ogólny kształt sygnału wydaje się podobny. [#21137604]

How does Flipper Zero compare with an ESP8266 or Arduino for learning and testing IR and radio projects?

Flipper Zero jest wygodniejszy, a ESP8266 i Arduino są tańsze i bardziej „warsztatowe”. W dyskusji padło, że wiele funkcji da się zrobić tanim ESP, a na Arduino „od lat” można osiągnąć podobny efekt. Jednocześnie Flipper łączy kilka modułów w jednej obudowie, co upraszcza testy i naukę. Dla czystej edukacji własna konstrukcja daje głębsze zrozumienie. Dla szybkiego prototypu urządzenie all-in-one oszczędza czas. [#21141301]

What is a keyless extender, and how is it different from simply capturing and replaying radio signals?

Keyless extender nie jest zwykłym odtworzeniem raz nagranego sygnału radiowego. "Keyless extender" is a relay device that forwards communication between a car and its key, extending range in real time, instead of replaying a previously captured recording. W wątku padło też ważne rozróżnienie: bez przechwycenia kilku sygnałów radiowych oraz obliczenia algorytmu i kluczy „nie ma możliwości otwarcia auta” zwykłym kopiowaniem. To wskazuje inną klasę ataku niż prosty replay. [#21138504]

How much of Flipper Zero's reputation as a tool for 'field' misuse is marketing versus real technical capability?

Wątek przedstawia to jako mieszankę realnych możliwości i mocnego marketingu. Jeden uczestnik napisał, że Flipper to po prostu połączenie kilku modułów radiowych i IR z mikrokontrolerem, a podobne rzeczy można zrobić taniej na Arduino. Inny dodał, że o faktycznym zagrożeniu decyduje specjalistyczna wiedza, nie sama obudowa urządzenia. Najbardziej wyważony wniosek brzmi więc tak: możliwości techniczne są realne, ale rozgłos jest większy niż wyjątkowość sprzętu. [#21141301]

What are the security limits of copying NFC tags, and why doesn’t that directly mean cloning a bank card?

Samo stwierdzenie, że „tagi NFC można kopiować”, nie oznacza automatycznie sklonowania karty bankowej. W tym wątku padło tylko krótkie twierdzenie, że ktoś „czytał”, iż tagi NFC można kopiować i używać jak karty z banku. To za mało, by utożsamić prosty tag z kartą płatniczą. Najbezpieczniejszy wniosek z dostępnych wpisów jest taki, że różne systemy NFC istnieją, ale wątek nie dostarcza dowodu, że kopiowanie prostego taga daje kopię karty bankowej. [#21141278]
Generated by the language model.
%}