TDK SmartSonic CH201 User Manual

Presence detection

Advertisement

SmartSonic Presence Detection
Chirp Microsystems reserves the right to change
specifications and information herein without
notice.
User Guide
Chirp Microsystems
2560 Ninth Street, Ste 220, Berkeley, CA 94710
U.S.A
+1(510) 640–8155
www.chirpmicro.com
AN-000227
Document Number: AN-000227
Revision: 1.0
Release Date: 7/8/2020

Advertisement

Table of Contents
loading

Summary of Contents for TDK SmartSonic CH201

  • Page 1 AN-000227 SmartSonic Presence Detection User Guide Chirp Microsystems Chirp Microsystems reserves the right to change 2560 Ninth Street, Ste 220, Berkeley, CA 94710 Document Number: AN-000227 specifications and information herein without U.S.A Revision: 1.0 notice. +1(510) 640–8155 Release Date: 7/8/2020 www.chirpmicro.com...
  • Page 2: Introduction

    AN-000227 INTRODUCTION This example project shows how to build and run an ultrasonic presence detection application using the Chirp SonicLib sensor API. This is a companion document to AN-000214 Presence Detection, and AN-000226 CH201 Ultrasonic Presence Detection Reference Design User Guide. Application note AN-000214 focuses on the test results of the embedded static target rejection algorithm and the presence detection algorithm used in the CH201 presence detection evaluation module.
  • Page 3: Table Of Contents

    AN-000227 TABLE OF CONTENTS Introduction ................................2 Required Equipment ............................ 2 Required Software Packages ........................2 Installation / Preparation ............................4 Building the Presence Detection Application ......................6 Programming the SmartSonic Board ........................7 Running the Presence Detection Application ......................9 Changing the Presence Detection Application Settings ..................
  • Page 4: Installation / Preparation

    AN-000227 INSTALLATION / PREPARATION • Download and install Atmel Studio 7 IDE. • Download and install (unzip) the SmartSonic_Presence application to a project directory of your choice. • Install terminal emulator. • Connect the Chirp sensor daughterboard to the SmartSonic board. Be careful to align the white arrows. •...
  • Page 5 AN-000227 Open Windows Device Manager, open the Ports (COM & LPT) list, and identify the COM port number • assigned to the SmartSonic board. There will be one port associated with the SmartSonic board called“EDBG”. (A second COM port will also be assigned but is not used in this application). The EDBG port is used to connect to the on-board debugger and for programming the board, as well as to display output from the program when it runs.
  • Page 6: Building The Presence Detection Application

    AN-000227 BUILDING THE PRESENCE DETECTION APPLICATION • Open Atmel Studio 7 • Open the Presence Detection project: Open File menu Select File > Open > Project/Solution… Select the atmelstudio/smartsonic-presence-example/smartsonic-presence-example.atsln file in the project directory. Click Open. The program should locate the project files and display the name of the project. The Presence Detection project files are organized in three top-level sub-directories under source: •...
  • Page 7: Programming The Smartsonic Board

    AN-000227 PROGRAMMING THE SMARTSONIC BOARD • Setup SmartSonic board Jumper J1 as in Figure 1. If only one cable is used (connected to the EDBG port), pins 3 & 4 should be shorted. • Connect the SmartSonic board to a Windows PC with EDBG USB cable. •...
  • Page 8: Figure 3. Device Signature And Target Voltage

    AN-000227 Figure 3. Device Signature and Target Voltage • Select Memories on the Device Programming menu. • The Device Programming menu will prompt for the name of the file to program: Figure 4. Programming Hex File Page 8 of 15 Document Number: AN-000227 Revision: 1.0...
  • Page 9: Running The Presence Detection Application

    AN-000227 From the Device Programming screen scroll to the project’s Debug directory and select the smartsonic- • presence-example.hex file. Note: Alternately, you may use the smartsonic-presence-example.elf file, which contains symbolic debug information. (Both files are generated when you build the application. If you are simply running the Presence Detection application, and do not need to use the Atmel Studio 7 debugging features, it does not matter which file you use.) Select Program.
  • Page 10 AN-000227 Reset the SmartSonic board using the board’s reset button (next to the Programming EDBG connector). • • Status messages from the application will appear on the terminal output, followed by summary data from the sensor initialization (device frequency, etc.) and configuration (maximum range, etc.). •...
  • Page 11: Figure 6. Typical Output During Initialization - 2 Sensors

    AN-000227 Because the Presence Detection algorithm detects changes in the ultrasound environment, it is normal for • the first few measurement cycles to report no presence detected. Figure 6 shows the typical application output during initialization, including the first measurement results. Figure 6.
  • Page 12: Figure 7. Typical Output During Operation - 2 Sensors

    AN-000227 After a baseline set of measurements has been made, the presence of objects can be detected. Figure 7 shows typical application output during operation, with two sensors. The “Merged” output lines indicate the overall Presence Detection result, based on data from both sensors. Figure 7.
  • Page 13: Changing The Presence Detection Application Settings

    AN-000227 CHANGING THE PRESENCE DETECTION APPLICATION SETTINGS The app_config.h header file contains symbolic definitions for parameters that affect the application execution. You may change the following definition to adjust the application’s timing. MEASUREMENT_INTERVAL_MS Specifies how often a new measurement cycle will be initiated, in milliseconds. Default = 100 ms (10Hz sample rate). This value is used in main() as a parameter to the chbsp_periodic_timer_init() function.
  • Page 14: Reference Documents

    AN-000227 REFERENCE DOCUMENTS • AN-000214 – Presence Detection • AN-000226 – CH201 Ultrasonic Presence Detection Reference Design User Guide Page 14 of 15 Document Number: AN-000227 Revision: 1.0...
  • Page 15: Revision History

    ©2020 Chirp Microsystems. All rights reserved. Chirp Microsystems and the Chirp Microsystems logo are trademarks of Chirp Microsystems, Inc. The TDK logo is a trademark of TDK Corporation. Other company and product names may be trademarks of the respective companies with which they are associated.

Table of Contents