Wiki

This version is outdated by a newer approved version.DiffThis version (10 Nov 2021 10:12) was approved by Mihail Chindris.The Previously approved version (09 Nov 2021 21:57) is available.Diff

This is an old revision of the document!


Geiger Counter demo (EVAL-CN0536-ADRZ)

The ADuCM3029_demo_cn0536 project provides a solution to measure radiation levels using most of Geiger-Muller tube sensors available in the market. It uses the precision programmable oscillator LTC6906 to generate high voltage output for the tube and the LTC1540 nano power comparator to set and regulate it. With the LTC1441 ultralow power dual comparator the Geiger pulse is translated to logic level 3V or 5V and the LTC6994 robust built in delay block timer chip will generate a Geiger clicking sound to a regular buzzer.

Also, onboard LEDs are used to indicate radiation levels and information about the counts per minute and microSieverts per minute are sent over UART or over the internet through MQTT.

A sample python code is available to plot MQTT data into a graph with a radiation threshold.

The ADuCM3029_demo_cn0536 project is using the the CN0536 and EVAL-ADICUP3029 prototyping board.

This page will go through how to build and run the demo from the software point of view and for more detailed information about the CN0536 from the hardware side can be found here.

An overview about the theme can be seen in the following diagram:

Software flow

Demo Requirements

The following is a list of items needed in order to replicate this demo.

UART demo with precompiled program

Click to display ⇲

Click to hide ⇱

  1. Set the UART switch to USB.  |
  2. Place the EVAL-CN0536-ARDZ on top of the EVAL-ADICUP3029.  |
  3. Connect a micro-USB cable to the USB connector and then to the PC.
  4. Download the UART precompiled program


    Precompiled ADuCM3029_demo_cn0536 project with UART communication:

    ADuCM3029_demo_cn0536_uart.hex

  5. Upload the precompiled .hex file to the board. (Copy the .hex file to the DAPLINK drive)
  6. Reset the board from the RESET push button.
  7. Start the serial terminal program.
  8. Connect it to the desired port. Eg. COM4, check step by step guide if needed.
  9. Set the BAUDRATE to 115200
  10. Watch the output. Data will be send every 10 seconds by default.

MQTT (Wi-Fi) demo with precompiled program

Click to display ⇲

Click to hide ⇱

  1. Set the UART switch to ARDUINO.  |
  2. Place the EVAL-CN0536-ARDZ on top of the EVAL-ADICUP3029.  |
  3. Connect the ESP8266 EN pin to 3.3V or solder it like below.
  4. Connect the ESP8266 module to the Arduino Header.
  5. Connect a micro-USB cable to the USB connector and then to the PC.
  6. Download the MQTT precompiled program


    Precompiled ADuCM3029_demo_cn0536 project with MQTT communication:

    ADuCM3029_demo_cn0536_mqtt.hex

  7. Create a hotspot or set a WiFi network with the following values (It must have Internet connection):
    1. SSID: analog_hotspot
    2. Password: 12345678
  8. Reset the board from the RESET push button.
  9. During setup the blue led will be turned on:
  10. If the setup completed succesfully, the green led will be turned on (blue will be turned off). This means that the program is sending data to the server.
  11. In case of an error during setup or during program execution, both leds will blink alternated with a 1 second period.
  12. Data will be sent to:
    1. MQTT Server: broker.hivemq.com
    2. MQTT Topic: analog_test_topic
  13. Use one of the below methods to view the data

Use MQTT Web Client to view data

Use MQTT Web Client to view data

  1. Set the above server to connect to:
  2. After succesfull connection, subscribe to the mentioned topic:
  3. View the published data under messages:

Use MQTT local html client to view data

Use MQTT local html client to view data

  1. Download the HTML MQTT client (Rigth click on the link → Save link as…)
  2. Open the saved file into your browser.
  3. In the upper of the page the server connection status is shown
  4. A Graph with the data sent by the Geiger Counter is ploted:

Use MQTT python client to view data

Use MQTT python client to view data

  1. Get the python script (Rigth click on the link → Save link as…).
  2. Run a terminal (cmd in windows) where the file was downloaded.
  3. Install the needed python dependencies with:
    python -m pip install paho-mqtt matplotlib parse
  4. Run the python sample script:
    python main.py
  5. A new plot windows will be created and the recieved data will be printed also in to the terminal:

Working with the software

Getting started with the software

Getting started with the software

  1. Make program should be installed and available in the path.
  2. Open a terminal (linux) or a cmd (windows) and navigate to a directory where to start working.
  3. Download the EVAL-ADICUP3029 repository with
    git clone --recursive https://github.com/analogdevicesinc/EVAL-ADICUP3029.git 
  4. Using the --recursive is important in order for the submodules to be initialized.
  5. Go to project directory.
    cd projects\ADuCM3029_demo_cn0536
  6. Follow this guide to create a CCES project. This command should be enough:
    make update_srcs 
  7. A folder build will be created and inside it the CCES project.
  8. Import the new generated project into your workspace. See wiki
  9. Now the project structure should look like this:

Editing software parameters

Editing software parameters

  1. For Geiger Counter configuration see geiger_counter.h. The default configuration means:
    • Output data will be calculated at each 10 seconds
    • A average filter is applied on the last 5 samples
    • us_per_min = c_per_min * CONVERSION_FACTOR
    • Jumper 2 is solder on the back of the CN0536
      /* Number of seconds between each measurement */
      #define SAMPLING_PERIOD		10//seconds
      /* Number of measurements used for average filtering */
      #define NB_AVARGE_SAMPLES	5
      /* Conversion factor from counts/minute -> microSieverts/minute */
      #define CONVERSION_FACTOR	0.01
      
      /*
       * Depending of the jumper soldered on the board one of these 3 options is
       * available for reading the Geiger pulses.
       * Avaliable options are:
       * 	- 2 : JP2 soldered (default on board)
       * 	- 3 : JP3 soldered
       * 	- 4 : JP4 soldered
       */
      #define JUMPER_CONFIG	2
  2. For communication configuration see communication.h: The default configuration means:
    • MQTT is used as default communication method. If something goes wrong with Wi-fi, communication will start over UART.
      In order to use UART from the beginning, set the COMUNICATION_METHOD macro to UART
    • The program will try to connect to a wifi network with name analog_hotspot and password 12345678
    • The program will try to publish the data to test.mosquitto.org MQTT broker at the topic analog_test_topic
      #ifndef COMUNICATION_METHOD
      #define COMUNICATION_METHOD	MQTT
      //#define COMUNICATION_METHOD	UART
      #endif
      
      /* UART configuration parameters */
      #define CONFIG_UART_PARITY	UART_NO_PARITY
      #define CONFIG_UART_STOPBITS	UART_ONE_STOPBIT
      #define CONFIG_UART_WORD_LEN	UART_WORDLEN_8BITS
      #define CONFIG_UART_BAUDRATE	BD_115200
      
      /* WIFI */
      #define WIFI_SSID		"analog_hotspot"
      #define WIFI_PASS		"12345678"
      
      /* MQTT Server */
      #define MQTT_SERVER_ADDRESS	"test.mosquitto.org"
      #ifndef DISABLE_SECURE_SOCKET
      #define SERVER_PORT		8883
      #else
      #define SERVER_PORT		1883
      #endif
      
      /* MQTT Client */
      #define MQTT_BUFFER_SIZE	500
      #define MQTT_TIMEOUT		20000 //ms
      #define MQTT_KEEPALIVE		7200 //ms
      #define MQTT_CLIENT_NAME	"analog_client"
      #define MQTT_PUBLISH_TOPIC	"analog_test_topic"

Build and debug the project

Build and debug the project

End of Document

resources/eval/user-guides/eval-adicup3029/reference_designs/demo_cn0536.1636535552.txt.gz · Last modified: 10 Nov 2021 10:12 by Mihail Chindris