Browse Source

flowchart: added voltage divider

Fabian Peter Hammerle 3 years ago
parent
commit
d8d70656a0
2 changed files with 69 additions and 14 deletions
  1. 1 1
      epy_block_0.py
  2. 68 13
      scope.grc

+ 1 - 1
epy_block_0.py

@@ -21,6 +21,6 @@ class ArduinoAnalogReadings(gnuradio.gr.sync_block):
             self._start_timestamp = time.time()
         output_items[0][0] = struct.unpack(">H", self._serial_port.read(2))[0]
         self._readings_counter += 1
-        if self._readings_counter % 1000 == 0:
+        if self._readings_counter % 4096 == 0:
             print(self._readings_counter / (time.time() - self._start_timestamp), "Hz")
         return 1

+ 68 - 13
scope.grc

@@ -27,7 +27,7 @@ options:
     bus_sink: false
     bus_source: false
     bus_structure: null
-    coordinate: [9, 19]
+    coordinate: [26, 23]
     rotation: 0
     state: enabled
 
@@ -41,7 +41,31 @@ blocks:
     bus_sink: false
     bus_source: false
     bus_structure: null
-    coordinate: [730, 64]
+    coordinate: [393, 199]
+    rotation: 0
+    state: true
+- name: resistor_1_ohm
+  id: variable
+  parameters:
+    comment: ''
+    value: 45.1e3
+  states:
+    bus_sink: false
+    bus_source: false
+    bus_structure: null
+    coordinate: [749, 18]
+    rotation: 0
+    state: true
+- name: resistor_2_ohm
+  id: variable
+  parameters:
+    comment: ''
+    value: 10.2e3
+  states:
+    bus_sink: false
+    bus_source: false
+    bus_structure: null
+    coordinate: [747, 117]
     rotation: 0
     state: true
 - name: sample_rate_hz
@@ -53,9 +77,39 @@ blocks:
     bus_sink: false
     bus_source: false
     bus_structure: null
-    coordinate: [437, 63]
+    coordinate: [67, 172]
     rotation: 0
     state: enabled
+- name: voltage_factor
+  id: variable
+  parameters:
+    comment: ''
+    value: (resistor_1_ohm + resistor_2_ohm) / resistor_2_ohm * 1.0271573754773708
+  states:
+    bus_sink: false
+    bus_source: false
+    bus_structure: null
+    coordinate: [752, 216]
+    rotation: 0
+    state: true
+- name: blocks_multiply_const_vxx_0
+  id: blocks_multiply_const_vxx
+  parameters:
+    affinity: ''
+    alias: ''
+    comment: ''
+    const: voltage_factor
+    maxoutbuf: '0'
+    minoutbuf: '0'
+    type: float
+    vlen: '1'
+  states:
+    bus_sink: false
+    bus_source: false
+    bus_structure: null
+    coordinate: [765, 313]
+    rotation: 0
+    state: true
 - name: blocks_short_to_float_0
   id: blocks_short_to_float
   parameters:
@@ -70,7 +124,7 @@ blocks:
     bus_sink: false
     bus_source: false
     bus_structure: null
-    coordinate: [409, 253]
+    coordinate: [426, 313]
     rotation: 0
     state: true
 - name: epy_block_0
@@ -86,7 +140,7 @@ blocks:
       \ output_items):\n        # pylint: disable=unused-argument\n        if not\
       \ self._start_timestamp:\n            self._start_timestamp = time.time()\n\
       \        output_items[0][0] = struct.unpack(\">H\", self._serial_port.read(2))[0]\n\
-      \        self._readings_counter += 1\n        if self._readings_counter % 1000\
+      \        self._readings_counter += 1\n        if self._readings_counter % 4096\
       \ == 0:\n            print(self._readings_counter / (time.time() - self._start_timestamp),\
       \ \"Hz\")\n        return 1\n"
     affinity: ''
@@ -103,7 +157,7 @@ blocks:
     bus_sink: false
     bus_source: false
     bus_structure: null
-    coordinate: [22, 221]
+    coordinate: [58, 281]
     rotation: 0
     state: true
 - name: qtgui_freq_sink_x_0
@@ -183,7 +237,7 @@ blocks:
     bus_sink: false
     bus_source: false
     bus_structure: null
-    coordinate: [768, 356]
+    coordinate: [776, 431]
     rotation: 0
     state: true
 - name: qtgui_number_sink_0
@@ -226,7 +280,7 @@ blocks:
     label7: ''
     label8: ''
     label9: ''
-    max: reference_voltage
+    max: reference_voltage*voltage_factor
     min: '0'
     name: '""'
     nconnections: '1'
@@ -246,7 +300,7 @@ blocks:
     bus_sink: false
     bus_source: false
     bus_structure: null
-    coordinate: [723, 489]
+    coordinate: [1109, 280]
     rotation: 0
     state: true
 - name: qtgui_time_sink_x_0
@@ -336,21 +390,22 @@ blocks:
     width8: '1'
     width9: '1'
     ylabel: Voltage
-    ymax: reference_voltage
+    ymax: reference_voltage*voltage_factor
     ymin: '0'
     yunit: '"V"'
   states:
     bus_sink: false
     bus_source: false
     bus_structure: null
-    coordinate: [768, 221]
+    coordinate: [1113, 127]
     rotation: 0
     state: true
 
 connections:
+- [blocks_multiply_const_vxx_0, '0', qtgui_number_sink_0, '0']
+- [blocks_multiply_const_vxx_0, '0', qtgui_time_sink_x_0, '0']
+- [blocks_short_to_float_0, '0', blocks_multiply_const_vxx_0, '0']
 - [blocks_short_to_float_0, '0', qtgui_freq_sink_x_0, '0']
-- [blocks_short_to_float_0, '0', qtgui_number_sink_0, '0']
-- [blocks_short_to_float_0, '0', qtgui_time_sink_x_0, '0']
 - [epy_block_0, '0', blocks_short_to_float_0, '0']
 
 metadata: