ALPS ALPINE HGPRDT007A Magnetic Sensor Evaluation Kit Instructions
- June 26, 2024
- ALPS ALPINE
Table of Contents
- ALPS ALPINE HGPRDT007A Magnetic Sensor Evaluation Kit
- Incremental Encode Output type Magnetic Sensor HGPRDT007A
- Requirements
- Connection
- Compile a program
- Upload compiled program to M5Stack
- About sample program
- Disclaimer
- Appendix
- Read User Manual Online (PDF format)
- Download This Manual (PDF format)
ALPS ALPINE HGPRDT007A Magnetic Sensor Evaluation Kit
Incremental Encode Output type Magnetic Sensor HGPRDT007A
Alps Alpine high-precision magnetic sensors use Giant Magneto Resistive effect
(GMR) for horizontal magnetic fields detection. Utilizing the GMR element for
its high output and exceptional resistance to high temperatures and magnetic
fields, our sensors achieve high output level and sensitivity compared to
other GMR sensors; approximately 100 times higher than Hall element and 10
times higher than AMR element based on our research. We offer various magnetic
sensors for dedicated usage such as non-contact switch applications, linear
position detection and angle detection as well as rotational speed and
direction sensing in response to external magnetic fields.
This document provides the information how to evaluate Incremental Encode
Output Type Magnetic Sensor (herein after magnetic encoder) with M5Stack
quickly.
Requirements
- M5Stack BASIC
- USB cable (come with M5Stack)
- Evaluation board for HGPRDT007A
- PC w/Arduino IDE & other files (see below)
- Neodymium magnet (4-pole ring type)
- DC FAN and power supply
Note All the necessary files should be installed into Arduino IDE such as “M5Stack Boards Manager” and “Library Manager”. For setting of M5Stack, please also refer to M5Stack website and other materials.
Connection
Connect PC, M5Stack and the evaluation board by USB cable as shown in Fig.2. The circuit diagram of the evaluation board is shown in appendix in this document.
Compile a program
Download sample program for the magnetic encoder (HGDVST007A) from ALPSALPINE
website and extract zip file anywhere on your PC. Then follow the instruction
below 1 – 4.
(For download, user registration is required)
Archive file: HGPRDT007A_SSW0.zip
After extraction:..¥(Any)¥HGPRDT007A_SSW0¥HGPRDT007A_SSW0***.ino
-
Start Arduino IDE.
-
In menu [file]→[Open] and select
(ALAP_HGPRDT007A.ino) in list (Fig.3). -
Select “M5Stack-Core-ESP32” or “M5Core”in [Select Board] and select COMxx which is connected with M5Stack (Fig.4).
-
Click “✓” for compile and wait.
Note Number of COM port (xx) is different depend on user condition.
Upload compiled program to M5Stack
- Click “→” for upload and wait for message “Done uploading” (Fig.6).
- After uploading, M5Stack restart automatically.
- Status of magnetic sensor can be monitored on M5stack LCD.
About sample program
The magnetic encoder detects the change in flux density of the rotating magnet and output “1” or “0”. The sample program uses the output signal to calculate the rotational speed, displays the direction of rotation and the rotational speed on the LCD screen.
- When the power button is ON, the program starts and displays the initial state (direction of rotation: STOP /speed: 0rpm).
- When the magnet rotates, the magnetic encoder detects the change of magnetic flux density and outputs the OUT1/OUT2 signals (Fig.7).
- Clockwise (CW): Output in the order of ①②③・・⑦⑧.
- Counterclockwise (CCW): output in the order of ⑧⑦⑥・・②①.
- M5Stack detects the position of the magnet through the OUT1/OUT2 signal of the magnetic encoder, calculates the rotation speed and displays the rotation direction and rotation speed on the LCD screen (Fig.8).
Calculation of rotational speed
In case of 4-pole magnet, 8 equal parts are exisiting per approximately 45
deg. In the sample code the change of encoder output is defined as 1 count.
Rotational speed can be calculated with following steps; Accumulate the counts
in 1 second, divide it by the numbers of divisions (8) and multiply by 60.
About magnetic encoder
The magnetic encoder (HGPRDT007A) uses an open-collector circuit. As shown
in Fig.9, the output signal of OUT1 is ON (output low) when the magnetic flux
density from Pin3 to Pin1 is 0.8 mT (typ.) and the output signal of OUT1 is
OFF (output high level) when its magnetic flux density is -0.8mT (typ.). The
output signal of OUT2 is ON (output low level) when the magnetic flux density
from Pin1 to Pin5 is 0.8mT (typ.) and the OUT2 output signal is OFF (output
high) when the flux density is -0.8mT (typ.). Due to the pitch free design, a
2-phase signal with a 90-degree phase difference can also be output for an
anisotropic magnet with multiple poles similar to the one in Fig.10. For
design information and detailed procedures, refer to the product datasheet,
design manual, and application notes.
About serial monitor
The angle of magnet rotation can be monitored on Arduino IDE serial monitor
when M5Stack is connected to PC. To use this function, please set baud rate as
below:
Baud rate: 115,200bps
Disclaimer
- The contents of this document are subject to change without prior notice.
- Reproduction or copying of part or all of this document is strictly prohibited without the permission of the Company.
- The information in this document, such as software and circuit examples, is example for the standard operation and use of this product. When used in actual design, customers are requested to take responsibility for the products and designs their product. We are not responsible for any damage caused using these.
- The Company makes no warranty and assumes no responsibility for infringement of third-party patents, copyrights, and other intellectual property rights or disputes related thereto arising from the use of product data, diagrams, tables, programs, circuit examples, and other information described in this document.
- When exporting products that are subject to domestic or overseas export-related regulations, please obtain the necessary licenses, procedures, etc., based on compliance with such regulations.
- If you have any questions about the contents or products described in this document, please consult our sales department.
About Trademarks
Arduino and Arduino IDE are registered trademarks or trademarks of Arduino SA.
M5Stack and M5Stack BASIC are registered trademarks or trademarks of Shenzhen
MingZhan Information Technology Co., Ltd.
Trademark symbols such as TM, C and R are omitted in this document.
Inquiries about products and services
For inquiries about our products and services, please visit the inquiry window
on our homepage.
Appendix
Circuit Diagram
Components
Part No. | Discription | Parts / Valur |
---|---|---|
IC1 | Magnetic Encoder | HGPRDT007A |
C1 | Bypass Capacitor | 0.1uF |
C2 | Load Capacitor | 30pF |
C3 | Load Capacitor | 30pF |
R1 | Pull-up resistor | 3.3kΩ |
R2 | Pull-up resistor | 3.3kΩ |
Wiring diagram
Revision history
Date | Version | Change |
---|---|---|
Apr. 18 2024 | 1.0 | Layout Release (English version) |
Read User Manual Online (PDF format)
Read User Manual Online (PDF format) >>