Browse Source

receive & plot infrared signal of BAUMAX 13-26006/20 xmas tree lights remote control

Fabian Peter Hammerle 3 years ago
parent
commit
93eceb4500
9 changed files with 139 additions and 61 deletions
  1. 3 0
      20201227_215136.jpg
  2. 3 0
      20201227_215222.jpg
  3. 0 50
      README.md
  4. 8 0
      messages.json
  5. 1 1
      receive/.gitignore
  6. 1 1
      receive/Makefile
  7. 0 0
      receive/arduino-sketch.ino
  8. 123 9
      receive/plot.grc
  9. 0 0
      receive/serial_source_block.py

+ 3 - 0
20201227_215136.jpg

@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0f45eb4a1329c6f97e476b20b7ceb999881d2a319b8f72695e322afec8086f8f
+size 2322324

+ 3 - 0
20201227_215222.jpg

@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e5e69392ec077bd42d2aedd9a66ed6f1c71d5203e6d75139919a1b406e9c2db6
+size 2695074

+ 0 - 50
README.md

@@ -1,50 +0,0 @@
-## Y-configuration of resistors
-
-```
-V_in - V_out = I_in * R_in
-V_ref - V_out = I_ref * R_ref
-V_out = (I_in + I_ref) * R_gnd
-
-I_in = (V_in - V_out) / R_in
-I_ref = (V_ref - V_out) / R_ref
-V_out / R_gnd = I_in + I_ref =
-    = (V_in - V_out) / R_in + (V_ref - V_out) / R_ref
-(V_in - V_out) / R_in = V_out / R_gnd - (V_ref - V_out) / R_ref
-V_in - V_out = (V_out / R_gnd - (V_ref - V_out) / R_ref) * R_in
-V_in = (V_out / R_gnd - (V_ref - V_out) / R_ref) * R_in + V_out =
-     = V_out * (1 + R_in / R_gnd + R_in / R_ref) - V_ref * R_in / R_ref
-```
-
-for `V_out=0`:
-```
-V_in = -V_ref * R_in / R_ref
-```
-
-for `V_out=Vref`:
-```
-V_in = V_ref * R_in / R_gnd + V_ref
-```
-
-## alternatives:
-
-[rgco: Multichannel Arduino Oscilloscope](https://www.instructables.com/Another-Arduino-Oscilloscope/)
-
-> The 16MHz Arduino clock is too fast for the ADC to operate properly, therefore it needs to be prescaled.
-> Prescale factors of 1 (no prescale) to 128 can be selected.
-> By default, the Arduino IDE sets the prescale to 128,
-> resulting in an ADC-clock period of 128/16MHz=8 microseconds,
-> and thus a sampling period of `13*8=104` microseconds.
-> Many tests have shown reducing the prescale to 16 results in only a slight loss of precision,
-> while even faster clocks result in garbage.
-
-> The Arduino ADC can be operated in single acquisition or free running mode.
-> The standard analogRead() function does a single acquisition and returns the value when the ADC is ready.
-> […], it is also possible to use a loop and poll for the ADIF flag which indicates that the ADC reading is complete, […]
-
-
-[pcscope](https://www.electronicsforu.com/electronics-projects/pc-based-oscilloscope-using-arduino)
-([source](http://efymag.com/admin/issuepdf/PCBasedOscilloscopeUsingArduino.zip))
-
-> By default, the ADC configuration of the Arduino gives samples every 116µs.
-> So here the ADC is configured with additional lines of code to get samples faster than 85µs by setting the prescaler to 16.
-> With this, you get ADC conversion every 20µs, […]

+ 8 - 0
messages.json

@@ -0,0 +1,8 @@
+{"ON0":  [1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1],
+ "ON1":  [1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1],
+ "T0":   [1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1],
+ "T1":   [1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1],
+ "F0":   [1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0],
+ "F1":   [1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0],
+ "OFF0": [1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0],
+ "OFF1": [1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0]}

+ 1 - 1
.gitignore → receive/.gitignore

@@ -1,2 +1,2 @@
 /build-*/
-/scope.py
+/plot.py

+ 1 - 1
Makefile → receive/Makefile

@@ -2,5 +2,5 @@ BOARD_TAG = uno
 include /usr/share/arduino/Arduino.mk
 
 # https://www.gnu.org/software/make/manual/html_node/Automatic-Variables.html
-run: scope.grc
+run: plot.grc
 	grcc --run $^

+ 0 - 0
arduino-sketch.ino → receive/arduino-sketch.ino


+ 123 - 9
scope.grc → receive/plot.grc

@@ -10,7 +10,7 @@ options:
     gen_linking: dynamic
     generate_options: qt_gui
     hier_block_src_path: '.:'
-    id: scope
+    id: plot
     max_nouts: '0'
     output_language: python
     placement: (0,0)
@@ -21,13 +21,13 @@ options:
     run_options: prompt
     sizing_mode: fixed
     thread_safe_setters: ''
-    title: Arduino Voltmeter / Oscilloscope
+    title: BAUMAX 13-26006/20 Xmas Tree Lights Remote Control Receiver
     window_size: ''
   states:
     bus_sink: false
     bus_source: false
     bus_structure: null
-    coordinate: [20, 20]
+    coordinate: [40, 27]
     rotation: 0
     state: enabled
 
@@ -41,9 +41,21 @@ blocks:
     bus_sink: false
     bus_source: false
     bus_structure: null
-    coordinate: [408, 37]
+    coordinate: [485, 40]
     rotation: 0
     state: enabled
+- name: symbol_rate_hz
+  id: variable
+  parameters:
+    comment: ''
+    value: 1/0.0008361370370370364
+  states:
+    bus_sink: false
+    bus_source: false
+    bus_structure: null
+    coordinate: [784, 41]
+    rotation: 0
+    state: true
 - name: blocks_message_debug_0
   id: blocks_message_debug
   parameters:
@@ -54,7 +66,7 @@ blocks:
     bus_sink: false
     bus_source: false
     bus_structure: null
-    coordinate: [1130, 378]
+    coordinate: [1158, 622]
     rotation: 0
     state: true
 - name: blocks_probe_rate_0
@@ -73,9 +85,51 @@ blocks:
     bus_sink: false
     bus_source: false
     bus_structure: null
-    coordinate: [530, 342]
+    coordinate: [565, 586]
     rotation: 0
     state: true
+- name: blocks_uchar_to_float_0
+  id: blocks_uchar_to_float
+  parameters:
+    affinity: ''
+    alias: ''
+    comment: ''
+    maxoutbuf: '0'
+    minoutbuf: '0'
+  states:
+    bus_sink: false
+    bus_source: false
+    bus_structure: null
+    coordinate: [629, 408]
+    rotation: 0
+    state: enabled
+- name: digital_symbol_sync_xx_0
+  id: digital_symbol_sync_xx
+  parameters:
+    affinity: ''
+    alias: ''
+    comment: ''
+    constellation: digital.constellation_bpsk().base()
+    damping: '1.0'
+    loop_bw: '0.045'
+    max_dev: '1.5'
+    maxoutbuf: '0'
+    minoutbuf: '0'
+    nfilters: '128'
+    osps: '1'
+    pfb_mf_taps: '[]'
+    resamp_type: digital.IR_MMSE_8TAP
+    sps: sample_rate_hz * 0.0008361370370370364
+    ted_gain: '1.0'
+    ted_type: digital.TED_MUELLER_AND_MULLER
+    type: ff
+  states:
+    bus_sink: false
+    bus_source: false
+    bus_structure: null
+    coordinate: [893, 284]
+    rotation: 0
+    state: enabled
 - name: qtgui_time_raster_sink_x_0
   id: qtgui_time_raster_sink_x
   parameters:
@@ -116,7 +170,7 @@ blocks:
     label8: ''
     label9: ''
     mult: '[]'
-    name: '""'
+    name: '"Signal"'
     ncols: int(sample_rate_hz)
     nconnections: '1'
     nrows: '60'
@@ -130,7 +184,64 @@ blocks:
     bus_sink: false
     bus_source: false
     bus_structure: null
-    coordinate: [555, 183]
+    coordinate: [557, 186]
+    rotation: 0
+    state: disabled
+- name: qtgui_time_raster_sink_x_0_0
+  id: qtgui_time_raster_sink_x
+  parameters:
+    affinity: ''
+    alias: ''
+    alpha1: '1.0'
+    alpha10: '1.0'
+    alpha2: '1.0'
+    alpha3: '1.0'
+    alpha4: '1.0'
+    alpha5: '1.0'
+    alpha6: '1.0'
+    alpha7: '1.0'
+    alpha8: '1.0'
+    alpha9: '1.0'
+    axislabels: 'True'
+    color1: '2'
+    color10: '0'
+    color2: '0'
+    color3: '0'
+    color4: '0'
+    color5: '0'
+    color6: '0'
+    color7: '0'
+    color8: '0'
+    color9: '0'
+    comment: ''
+    grid: 'True'
+    gui_hint: ''
+    label1: ''
+    label10: ''
+    label2: ''
+    label3: ''
+    label4: ''
+    label5: ''
+    label6: ''
+    label7: ''
+    label8: ''
+    label9: ''
+    mult: '[]'
+    name: '"Data"'
+    ncols: int(symbol_rate_hz)
+    nconnections: '1'
+    nrows: '60'
+    offset: '[]'
+    samp_rate: symbol_rate_hz
+    type: float
+    update_time: '0.10'
+    zmax: '1'
+    zmin: '0'
+  states:
+    bus_sink: false
+    bus_source: false
+    bus_structure: null
+    coordinate: [1587, 296]
     rotation: 0
     state: enabled
 - name: serial_source_block
@@ -158,7 +269,7 @@ blocks:
     baud_rate: '115200'
     buffer_max_length: int(sample_rate_hz/4)
     comment: ''
-    invert: 'False'
+    invert: 'True'
     maxoutbuf: '0'
     minoutbuf: '0'
     port: '''/dev/ttyUSB0'''
@@ -176,7 +287,10 @@ blocks:
 
 connections:
 - [blocks_probe_rate_0, rate, blocks_message_debug_0, print]
+- [blocks_uchar_to_float_0, '0', digital_symbol_sync_xx_0, '0']
+- [digital_symbol_sync_xx_0, '0', qtgui_time_raster_sink_x_0_0, '0']
 - [serial_source_block, '0', blocks_probe_rate_0, '0']
+- [serial_source_block, '0', blocks_uchar_to_float_0, '0']
 - [serial_source_block, '0', qtgui_time_raster_sink_x_0, '0']
 
 metadata:

+ 0 - 0
serial_source_block.py → receive/serial_source_block.py