<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Expressive &#8211; IoT-devices, LLC &#8211; Electronics manufacturer for IoT</title>
	<atom:link href="https://iot-devices.com.ua/en/tag/expressive/feed/" rel="self" type="application/rss+xml" />
	<link>https://iot-devices.com.ua/en/</link>
	<description>Від модулів до складних пристроїв</description>
	<lastBuildDate>Wed, 24 Dec 2025 19:11:21 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://iot-devices.com.ua/wp-content/uploads/2020/05/iot-devices_logo_inversed_kromka_512x512_82ce62_white-100x100.jpg</url>
	<title>Expressive &#8211; IoT-devices, LLC &#8211; Electronics manufacturer for IoT</title>
	<link>https://iot-devices.com.ua/en/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Geiger counter emulator of GGreg20_V3 module by means of ESP8266 Part 3: Testing and Conclusion</title>
		<link>https://iot-devices.com.ua/en/geiger-counter-emulator-ggreg20_v3-module-by-means-of-esp8266-part3/</link>
		
		<dc:creator><![CDATA[iot-guru]]></dc:creator>
		<pubDate>Fri, 31 Mar 2023 12:58:07 +0000</pubDate>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[DIY]]></category>
		<category><![CDATA[emulator]]></category>
		<category><![CDATA[ESP12.OLED]]></category>
		<category><![CDATA[ESP8266]]></category>
		<category><![CDATA[Expressive]]></category>
		<category><![CDATA[Geiger]]></category>
		<category><![CDATA[geiger-counter]]></category>
		<category><![CDATA[GGreg20_V3]]></category>
		<category><![CDATA[GPIO]]></category>
		<category><![CDATA[iot]]></category>
		<category><![CDATA[LUA]]></category>
		<category><![CDATA[NodeMCU]]></category>
		<category><![CDATA[SBM20]]></category>
		<category><![CDATA[tindie]]></category>
		<category><![CDATA[unit test]]></category>
		<guid isPermaLink="false">https://iot-devices.com.ua/?p=2867</guid>

					<description><![CDATA[Testing the emulator After we&#8217;ve built the emulator and programmed the ESP8266, we can test it to make sure it&#8217;s working correctly. Having made the physical diagram and developed and loaded/compiled the Lua code into the controllers, we run the emulator and the main controller to check how our testbed works. As you can see, [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading"><a></a> Testing the emulator</h2>

<p>After we&#8217;ve built the emulator and programmed the ESP8266, we can test it to make sure it&#8217;s working correctly.</p>

<p>Having made the physical diagram and developed and loaded/compiled the Lua code into the controllers, we run the emulator and the main controller to check how our testbed works.</p>

<figure class="wp-block-image size-large"><a href="https://iot-devices.com.ua/wp-content/uploads/2023/01/esp12_oled_we_disp_ggreg20_hwemu-scaled.jpg"><img fetchpriority="high" decoding="async" width="1024" height="768" src="https://iot-devices.com.ua/wp-content/uploads/2023/01/esp12_oled_we_disp_ggreg20_hwemu-1024x768.jpg" alt="" class="wp-image-2589" srcset="https://iot-devices.com.ua/wp-content/uploads/2023/01/esp12_oled_we_disp_ggreg20_hwemu-1024x768.jpg 1024w, https://iot-devices.com.ua/wp-content/uploads/2023/01/esp12_oled_we_disp_ggreg20_hwemu-300x225.jpg 300w, https://iot-devices.com.ua/wp-content/uploads/2023/01/esp12_oled_we_disp_ggreg20_hwemu-768x576.jpg 768w, https://iot-devices.com.ua/wp-content/uploads/2023/01/esp12_oled_we_disp_ggreg20_hwemu-1536x1152.jpg 1536w, https://iot-devices.com.ua/wp-content/uploads/2023/01/esp12_oled_we_disp_ggreg20_hwemu-2048x1536.jpg 2048w, https://iot-devices.com.ua/wp-content/uploads/2023/01/esp12_oled_we_disp_ggreg20_hwemu-454x341.jpg 454w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption>Fig. GGreg20_V3 emulator testbed based on ESP12.OLED (MCU_B) connected to NodeMCU dev.board (MCU_A, not pictured)</figcaption></figure>

<p>As you can see, the connection of the emulator is very simple: the micro USB power cable and the pulse output signal wires, and you can also connect the debug console via UART if desired.</p>

<p>The following screenshots show the diagnostic data and their measurements. We also show an example of event distribution at the emulator output, that we built to clearly show how the random number generator of the ESP8266 controller works according to our proposed implementation via timers.</p>

<figure class="wp-block-image size-large"><a href="https://iot-devices.com.ua/wp-content/uploads/2023/01/10-ggreg20_v3_hwemu_esp12_oled_nodemcu_log_2022-12-01_222323.jpg"><img decoding="async" width="1024" height="631" src="https://iot-devices.com.ua/wp-content/uploads/2023/01/10-ggreg20_v3_hwemu_esp12_oled_nodemcu_log_2022-12-01_222323-1024x631.jpg" alt="" class="wp-image-2591" srcset="https://iot-devices.com.ua/wp-content/uploads/2023/01/10-ggreg20_v3_hwemu_esp12_oled_nodemcu_log_2022-12-01_222323-1024x631.jpg 1024w, https://iot-devices.com.ua/wp-content/uploads/2023/01/10-ggreg20_v3_hwemu_esp12_oled_nodemcu_log_2022-12-01_222323-300x185.jpg 300w, https://iot-devices.com.ua/wp-content/uploads/2023/01/10-ggreg20_v3_hwemu_esp12_oled_nodemcu_log_2022-12-01_222323-768x473.jpg 768w, https://iot-devices.com.ua/wp-content/uploads/2023/01/10-ggreg20_v3_hwemu_esp12_oled_nodemcu_log_2022-12-01_222323-454x280.jpg 454w, https://iot-devices.com.ua/wp-content/uploads/2023/01/10-ggreg20_v3_hwemu_esp12_oled_nodemcu_log_2022-12-01_222323.jpg 1421w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption>Fig. GGreg20_V3 emulator testbed based on ESP12.OLED (MCU_B) connected to NodeMCU dev.board (MCU_A, not pictured)</figcaption></figure>

<figure class="wp-block-image size-large"><a href="https://iot-devices.com.ua/wp-content/uploads/2023/01/10-ggreg20_v3_hwemu_esp12_oled_nodemcu_distribution_2022-12-01_222323.jpg"><img decoding="async" width="1024" height="397" src="https://iot-devices.com.ua/wp-content/uploads/2023/01/10-ggreg20_v3_hwemu_esp12_oled_nodemcu_distribution_2022-12-01_222323-1024x397.jpg" alt="" class="wp-image-2593" srcset="https://iot-devices.com.ua/wp-content/uploads/2023/01/10-ggreg20_v3_hwemu_esp12_oled_nodemcu_distribution_2022-12-01_222323-1024x397.jpg 1024w, https://iot-devices.com.ua/wp-content/uploads/2023/01/10-ggreg20_v3_hwemu_esp12_oled_nodemcu_distribution_2022-12-01_222323-300x116.jpg 300w, https://iot-devices.com.ua/wp-content/uploads/2023/01/10-ggreg20_v3_hwemu_esp12_oled_nodemcu_distribution_2022-12-01_222323-768x298.jpg 768w, https://iot-devices.com.ua/wp-content/uploads/2023/01/10-ggreg20_v3_hwemu_esp12_oled_nodemcu_distribution_2022-12-01_222323-1536x595.jpg 1536w, https://iot-devices.com.ua/wp-content/uploads/2023/01/10-ggreg20_v3_hwemu_esp12_oled_nodemcu_distribution_2022-12-01_222323-454x176.jpg 454w, https://iot-devices.com.ua/wp-content/uploads/2023/01/10-ggreg20_v3_hwemu_esp12_oled_nodemcu_distribution_2022-12-01_222323.jpg 1610w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption>Fig. Console output of the emulator (MCU B, left) and main controller (MCU A, right) working together.</figcaption></figure>

<p>As we can see, the events that the emulator generates at the output are chaotic, that is, they have a character where a cursory examination does not show a certain graphical pattern.</p>

<p>Here is another graph of a test set of 175 events per minute, but in a slightly different format. Note the horizontal axis. The value of the initial sequence numbers of events in the loop are arranged chaotically on this graph, as they happened in reality at the output of the emulator:</p>

<figure class="wp-block-image size-large"><a href="https://iot-devices.com.ua/wp-content/uploads/2023/01/10-ggreg20_v3_hwemu_esp12_oled_nodemcu_random_distribution_2022-12-07.jpg"><img loading="lazy" decoding="async" width="1024" height="476" src="https://iot-devices.com.ua/wp-content/uploads/2023/01/10-ggreg20_v3_hwemu_esp12_oled_nodemcu_random_distribution_2022-12-07-1024x476.jpg" alt="" class="wp-image-2595" srcset="https://iot-devices.com.ua/wp-content/uploads/2023/01/10-ggreg20_v3_hwemu_esp12_oled_nodemcu_random_distribution_2022-12-07-1024x476.jpg 1024w, https://iot-devices.com.ua/wp-content/uploads/2023/01/10-ggreg20_v3_hwemu_esp12_oled_nodemcu_random_distribution_2022-12-07-300x139.jpg 300w, https://iot-devices.com.ua/wp-content/uploads/2023/01/10-ggreg20_v3_hwemu_esp12_oled_nodemcu_random_distribution_2022-12-07-768x357.jpg 768w, https://iot-devices.com.ua/wp-content/uploads/2023/01/10-ggreg20_v3_hwemu_esp12_oled_nodemcu_random_distribution_2022-12-07-454x211.jpg 454w, https://iot-devices.com.ua/wp-content/uploads/2023/01/10-ggreg20_v3_hwemu_esp12_oled_nodemcu_random_distribution_2022-12-07.jpg 1529w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption>Fig. Graphical representation of 175 random events at the emulator output (left axis) and free memory (right axis) of the ESP8266 controller during a 60-second cycle</figcaption></figure>

<p>Of course, the verification of true randomness of events is not the goal of this publication and is far beyond its scope. We simply rely on the thesis that the ESP8266 has a hardware true random number generator.</p>

<h2 class="wp-block-heading"><a></a>Known limitations</h2>

<p>Among the known limitations of this method of creating a Geiger counter emulator is the memory size of the ESP826 controller, in which we create in a loop the required number of one-shot timers with random times of firing. Each timer, in fact, is a function that takes a certain amount of RAM.</p>

<p>When the timers are fired, the memory is immediately released. The execution of the code we developed resembles a spring, which in a cycle once a minute is sharply compressed and slowly uncompressed within the available memory of the controller.</p>

<p>Thus, the maximum possible number of events generated by our chosen method of generating random events at the emulator output directly depends on the amount of free RAM and the speed of the controller.</p>

<p>Experimentally we found that ESP8266 with NodeMCU firmware and Lua language can confidently generate about 260 events per minute. This is more than enough pulses per minute for the emulator project and the radiation levels it supposedly registers.</p>

<p>That is all we planned to tell you about. Now you know our version of how you can make your own Geiger counter emulator, as well as what and who can benefit from such a device. However, if you want to buy a ready-made emulator, you can do it on our website or on Tindie.</p>

<p>Site IoT-devices.com.ua: <a href="https://iot-devices.com.ua/en/product/gcemu20_v1-geiger-counter-emulator/">GCcemu20_V1</a></p>

<p>tindie.com: <a href="https://www.tindie.com/products/iotdev/gcemu20_v1-geiger-counter-emulator/" target="_blank" rel="noreferrer noopener">GCcemu20_V1</a></p>

<p>Overall, building a Geiger counter module emulator can be a fun and educational project. It allows you to simulate the readings of a Geiger counter module without the need for radioactive sources. We hope this guide has been helpful, and we encourage you to experiment with different components and programming techniques to customize your emulator further.</p>

<p>The beginning of the article:</p>

<p><a href="https://iot-devices.com.ua/en/geiger-counter-emulator-ggreg20_v3-module-by-means-of-esp8266-part1/">Geiger counter emulator of GGreg20_V3 module by means of ESP8266 Part 1: Introduction and Overview</a></p>

<p><a href="http://%D0%95%D0%BC%D1%83%D0%BB%D1%8F%D1%82%D0%BE%D1%80%20%D0%BB%D1%96%D1%87%D0%B8%D0%BB%D1%8C%D0%BD%D0%B8%D0%BA%D0%B0%20%D0%93%D0%B5%D0%B9%D0%B3%D0%B5%D1%80%D0%B0%20GGreg20_V3%20%D0%B7%D0%B0%D1%81%D0%BE%D0%B1%D0%B0%D0%BC%D0%B8%20ESP8266">Geiger counter emulator of GGreg20_V3 module by means of ESP8266 Part 2 Building the Emulator</a></p>

<p>Good luck!</p>

<p>IoT-devices LLC Team.</p>

<p> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Geiger counter emulator of GGreg20_V3 module by means of ESP8266 Part 2 Building the Emulator</title>
		<link>https://iot-devices.com.ua/en/geiger-counter-emulator-ggreg20_v3-module-by-means-of-esp8266-part2/</link>
		
		<dc:creator><![CDATA[iot-guru]]></dc:creator>
		<pubDate>Wed, 29 Mar 2023 11:50:27 +0000</pubDate>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[DIY]]></category>
		<category><![CDATA[emulator]]></category>
		<category><![CDATA[ESP12.OLED]]></category>
		<category><![CDATA[ESP8266]]></category>
		<category><![CDATA[Expressive]]></category>
		<category><![CDATA[Geiger]]></category>
		<category><![CDATA[geiger-counter]]></category>
		<category><![CDATA[GGreg20_V3]]></category>
		<category><![CDATA[GPIO]]></category>
		<category><![CDATA[iot]]></category>
		<category><![CDATA[LUA]]></category>
		<category><![CDATA[NodeMCU]]></category>
		<category><![CDATA[SBM20]]></category>
		<category><![CDATA[tindie]]></category>
		<category><![CDATA[unit test]]></category>
		<guid isPermaLink="false">https://iot-devices.com.ua/?p=2822</guid>

					<description><![CDATA[Geiger counter emulator: what we need To build the Geiger counter module emulator, we&#8217;ll need the following parts and materials: ESP8266 #1 as the main one (MCU_A, NodeMCU module); ESP8266 #2 as GGreg20_V3 emulator (MCU_B, ESP12.OLED module); Jumper wires; USB cable for programming and power. Next, we&#8217;ll need to program the main controller MCU_A and [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading" id="block-786c35cc-31be-43f0-a658-40945e2c73d7">Geiger counter emulator: what we need</h2>

<p>To build the Geiger counter module emulator, we&#8217;ll need the following parts and materials:</p>

<ul class="wp-block-list"><li>ESP8266 #1 as the main one (MCU_A, NodeMCU module);</li><li>ESP8266 #2 as GGreg20_V3 emulator (MCU_B, ESP12.OLED module);</li><li>Jumper wires;</li><li>USB cable for programming and power.</li></ul>

<p>Next, we&#8217;ll need to program the main controller MCU_A and emulation software script code GGreg20_V3 for MCU_B.</p>

<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p><strong>Note 3</strong>. We will give examples in this publication with our own <a href="https://iot-devices.com.ua/en/product/esp12oled-universal-esp8266-mcuboard-oled-en/">ESP12.OLED</a> modules. However, if you do not have an ESP12.OLED module, you can also use an ESP8266-based development board such as the NodeMCU and develop the software yourself, following the examples in the text. If you wish to use an off-the-shelf device please read the rest of this article because we have provided a link to our ready-to-use emulator module which you can buy further on.</p></blockquote>

<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p><strong>Note 4.</strong> In this, as in other publications, we will give examples using the simple and powerful Lua scripting language available in the popular NodeMCU firmware.</p></blockquote>

<h2 class="wp-block-heading" id="block-fa9009c2-5b8c-41b0-bb8a-10108721c789">The budget of the inputs/outputs we need</h2>

<p id="block-72e01d54-951b-4117-8327-b53872654d3a">On the main layout controller, we must define the input/output ports that will perform the task of recording input pulses from the Geiger counter emulator module.</p>

<p id="block-dc43f265-c4cd-4a94-8940-0af029bf502d">On the Geiger counter emulator module we need a bit more ports. Here we need I/O ports: for emulation of output pulses, for RGB LED and for the switch button of the emulator operation mode.</p>

<figure class="wp-block-table"><table><tbody><tr><td><br/></td><td>MCU_A role (Main Contr.)</td><td>MCU_B role (GC emulator)</td></tr><tr><td>1 х GPIO of input pulse counter</td><td>NodeMCU</td><td>&#8211;</td></tr><tr><td>1 х GGreg20_V3 output emulation GPIO</td><td>&#8211;</td><td>ESP12.OLED</td></tr><tr><td>3 х RGB LED GPIO for GGreg20_V3 output pulses indication</td><td>&#8211;</td><td>ESP12.OLED</td></tr><tr><td>1х GPIO of the emulator mode switch button</td><td>&#8211;</td><td>ESP12.OLED</td></tr></tbody></table></figure>

<p>Wiring diagram</p>

<p id="block-c6b2cc85-b3fb-4407-a53a-677106212716">To make the interaction between the main controller and the GGreg20_V3 module emulator look realistic, we suggest taking advantage of the built-in properties of some I/O ports of the ESP12.OLED board and select the following GPIOs on the MCU_B emulator controller:</p>

<ul class="wp-block-list" id="block-f010198d-685b-4fee-b4d6-3e1d8f38aeb3"><li>we recommend using GPIO4/D2 (GPIO D-index in Lua) to emulate the pulse output of GGreg20_V3;</li><li>we can use the Flash button (GPIO0/D3) built into the ESP12.OLED board to switch the emulator operation modes;</li><li>the built-in RGB LED on the ESP12.OLED module takes GPIO14/D5; GPIO12/D6; GPIO13/D7;</li></ul>

<p id="block-2527070a-42a1-48e0-983b-6cfc16e216fc">On the main module of the MCU_A controller we propose to select the following port for the input pulse counter:</p>

<ul class="wp-block-list" id="block-c8feffc1-6e34-42d2-b70e-3b3631fb85fb"><li>GPIO14 / D5.</li></ul>

<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p><strong>Note 5</strong>. We recommend the following materials as background information on port numbering: </p><p>The standard for planning and applying pins was developed by alterstrategy.lab: <a href="https://alterstrategy.com/recommended-pin-use-standard/" target="_blank" rel="noopener">https://alterstrategy.com/recommended-pin-use-standard/</a> </p><p>NodeMCU firmware documentation: <a href="https://nodemcu.readthedocs.io/en/latest/modules/gpio/" target="_blank" rel="noopener">https://nodemcu.readthedocs.io/en/latest/modules/gpio/</a> </p><p>Documentation for the ESP12.OLED module is on the website: <a href="https://iot-devices.com.ua/en/product/esp12oled-universal-esp8266-mcuboard-oled-en/">https://iot-devices.com.ua/en/product/esp12oled-universal-esp8266-mcuboard-oled-en/</a> </p><p>and on Tindie: <a href="https://www.tindie.com/products/iotdev/esp12oled-universal-esp8266096oled-mcu-board/" target="_blank" rel="noopener">https://www.tindie.com/products/iotdev/esp12oled-universal-esp8266096oled-mcu-board/</a></p></blockquote>

<p id="block-0017d8d7-e663-4e4b-8d4e-d20072cdf305">Let&#8217;s update the table with the specific I/O ports we selected:</p>

<figure class="wp-block-table"><table><tbody><tr><td><br/></td><td>MCU_A role</td><td>MCU_B role</td></tr><tr><td>1 х GPIO of input pulse counter</td><td>NodeMCU GPIO14/ D5</td><td>&#8211;</td></tr><tr><td>1 х GGreg20_V3 output emulation GPIO</td><td>&#8211;</td><td>ESP12.OLED GPIO4 / D2</td></tr><tr><td>3 х RGB LED GPIO for GGreg20_V3 output pulses indication</td><td>&#8211;</td><td>ESP12.OLED GPIO14 / D5 GPIO12 / D6 GPIO13 / D7</td></tr><tr><td>1х GPIO of the emulator mode switch button</td><td>&#8211;</td><td>ESP12.OLED GPIO0 / D3</td></tr></tbody></table></figure>

<p>﻿</p>

<figure class="wp-block-image size-full" id="block-3e816c74-b488-4f9c-af8a-46e7b768c80c"><a href="https://iot-devices.com.ua/wp-content/uploads/2023/01/10-the-esp12.oled-geiger-counter-emulator-and-nodemcu-wiring-diagram.jpg"><img loading="lazy" decoding="async" width="960" height="540" src="https://iot-devices.com.ua/wp-content/uploads/2023/01/10-the-esp12.oled-geiger-counter-emulator-and-nodemcu-wiring-diagram.jpg" alt="" class="wp-image-2587" srcset="https://iot-devices.com.ua/wp-content/uploads/2023/01/10-the-esp12.oled-geiger-counter-emulator-and-nodemcu-wiring-diagram.jpg 960w, https://iot-devices.com.ua/wp-content/uploads/2023/01/10-the-esp12.oled-geiger-counter-emulator-and-nodemcu-wiring-diagram-300x169.jpg 300w, https://iot-devices.com.ua/wp-content/uploads/2023/01/10-the-esp12.oled-geiger-counter-emulator-and-nodemcu-wiring-diagram-768x432.jpg 768w, https://iot-devices.com.ua/wp-content/uploads/2023/01/10-the-esp12.oled-geiger-counter-emulator-and-nodemcu-wiring-diagram-800x450.jpg 800w, https://iot-devices.com.ua/wp-content/uploads/2023/01/10-the-esp12.oled-geiger-counter-emulator-and-nodemcu-wiring-diagram-454x255.jpg 454w" sizes="(max-width: 960px) 100vw, 960px" /></a><figcaption>Fig. Connection of modules using two ESP8266 hardware controllers. As MCU_B &#8211; ESP12.OLED module. As MCU_A &#8211; NodeMCU module.</figcaption></figure>

<h2 class="wp-block-heading" id="block-cb422977-8184-4a88-9c04-66d8e4c95e9d"><br/>Emulator operating modes</h2>

<p id="block-4228e826-79a4-4376-aad4-045e96815dc7">In order for our GGreg20_V3 emulator to be able to simulate operation under conditions of different radiation levels, we propose to implement the possibility to switch the radiation power range, which is as if measured by the device and fed to the pulse output.</p>

<p id="block-4e0350bb-494c-480f-b831-a6e3d0c4b3ce">By pressing the Flash button (D3), the user can alternately switch modes to select the desired one.</p>

<p id="block-8566cf3a-6d34-494a-a1c4-9783454ba6ad">To make the emulator easy to use, the ESP12.OLED&#8217;s RGB LED flashes in different colors that can be easily distinguished by the human eye. Each emulator operating mode has its own color assigned to it. Therefore, when the emulator gives the pulse output a signal about a simulated detection the LED will also blink in the color of the current mode of operation.</p>

<h2 class="wp-block-heading" id="block-63c378b0-b723-4c14-a913-697192337a31">Radiation level ranges</h2>

<p id="block-d791023e-f3f0-4cb0-a8d6-56b4f2d848c6">We propose to implement the emulation of the following ranges of ambient radiation, which MCU_B will simulate:</p>

<p id="block-b19d8848-2821-488d-9731-af30f8d6a932">Mode 0. No pulses (sensor error simulation);</p>

<p id="block-b78e9cf4-f0ce-4bb5-a037-2e465dbc7279">Mode 1. Natural background radiation: 0.1 &#8211; 0.2 µSv/h;</p>

<p id="block-fcdb4d5e-1a51-47d4-b7eb-656d53f9f600">Mode 2. Acceptable level: 0.2 &#8211; 0.3 µSv/h;</p>

<p id="block-2b79a053-b8bb-4548-ad17-d8f31bb58219">Mode 3. Increased level: 0.3 &#8211; 0.6 µSv/hour;</p>

<p id="block-555eda96-59ee-425b-b6bb-29b4d1775ecf">Mode 4. Dangerous level: 0.6 µSv/hour &#8211; 1.5 µSv/hour.</p>

<p id="block-636beefb-1875-4800-b434-371a282b0432">By default, the module will start after applying power, from &#8220;Mode 1&#8221;. We chose this mode as the initial one only because it is convenient when, after applying power, we immediately receive pulses at the level of background radiation.</p>

<p id="block-e688333a-52ff-469c-b8f4-9f9559f976a6">The real GGreg20_V3 module is equipped with a Soviet-made SBM-20 Geiger tube. This tube has the following conversion factor of pulses per minute to microsieverts per hour:</p>

<p class="has-text-align-center" id="block-57d145ae-f971-436c-9dc2-ea5b1f3946aa">μSv per hour = CPM * 0.0057</p>

<p id="block-5f2d88d1-fa2a-4c1c-b998-6c2d35b5188d">Let’s perform the reverse operation to calculate for the radiation ranges the appropriate number of pulses per hour that the emulator would have to generate while operating in a certain mode:</p>

<p class="has-text-align-center" id="block-1a1a2729-0148-4991-a7c5-b8d7190e5969">CPM = μSv per hour/ 0.0057</p>

<p id="block-939c0593-7e19-41fe-940b-0d34f5a5af24">We make a rough calculation so as to form power ranges which do not overlap in value:</p>

<p id="block-a0935c72-ddee-4500-92dd-caa443833e00">Mode 0. 0 CPM;</p>

<p id="block-bfbf37c0-e77a-40bb-a524-aecffb2f5ffc">Mode 1. 18 CPM to 35 CPM;</p>

<p id="block-9b5a7549-1217-4a21-862e-6123d5f1fcc0">Mode 2. 36 CPM to 52 CPM;</p>

<p id="block-a28b6f7b-2535-426d-97c5-289e31330abe">Mode 3. 53 CPM to 105 CPM;</p>

<p id="block-4d52fbd2-bff2-4f66-b1a7-44a17677efb3">Mode 4. від 106 CPM до 264 CPM.</p>

<p id="block-0761ad79-1104-4eb4-8586-2b413119bad9">The correlation of the color of the RGB LED flashes to a certain mode of operation is as follows:</p>

<figure class="wp-block-table"><table><tbody><tr><td><strong>Operation mode</strong></td><td><strong>Flash color</strong></td><td><strong>R</strong></td><td><strong>G</strong></td><td><strong>B</strong></td></tr><tr><td>Mode 0</td><td>no flashes black</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Mode 1</td><td>cyan</td><td>0</td><td>1</td><td>1</td></tr><tr><td>Mode 2</td><td>green</td><td>0</td><td>1</td><td>0</td></tr><tr><td>Mode 3</td><td>red</td><td>1</td><td>0</td><td>0</td></tr><tr><td>Mode 4</td><td>magenta</td><td>1</td><td>0</td><td>1</td></tr></tbody></table></figure>

<p>Now we have to write the appropriate Lua-code for the MCU_A role and for the MCU_B role.</p>

<h2 class="wp-block-heading" id="block-f6fa38ba-c4f6-4484-9e32-cb4c380574d4"><strong>Example</strong>. Geiger counter code for the main controller (MCU_A role)</h2>

<p id="block-923bc983-837f-4384-9148-96385e6b3e3b">We take this code from GitHub here:</p>

<p><a href="https://github.com/iotdevicesdev/ggreg20-v3-nodemcu-lua-example" target="_blank" rel="noopener">https://github.com/iotdevicesdev/ggreg20-v3-nodemcu-lua-example</a></p>

<p id="block-0979654a-2651-4027-abcd-2ff33ce599d4">The code from GitHub is completely ready to use. To run the code, you need to download it from the Internet and upload it to the controller, for example to the NodeMCU module, as in our case. You also need to write another Lua-script and load it into the controller as well:</p>

<pre class="wp-block-code"><code>-- filename: mcu_a.lua
-- MCU_A Lua code example
-- Copyright 2022 IoT-devices LLC, Kyiv, Ukraine
dofile('ggreg20_v3_nodemcu_firmware_lua_example.lua')
init(5, 1, 60000)

function snsrUpd()
ma5_rad_lvl, cpm, minutes = read()
print(ma5_rad_lvl, cpm, minutes)
end

snsrUpd_tmr = tmr.create()
snsrUpd_tmr:register(60000, tmr.ALARM_AUTO, function() snsrUpd() end)
snsrUpd_tmr:start()</code></pre>

<h2 class="wp-block-heading" id="block-245d7efc-1d20-42e3-b2d1-14d29e6b7cb1"><strong>Example</strong>. Code for the GGreg20_V3 module emulator (MCU_B role)</h2>

<p id="block-6f398d6f-0323-4900-81bf-fb082b4bb006">The Lua documentation tells us that in high-speed tasks we need to reassign global identifiers to local identifiers, which increases execution speed by a factor of ten. Therefore, we will do it as follows:</p>

<pre class="wp-block-code"><code>local gpio = gpio
local mode = gpio.mode
local trig = gpio.trig
local write = gpio.write
local read = gpio.read
local INT = gpio.INT
local OUTPUT = gpio.OUTPUT
local FLOAT = gpio.FLOAT
local HIGH = gpio.HIGH
local LOW = gpio.LOW
local PULLUP = gpio.PULLUP
local print = print

local tmr = tmr
local create = tmr.create
local now = tmr.now
local delay = tmr.delay
local alarm = tmr.alarm
local ALARM_SINGLE = tmr.ALARM_SINGLE
local ALARM_SEMI = tmr.ALARM_SEMI
local ALARM_AUTO = tmr.ALARM_AUTO
local register = tmr.register
local start = tmr.start
local stop = tmr.stop

local node = node
local heap = node.heap
local random = node.random</code></pre>

<p id="block-02068264-0668-452a-a175-d7f2197ecf05">We also need to configure the GPIOs that will be responsible for their functions (see above):</p>

<pre class="wp-block-code"><code>mode(3,INT,FLOAT)
mode(4,OUTPUT, PULLUP)
write(4, HIGH)</code></pre>

<p id="block-67fa4fe3-dab6-44c3-b317-89d685a65809">To generate pulses that simulate the output interface of GGreg20_V3, we need to randomly run the following function:</p>

<pre class="wp-block-code"><code>local function pulseOut()
	write(4, LOW)
	delay(10)
	write(4, HIGH)
end</code></pre>

<p id="block-76bde581-ad02-443e-9b0e-1b0b5a802151">But in order to fully emulate the Geiger counter, it is not enough to just run <code>pulseOut()</code> a certain number of times per minute. In fact it is more complicated and we need to run<code>pulseOut()</code>, in such a way that the real randomness of the appearance of pulses on the ESP8266 output is performed.</p>

<p id="block-45dc16f8-88b4-48cc-b315-92da5ffdc8af">Given the extensive capabilities of the platform, we could even suggest several ways to implement this functionality, but we will limit ourselves to one of them, the one that, in our opinion, reproduces the pulse randomness of the real Geiger counter module as much as possible.</p>

<p id="block-0b0c2c3e-e7e7-4aaf-a30c-395557aa8674">To do that we need to use a random number generator, which, according to the NodeMCU firmware documentation, is capable of generating real random numbers. The firmware has a ready-made method node.random() for this purpose. <code>node.random().</code></p>

<p id="block-c0c54a29-d8c5-4824-896e-cc3ce2eae785">To distribute a chosen number of pulses chaotically for one minute, we will use timers, which can be created in a theoretically unlimited number:</p>

<pre class="wp-block-code"><code>create():alarm(timer timeout, timer type, callback function)</code></pre>

<p id="block-a4766066-59e9-40ea-9b6e-8cfbb48c83e8">The only limitation is the amount of free RAM of the controller. Experimentally, we found that we can easily create about 260 pulses per minute in this way, which fits into our requirements for the maximum level of virtual radiation that our emulator can reproduce.</p>

<p id="block-cc004032-5661-4186-9c8c-e28b279f3726">Thus, the function that creates random<code>pulseOut(),</code> start timeouts in the loop looks like this</p>

<pre class="wp-block-code"><code>local t_start = 0
local count = 0
local function randGen(pulses)
	for i = 1, pulses do -- pulses
			create():alarm(random(60000), ALARM_SINGLE, 
				function()
						print(heap(), count, i, (now() - t_start)/1000000)
						pulseOut()
				end
			)
	end
end</code></pre>

<p id="block-2b32df03-eab1-4d84-b60f-00e71a4c3ead">Working together, our developed functions <code>randGen(<em>pulses</em>)</code> and <code>pulseOut()</code> create on the ESP8266 output the necessary number of absolutely random pulses of 10 microseconds each per one minute.</p>

<p id="block-70e9c748-19dd-4028-bbb7-5fe1f0280797">We set the number of pulses per minute with the parameter <em><code>pulses</code></em>.</p>

<p id="block-4a90ceb2-c169-4711-9d49-5b43bb34435e">In order for the emulator to work in different power modes of simulated radiation it is necessary to provide a random value of the number of impulses <code><em>pulses</em>,</code> falling as a task at the input of the randGen() function <code>randGen().</code> . This can be done as follows:</p>

<pre class="wp-block-code"><code>radMode = 1
rand_tmr = create()
rand_tmr:register(1000, ALARM_AUTO, 
	function()
		if radMode == 0 and running == 0 then 
			print(heap(), 'Mode0:Snsr Err emu')
			return 0
		end
		local num = 0
		if radMode == 1 then 
			num = random(math.ceil(18),math.ceil(35))
		elseif radMode == 2 then
			num = random(math.ceil(36),math.ceil(52))
		elseif radMode == 3 then
			num = random(math.ceil(53),math.ceil(105))
		elseif radMode == 4 then
			num = random(math.ceil(106),math.ceil(264))
		end
		if num ~= 0 then print('count:',count + 1,'mode:',radMode, 'num:',num); randGen(num) end
	end
)

rand_tmr:start()</code></pre>

<p id="block-e5b05b89-d43b-4a2d-8e18-2bffffe503be">By setting the value of the global variable <em><code>radMode</code></em>, the user can specify one of five modes of ionizing radiation power reproduced at the emulator output.</p>

<p id="block-601d0a86-27e4-4066-a9a4-61d3770b1b94">The last thing we need to provide in the emulator is to switch the radiation power mode using the built-in Flash/GPIO0/D3 button:</p>

<pre class="wp-block-code"><code>trig(3, 'down', 
	function(lvl, ts, cnt)
		if radMode &lt; 4 then radMode = radMode + 1 else radMode = 0 end
		print ('New radMode:', radMode)
	end
)</code></pre>

<h3 class="wp-block-heading" id="block-1b688a62-cea2-48b8-811d-2e5cde4c87b1">Full emulator software code</h3>

<p id="block-be1e5721-a28c-4eb4-9552-eb301bf23577">We don&#8217;t have a ready-made example for this controller role, as was the case with the main controller (MCU_A). So we will write the necessary code from scratch. Here is the minimum required code capable of emulating Geiger counter pulses.</p>

<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p><strong>Note 6.</strong> The code in this section is an example. You can download and set up this example yourself in your own Geiger counter emulator, or purchase a ready-to-use hardware module with firmware and fully functional software from our shop or Tindie at the following links:</p><p>IoT-devices.com.ua: <a href="https://iot-devices.com.ua/en/product/gcemu20_v1-geiger-counter-emulator/">GCcemu20_V1</a></p><p>Tindie: <a href="https://www.tindie.com/products/iotdev/gcemu20_v1-geiger-counter-emulator/" target="_blank" rel="noopener">GCcemu20_V1</a></p></blockquote>

<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p><strong>Warning!</strong> This example code has its own limitations and differs significantly from the code we have developed for commercial use and sell as part of the emulator product on our website and other commercial sites.</p></blockquote>

<pre class="wp-block-code"><code>-- filename: mcu_b.lua
-- MCU_B Lua code example
-- Copyright 2022 IoT-devices LLC, Kyiv, Ukraine
local t_start = 0
local count = 0
radMode = 0

local gpio = gpio
local mode = gpio.mode
local trig = gpio.trig
local write = gpio.write
local read = gpio.read
local INT = gpio.INT
local OUTPUT = gpio.OUTPUT
local FLOAT = gpio.FLOAT
local HIGH = gpio.HIGH
local LOW = gpio.LOW
local PULLUP = gpio.PULLUP
local print = print

local tmr = tmr
local create = tmr.create
local now = tmr.now
local delay = tmr.delay
local alarm = tmr.alarm
local ALARM_SINGLE = tmr.ALARM_SINGLE
local ALARM_SEMI = tmr.ALARM_SEMI
local ALARM_AUTO = tmr.ALARM_AUTO
local register = tmr.register
local start = tmr.start
local stop = tmr.stop

local node = node
local heap = node.heap
local random = node.random

mode(3,INT,FLOAT)
mode(4,OUTPUT, PULLUP)
write(4, HIGH)

local function pulseOut()
	write(4, LOW)
	delay(10)
	write(4, HIGH)
end

local function randGen(pulses)
	for i = 1, pulses do -- pulses
			create():alarm(random(60000), ALARM_SINGLE, 
				function()
						print(heap(), count, i, (now() - t_start)/1000000)
						pulseOut()
				end
			)
	end
end

rand_tmr = create()
rand_tmr:register(1000, ALARM_AUTO, 
	function()
		if radMode == 0 and running == 0 then 
			print(heap(), 'Mode0:Snsr Err emu')
			return 0
		end
		local num = 0
		if radMode == 1 then 
			num = random(math.ceil(18),math.ceil(35))
		elseif radMode == 2 then
			num = random(math.ceil(36),math.ceil(52))
		elseif radMode == 3 then
			num = random(math.ceil(53),math.ceil(105))
		elseif radMode == 4 then
			num = random(math.ceil(106),math.ceil(264))
		end
		if num ~= 0 then print('count:',count + 1,'mode:',radMode, 'num:',num); randGen(num) end
	end
)

rand_tmr:start()

trig(3, 'down', 
	function(lvl, ts, cnt)
		if radMode &lt; 4 then radMode = radMode + 1 else radMode = 0 end
		print ('New radMode:', radMode)
	end
)</code></pre>

<p>Початок статті: <a href="https://iot-devices.com.ua/en/geiger-counter-emulator-ggreg20_v3-module-by-means-of-esp8266-part1/">Geiger counter emulator of GGreg20_V3 module by means of ESP8266: Part 1. Introduction and Overview </a></p>

<p>The conclusion of the article will be in the next publication in a few days:<br/>Geiger counter emulator of GGreg20_V3 module by means of ESP8266: Part 3. Testing and Conclusion</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Geiger counter emulator of GGreg20_V3 module by means of ESP8266</title>
		<link>https://iot-devices.com.ua/en/geiger-counter-emulator-ggreg20_v3-module-by-means-of-esp8266-part1/</link>
		
		<dc:creator><![CDATA[iot-guru]]></dc:creator>
		<pubDate>Mon, 27 Mar 2023 18:55:25 +0000</pubDate>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[DIY]]></category>
		<category><![CDATA[emulator]]></category>
		<category><![CDATA[ESP12.OLED]]></category>
		<category><![CDATA[ESP8266]]></category>
		<category><![CDATA[Expressive]]></category>
		<category><![CDATA[Geiger]]></category>
		<category><![CDATA[geiger-counter]]></category>
		<category><![CDATA[GGreg20_V3]]></category>
		<category><![CDATA[GPIO]]></category>
		<category><![CDATA[iot]]></category>
		<category><![CDATA[LUA]]></category>
		<category><![CDATA[NodeMCU]]></category>
		<category><![CDATA[SBM20]]></category>
		<category><![CDATA[tindie]]></category>
		<category><![CDATA[unit test]]></category>
		<guid isPermaLink="false">https://iot-devices.com.ua/?p=2799</guid>

					<description><![CDATA[Welcome to our guide on building a hardware-software Geiger counter emulator of GGreg20_V3 module based on ESP8266 This emulator can be useful for testing and tuning Geiger counters or for educational purposes. Let&#8217;s get started! Updated: When writing this article, we decided to make a separate commercial product &#8211; the Geiger counter emulator GCemu20_V1. Part [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>Welcome to our guide on building a hardware-software Geiger counter emulator of <a href="https://iot-devices.com.ua/en/product/ggreg20_v3-ionizing-radiation-detector-with-geiger-tube-sbm-20/">GGreg20_V3</a> module based on ESP8266 This emulator can be useful for testing and tuning Geiger counters or for educational purposes. Let&#8217;s get started!</p>

<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p><strong>Updated: </strong> When writing this article, we decided to make a separate commercial product &#8211; the Geiger counter emulator <a href="https://iot-devices.com.ua/en/product/gcemu20_v1-geiger-counter-emulator/">GCemu20_V1</a>.</p></blockquote>

<h2 class="wp-block-heading">Part 1: Introduction and Overview</h2>

<p>It is known that the Espressif ESP8266 module has a very high quality random number generator. We could not find any official details about the actual implementation of this generator, so we propose to read the material on this subject, published by a radio amateur and saved on the Internet:</p>

<p><a href="https://web.archive.org/web/20170321162556/http://esp8266-re.foogod.com/wiki/Random_Number_Generator" target="_blank" rel="noopener">https://web.archive.org/web/20170321162556/http://esp8266-re.foogod.com/wiki/Random_Number_Generator</a></p>

<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p><strong>Warning</strong>. Two different concepts with the same name are used in the text. Historically, there is a NodeMCU hardware module on the market as well as NodeMCU software firmware. </p><p>The NodeMCU firmware is a compilable, open-source microprogram that can be written to hardware modules with Espressif&#8217;s ESP8266 controller. One of the many products based on the ESP8266 controller, is the NodeMCU hardware module. </p><p>Thus the NodeMCU firmware can be written to the NodeMCU hardware module. Later in this article we will try, if possible, to clarify what is meant by the name NodeMCU: module or firmware.</p></blockquote>

<h2 class="wp-block-heading"><a></a>What is a Geiger counter emulator for</h2>

<p>Before proceeding to create a Geiger counter emulator, it is necessary to consider what for and who may need such a hardware-software device.</p>

<p>The main idea of any emulator in the field of DIY electronics is to temporarily, at certain stages, use a virtual substitute component instead of a real module in the process of IoT device development or experimenting / learning to reproduce the operation and characteristics of a real device with high accuracy. The emulator should simplify and speed up development, as well as add convenience in the initial stages of a planned project or performing unit tests.</p>

<p>Below we present some theses explaining our motives for developing the GGreg20_V3 Geiger counter module emulator.</p>

<h3 class="wp-block-heading">1.No high voltage</h3>

<p>The GGreg20_V3 emulator, unlike the real module, has no high voltage on the board, so it is very convenient to use when developing on the table without fear of accidental electrocution.</p>

<p>At the same time, in terms of the electrical interface of the outgoing pulses, the emulator is a completely similar radiation sensor module, generating random pulses of the same shape and duration as the genuine GGreg20_V3.</p>

<h3 class="wp-block-heading">2. Simplified learning process</h3>

<p>The Geiger counter emulator is suitable for educational institutions. The instructor can gradually deepen practical lessons with students.</p>

<p>First, all classes can be conducted using safe and cheap Geiger counter emulators, and then with real modules with Geiger tubes and high voltage on the tube side. Just like in the Army: familiarization and training is done first with blank cartridges, and only then with live ones.</p>

<p>The emulator fully reproduces the results of the real GGreg20_V3 module, so there is no problem of insufficient number of real modules in the classroom: each student can work with his module independently and complete the learning process without dividing into groups or queues, as it usually happens when resources of training devices and stands in the lab are limited.</p>

<h3 class="wp-block-heading">3. Lower cost</h3>

<p>The emulator has a lower cost than the real GGreg20_V3 module, so it is convenient to use it primarily for debugging and harmonizing the circuit or software of the system being designed or studied.</p>

<p>Debugging a test bench or a project with such an emulator can be performed without the need for specially qualified personnel.</p>

<p>If the emulators are used by students, then the teacher will not need to control the work with the devices, as would be necessary to do with the real Geiger counter module.</p>

<p>Low-cost emulators can be purchased in large quantities and given to students for the duration of their studies, not just for the time they work in the school&#8217;s laboratory.</p>

<h3 class="wp-block-heading">4. No real source of radiation is needed</h3>

<p>When we work with a real GGreg20_V3, we need a true source of radiation to reproduce the various situations that need to be considered in the software of the measurement system that is being designed or tested. In order to buy a test radiation source, the radio amateur must first solve a number of problems:</p>

<ul class="wp-block-list"><li>to determine by physical and chemical parameters which source is needed;</li><li>to find a supplier and buy a test source;</li><li>some countries require customs notification and an import permit;</li><li>the test source can only be of a certain power;</li><li>you must properly store and dispose of the radioactive source;</li><li>the price of the radiation source and its storage system exceeds many times the price of the Geiger counter.</li></ul>

<p>With the emulator, none of these problems will occur. T he device can simulate 5 different modes of ionizing radiation power. The Geiger counter emulator generates output pulses similar to those of the real GGreg20_V3 module in the range from 0 to 1.5 µSv/h (taking the SBM-20 tube as a similar reference). At the output are generated chaotic (using a true random number generator ESP8266) pulses of the same amplitude with a total pulse period of 10 microseconds each.</p>

<h3 class="wp-block-heading">5. Emulator resource cannot be depleted</h3>

<p>SBM-20 tube, installed in GGreg20_V3, has a relatively large, but still limited resource of particles, which it can detect during its lifetime.</p>

<p>The resource of the SBM-20 tube declared in the documentation is at least 2*10<sup>10</sup> pulses.</p>

<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p><strong>Note 1</strong>. With a background radiation of 0.15 μSv/h with a coefficient of 0.0057, the SBM-20 tube detects about 27 pulses per minute.</p></blockquote>

<p>Thus, under normal conditions, the resource of the tube will be enough for 2*10<sup>10</sup> / (27 * 60 * 24) = 20 000 000 000 / (26 * 60 * 24) = 514403 days. And it would seem that this is quite a sufficient potential life of one tube.</p>

<p>A completely different picture is observed when it comes to operating a tube with a test source of radiation.</p>

<p>Here&#8217;s an example:</p>

<p>On its website, Images Scientific Instruments provides a list of the radiation limits allowed for import for test sources:</p>

<p><a href="https://www.imagesco.com/geiger/radioactive-sources-int.html" target="_blank" rel="noopener">https://www.imagesco.com/geiger/radioactive-sources-int.html</a></p>

<p>Let&#8217;s take two sources from the list at the link:</p>

<ol class="wp-block-list"><li>Co-60 1.00 uCi, 37000 Bq;</li><li>Cs-137 0.25 uCi, 9250 Bq;</li></ol>

<p>If we assume that under the influence of such a test source, half of the particles from radioactive decays enter the Geiger tube SBM-20 then the lifetime of such a tube would be:</p>

<ol class="wp-block-list"><li>20 000 000 000 / (37000 / 2 * 60 * 60 * 24) = 12 days (for Co-60);</li><li>20 000 000 000 / (9250 / 2 * 60 * 60 * 24) = 50 days (for Cs-137).</li></ol>

<p>As you can see, if we want to experiment (or test our devices that include a Geiger counter) on a real tube, then we deplete its available resource with a true source of radiation rather quickly.</p>

<p>There is no such problem with the emulator. Using the emulator first instead of the tube is economically feasible.</p>

<h3 class="wp-block-heading">  6. Debugging data in the UART</h3>

<p>The emulator of GGreg20_V3 module outputs operational data (pulses, time, counts, cycles, etc.) to the UART console port during operation, which, if necessary, can be recorded and processed by the student, developer or radio amateur for training or comparison with the measurements of his tested or developed system.</p>

<p>Genuine GGreg20_V3 counter modules and similar modules of other manufacturers do not and cannot have such a built-in feature.</p>

<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p><strong>Note 2</strong>. To connect to the UART console, the <a href="https://iot-devices.com.ua/product-uk/esp12-oled-komplekt-2-kontroler-iot-bez-displeya-na-osnovi-esp8266-12f/">ESP12.OLED module</a> , on which the emulator is based, has separately led UART interface lines (2.54 mm pitch holes for soldering) on the PCB. To connect the emulator to the computer the user additionally needs to have his own USB-UART converter. Further in the text the connection diagram will be given.</p></blockquote>

<p>The article will be continued in the following publications:<br/><a href="https://iot-devices.com.ua/en/?p=2822">Geiger counter emulator of GGreg20_V3 module by means of ESP8266 Part 2 Building the Emulator</a><br/>Geiger counter emulator of GGreg20_V3 module by means of ESP8266 Part 3: Testing and Conclusion</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Why we didn&#8217;t add the I2C interface to the GGreg20_V3 module</title>
		<link>https://iot-devices.com.ua/en/why-we-didnt-add-the-i2c-interface-to-the-ggreg20_v3-module/</link>
		
		<dc:creator><![CDATA[iot-guru]]></dc:creator>
		<pubDate>Sat, 28 May 2022 19:24:07 +0000</pubDate>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[ESP-IDF]]></category>
		<category><![CDATA[ESPHome]]></category>
		<category><![CDATA[Expressive]]></category>
		<category><![CDATA[Geiger]]></category>
		<category><![CDATA[Geiger-Counter-Device]]></category>
		<category><![CDATA[GGreg20_V3]]></category>
		<category><![CDATA[GPIO]]></category>
		<category><![CDATA[Home Assistant]]></category>
		<category><![CDATA[I2C]]></category>
		<category><![CDATA[ionizing radiation]]></category>
		<category><![CDATA[IoT devices]]></category>
		<category><![CDATA[ISR]]></category>
		<category><![CDATA[LUA]]></category>
		<category><![CDATA[MicroPython]]></category>
		<category><![CDATA[NodeMCU]]></category>
		<category><![CDATA[Pulse Counter]]></category>
		<category><![CDATA[SBM20]]></category>
		<category><![CDATA[STM32]]></category>
		<category><![CDATA[Tasmota]]></category>
		<guid isPermaLink="false">https://iot-devices.com.ua/why-we-didnt-add-the-i2c-interface-to-the-ggreg20_v3-module-uk/</guid>

					<description><![CDATA[Indeed, why not add such a convenient interface to the module? Here is our next article where we discuss the advantages and disadvantages of equipping the GGreg20_V3 ionizing radiation detector module with an I2C interface. Note that we really like the I2C serial bus for its simplicity, functionality, and reliability. You can check out our [&#8230;]]]></description>
										<content:encoded><![CDATA[
<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://iot-devices.com.ua/wp-content/uploads/2022/05/6-ggreg20_v3_iot-deviceslogo_i2c_publpic_eng-1024x683.png"><img loading="lazy" decoding="async" width="1024" height="683" src="https://iot-devices.com.ua/wp-content/uploads/2022/05/6-ggreg20_v3_iot-deviceslogo_i2c_publpic_eng-1024x683.png" alt="GGreg20_V3, I2C" class="wp-image-2008" srcset="https://iot-devices.com.ua/wp-content/uploads/2022/05/6-ggreg20_v3_iot-deviceslogo_i2c_publpic_eng-1024x683.png 1024w, https://iot-devices.com.ua/wp-content/uploads/2022/05/6-ggreg20_v3_iot-deviceslogo_i2c_publpic_eng-300x200.png 300w, https://iot-devices.com.ua/wp-content/uploads/2022/05/6-ggreg20_v3_iot-deviceslogo_i2c_publpic_eng-768x512.png 768w, https://iot-devices.com.ua/wp-content/uploads/2022/05/6-ggreg20_v3_iot-deviceslogo_i2c_publpic_eng-454x303.png 454w, https://iot-devices.com.ua/wp-content/uploads/2022/05/6-ggreg20_v3_iot-deviceslogo_i2c_publpic_eng.png 1500w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></figure></div>



<p>Indeed, why not add such a convenient interface to the module? Here is our next article where we discuss the advantages and disadvantages of equipping the GGreg20_V3 ionizing radiation detector module with an I2C interface. </p>



<p>Note that we really like the I2C serial bus for its simplicity, functionality, and reliability. You can check out our other publications where we look at this great bus: <br><a href="https://iot-devices.com.ua/en/how-to-choose-the-right-i2c-chips-en/">Як правильно вибрати I2C чіпи. Або про приховану програмну проблему вибору<br>апаратних модулів</a>  /  <a href="https://iot-devices.com.ua/en/how-to-choose-the-right-i2c-chips-en/">How to choose the right I2C chips. Or the hidden software problem of<br>choosing hardware modules</a></p>



<p><a href="https://iot-devices.com.ua/?p=1130">Application of I2C bus interface splitter</a> </p>



<p>However, our goal in developing GGreg20_V3 was, and still is, to ensure that our product is as compatible as possible with various systems.</p>



<p>Take a look at this:</p>



<p><strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-green-cyan-color">(1)</mark></strong> If any module or chip has an I2C (or SPI, UART) communication interface, this automatically requires a low-level driver-connector to be written for that device.</p>



<p><strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-green-cyan-color">(2)</mark></strong> Also, such a device cannot be integrated with other components that do not support a specific communication or control interface such as I2C. There are many projects that do not have I2C, or there are not enough free GPIOs for the I2C bus.</p>



<p><strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-green-cyan-color">(3)</mark></strong> The radiation measurement module, under certain conditions, should be capable of being used in the field, without connection to the main controller. The user should be able to use such a device regardless of the conditions in which he finds himself. Without programming or hardware rework.</p>



<p><strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-green-cyan-color">(4)</mark></strong> Equipping the module with an I2C interface requires an embedded controller-companion on the module, which provides data preparation for the consumer and data exchange in Slave Device mode in accordance with the I2C specification. Although it can be a common and inexpensive controller, its presence increases both the price and size of the module. It is also necessary to allocate additional space on the module board for the address selection pads. </p>



<p><strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-green-cyan-color">(5)</mark></strong> A module with an I2C interface requires a main controller and display so that the module can be used for its intended purpose. This is despite the fact that the module already has an embedded controller-companion. The main controllers are very different. Some use Raspberry Pi, or Arduino, and some want to be able to use ESP32/ESP8266. That&#8217;s why we don&#8217;t put the main controller on the GGreg20 module board. We believe that the user has the right to choose the controller, platform or development environment independently. And our task is to ensure the widest possible compatibility and versatility of our product.</p>



<p>From an electrical point of view, equipping devices in this category with an I2C interface also has no advantages, since both the power and data interface in the I2C variant and the GGreg20_V3 pulse output variant require the same number of signal wires in the loop. Hot-swapping, supported by the I2C bus, is also hardly desirable for this type of module, not to mention the mandatory presence of this function.</p>



<p>In Fig. Here are schematic images of two modules &#8211; the current version of GGreg20 without I2C, and the version with I2C interface to show how much you would have to change the module to the actual size (10&#215;10 mm) of the additional chip integrated controller-companion.</p>



<figure class="wp-block-image size-large"><a href="https://iot-devices.com.ua/wp-content/uploads/2022/05/6-ggreg20_v3_iot-deviceslogo_i2c_publpic_eng-1024x683.png"><img loading="lazy" decoding="async" width="1024" height="566" src="https://iot-devices.com.ua/wp-content/uploads/2022/05/6-ggreg20_v3_publication_pic-1024x566.png" alt="GGreg20_V3" class="wp-image-2006" srcset="https://iot-devices.com.ua/wp-content/uploads/2022/05/6-ggreg20_v3_publication_pic-1024x566.png 1024w, https://iot-devices.com.ua/wp-content/uploads/2022/05/6-ggreg20_v3_publication_pic-300x166.png 300w, https://iot-devices.com.ua/wp-content/uploads/2022/05/6-ggreg20_v3_publication_pic-768x424.png 768w, https://iot-devices.com.ua/wp-content/uploads/2022/05/6-ggreg20_v3_publication_pic-1536x848.png 1536w, https://iot-devices.com.ua/wp-content/uploads/2022/05/6-ggreg20_v3_publication_pic-454x251.png 454w, https://iot-devices.com.ua/wp-content/uploads/2022/05/6-ggreg20_v3_publication_pic.png 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></figure>



<p><em><br>Fig. If GGreg20_V3 had an I2C interface (the built-in companion controller providing the I2C Slave Device mode is shown in red)</em>)</p>



<p>The only advantages to justify equipping our radiation module with an I2C interface are:</p>



<ul class="wp-block-list"><li>the ability to connect multiple devices to the I2C interface of the main controller;</li><li>calculation of user values by means of the built-in controller-companion.</li></ul>



<p>But if you carefully weigh the potential benefits and the very specific losses of implementing I2C in a given device, it becomes obvious that it is better to have a universal module with extensive driver support and the ability to use it in &#8220;manual&#8221; mode than to have a tones of I2C bus advantages that you need to be able to use.</p>



<figure class="wp-block-table is-style-regular"><table class="has-fixed-layout"><tbody><tr><td></td><td><strong>I2C interface</strong>                         </td><td><strong>GPIO pulse counter interface</strong></td></tr><tr><td>Autonomous use in &#8220;manual&#8221; mode</td><td>No</td><td>Yes</td></tr><tr><td>Requires a built-in controller-companion</td><td>Yes: <br>&#8211; higher cost;<br>&#8211; larger sizes.</td><td>No</td></tr><tr><td>Driver support</td><td>Not available / very limited</td><td>The broadest</td></tr><tr><td>Hardware dependency</td><td>High:<br>&#8211; main controller;<br>&#8211; display.</td><td>Low / none</td></tr><tr><td>User qualification requirements</td><td>High:<br>&#8211; embed programming .;<br>&#8211; administration / config;<br>&#8211; interfaces / protocols;<br>&#8211; electronics / integration.</td><td>Low / none</td></tr></tbody></table></figure>



<p>In addition to the above, here are two key problems we would like to highlight for potential users. GGreg20_V3 does not have these problems, but they are bound to occur (in some variations) in the radiation measurement module with the I2C interface:</p>



<h2 class="wp-block-heading"><strong>Problem # 1</strong> Field conditions / Emergency situation </h2>



<p>Consider this situation: you have a radiation sensor in a drawer waiting for you to finally start programming it, and the next moment you need to leave the house as quickly as possible with one backpack in your hands and, perhaps, start measuring the level of radiation as soon as possible, because a situation of natural or man-made disaster has come, and you are near the epicenter of these events. </p>



<p>We in Ukraine are very familiar with such circumstances, and we take into account the experience accumulated in the most difficult times for the country to make the system design of our products as good as possible.</p>



<p>Our GGreg20_V3 module only needs to be powered by a powerbank (or even a few AA/AAA batteries), or a solar panel and that&#8217;s it: you can measure manually by LED flashes and a stopwatch or your own countdown. </p>



<p>The number of flashes per minute, multiplied by the conversion factor, is the radiation level in μSv/h. </p>



<p>The conversion factor for the SBM20 GM-tube is 0.0054. Thus, we have a simple formula: </p>



<p class="has-text-align-center">CPM x 0.0054 = mkSv / hour. </p>



<p>where CPM is the number of flashes per minute ( <em>Counts per Minute</em> ).</p>



<p>For Kyiv[20 &#8211; 48] flashes is a normal level (0.10 &#8211; 0.26 mkSv / h).</p>



<p>Unlike the GGreg20_V3, a module with an I2C interface will be very difficult to use in the field for its intended purpose. After all, such a module requires a main controller, display, programming tools, software code development and special knowledge and skills to interconnect the required components and program them. This means that the average user without specialist knowledge will not be able to make a measurement with an I2C sensor, even if he happens to have the available tools in his kit.</p>



<h2 class="wp-block-heading"><strong>Problem # 2</strong> Driver support</h2>



<p>Even if the surrounding circumstances are fine and the radiation sensor module is operated in a civilization, there are still problems with the design option of the module having an I2C interface. Problems arise for users who want to use their favorite systems / platforms / environments / architectures for IoT development. </p>



<p>There are many systems and user favors, but even the most advanced and popular systems do not have drivers for all the devices that consumers usually buy and try to connect. </p>



<p>Due to the heterogeneity of integration protocols, sometimes you have to write a driver yourself, or wait several years for the system developers to pay attention to this particular commercial device and develop an appropriate driver connector.</p>



<p>Here is a comparison table of common platforms with built-in I2C support for radiation sensors and platforms with GPIO pulse counter support, so that the reader can understand the extent of the problem.</p>



<figure class="wp-block-table"><table><tbody><tr><td><strong>Platform</strong>         </td><td class="has-text-align-center" data-align="center"><strong>Radiation sensor module with I2C, built-in driver platform support</strong>      </td><td class="has-text-align-center" data-align="center"><strong>Radiation sensor module with pulse output, built-in driver platform support (GPIO pulse counter, external ISR)</strong></td></tr><tr><td>Arduino</td><td class="has-text-align-center" data-align="center">No</td><td class="has-text-align-center" data-align="center">Yes</td></tr><tr><td>NodeMCU (Lua)</td><td class="has-text-align-center" data-align="center">No</td><td class="has-text-align-center" data-align="center">Yes</td></tr><tr><td>MicroPython</td><td class="has-text-align-center" data-align="center">No</td><td class="has-text-align-center" data-align="center">Yes</td></tr><tr><td>ESPHome / Home Assistant</td><td class="has-text-align-center" data-align="center">No</td><td class="has-text-align-center" data-align="center">Yes</td></tr><tr><td>Espressif ESP-IDF</td><td class="has-text-align-center" data-align="center">No</td><td class="has-text-align-center" data-align="center">Yes</td></tr><tr><td>STM32</td><td class="has-text-align-center" data-align="center">No</td><td class="has-text-align-center" data-align="center">Yes</td></tr><tr><td>Tasmota</td><td class="has-text-align-center" data-align="center">No</td><td class="has-text-align-center" data-align="center">Yes</td></tr></tbody></table></figure>



<p>This data indicates very eloquently that a sensor with a pulse output, such as the GGreg20_V3, is much easier to connect to any platform, or to use the module stand-alone, if necessary. </p>



<p>Of course, each I2C module usually has its own libraries developed by the manufacturer or by concerned members of the open source software community. For example, the GGreg20_V3 module has several libraries for popular platforms:</p>



<figure class="wp-block-table is-style-stripes"><table><tbody><tr><td><strong>Platform</strong></td><td><strong>Link</strong></td></tr><tr><td>Arduino contributed library</td><td>https://www.arduino.cc/reference/en/libraries/ggreg20_v3/</td></tr><tr><td>ESPHome / Home Assistant example</td><td>https://github.com/iotdevicesdev/ggreg20-v3-homeassistant-esphome-example</td></tr><tr><td>Tasmota driver example</td><td>https://github.com/iotdevicesdev/ggreg20-v3-tasmota-esp32-driver</td></tr><tr><td>NodeMCU (Lua) example</td><td>https://github.com/iotdevicesdev/ggreg20-v3-nodemcu-lua-example</td></tr><tr><td>NodeMCU (Lua) full functional driver</td><td>https://alterstrategy.com/product/radcounter/</td></tr></tbody></table></figure>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p><em><strong>Note.</strong> While every modern IoT platform typically provides I2C bus support, there must also be a driver for each specific hardware module (manufacturer, model, version). Support must be both on the platform side and on the side of the controller to which the module is connected.</em></p></blockquote>



<p>Having libraries like the ones in the table is already a good thing. But this does not give any guarantee that these libraries are supported by their authors and are up-to-date, and also that the user will find such a library for his favorite platform and will be able to integrate it and program the end device.</p>



<p>In the case of the pulse counter on the GPIO, the situation is completely different: all platforms support this function and are very easy to program.</p>



<h2 class="wp-block-heading"><strong>In lieu of conclusion.</strong></h2>



<p>Despite the obvious advantages of the I2C bus, if in the future we decide to add I2C support to the GGreg20 module, it will be another, alternative device with these capabilities. And consumers will be able to choose which option suits them best.</p>



<p>Buy a <a href="https://iot-devices.com.ua/en/product/ggreg20_v3-ionizing-radiation-detector-with-geiger-tube-sbm-20/">GGreg20_V3</a> ionizing radiation detector with pulse output.</p>



<p>We wish you success!</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
