Discover how these sensors can revolutionize navigation, robotics, and beyond, making your devices smarter and more efficient than ever before
A
A
Hardware Overview
How does it work?
3D Hall 7 Click is based on the AK09970N, a low power 3D magnetic sensor from AKM Semiconductor. This sensor relies on a Hall effect to accurately sense magnetic field changes on three perpendicular axes. The internal magnetic field sensing elements are multiplexed and connected to a pre-amplifier and then to a 16-bit low noise Analog to Digital Converter (ADC), which sequentially samples each sensor, providing 16-bit spatial data over the digital interface. The magnetic sensor has a very low pin count. Therefore, SPI and I2C lines are multiplexed on the same pins. In order to allow functionality for both SPI and I2C interfaces, 3D Hall 7 click have onboard jumpers for communication interface selection. Thus, the communication interface selection procedure relies on switching the appropriate SMD jumpers, named COMM SEL. Note that all of the I2C/SPI group jumpers need to be switched at the same side: all three should either be soldered as I2C or SPI. If one of them shows in the opposite position from the rest, the communication with the IC might not be possible. The power consumption is a big concern as of lately, with the introduction of the IoT. The ability to work in a low power mode is a must for every device which is to be used for any type of IoT
networking. The AK09970N magnetic sensor features power down mode, single measurement mode and seven continuous measurement modes, allowing the user to make a perfect balance between sampling frequency, measurement accuracy and power consumption. The power consumption is in a close relationship with the data output refresh rate (ODR). The AK09970N magnetic sensor also features a powerful programmable interrupt engine, which allows many event sources to be signaled via the two interrupt pins (INT and ODINT), which are routed from the sensor to the mikroBUS™ INT and AN pins respectively. A very useful function of the interrupt engine is the signaling of the data ready event. That way, the host MCU does not have to poll the sensor for the data acquisition. The sensor can simply trigger an interrupt when the data is ready for reading. The interrupt engine allows some other customizations of the interrupt signal, such as the magnetic sensor overflow, ADC overflow and Switch event. The sensor provides raw data output, based on a strength of the magnetic field. The measurement is affected by many factors: slight manufacturing differences between ICs affect the readings, even the slight differences between Hall plates within the same IC
might affect the accuracy, although the IC contains highly matched sensing elements. Also, the altitude might affect the readings, as well as temperature changes. Therefore, the IC is equipped with the temperature independent reference voltage, thus minimizing the influence the mentioned unwanted factors. The power mode, output data rate, interrupt thresholds for each axis, and other working parameters, including the availability of the I2C interface, are contained within the configuration registers of the AK09970N magnetic sensor. The sensor is highly configurable, with many configuration options. The AK09970N datasheet contains an in-depth explanation of all the registers and their functionality. However, 3D Hall 7 software library contains simplified functions that allow straight-forward readings to be performed, reducing the steps needed for a proper initialization and configuration of the device. This Click board™ can be operated only with a 3.3V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. Also, it comes equipped with a library containing functions and an example code that can be used as a reference for further development.
Features overview
Development board
Arduino UNO is a versatile microcontroller board built around the ATmega328P chip. It offers extensive connectivity options for various projects, featuring 14 digital input/output pins, six of which are PWM-capable, along with six analog inputs. Its core components include a 16MHz ceramic resonator, a USB connection, a power jack, an
ICSP header, and a reset button, providing everything necessary to power and program the board. The Uno is ready to go, whether connected to a computer via USB or powered by an AC-to-DC adapter or battery. As the first USB Arduino board, it serves as the benchmark for the Arduino platform, with "Uno" symbolizing its status as the
first in a series. This name choice, meaning "one" in Italian, commemorates the launch of Arduino Software (IDE) 1.0. Initially introduced alongside version 1.0 of the Arduino Software (IDE), the Uno has since become the foundational model for subsequent Arduino releases, embodying the platform's evolution.
Microcontroller Overview
MCU Card / MCU

Architecture
AVR
MCU Memory (KB)
32
Silicon Vendor
Microchip
Pin count
32
RAM (Bytes)
2048
You complete me!
Accessories
Click Shield for Arduino UNO has two proprietary mikroBUS™ sockets, allowing all the Click board™ devices to be interfaced with the Arduino UNO board without effort. The Arduino Uno, a microcontroller board based on the ATmega328P, provides an affordable and flexible way for users to try out new concepts and build prototypes with the ATmega328P microcontroller from various combinations of performance, power consumption, and features. The Arduino Uno has 14 digital input/output pins (of which six can be used as PWM outputs), six analog inputs, a 16 MHz ceramic resonator (CSTCE16M0V53-R0), a USB connection, a power jack, an ICSP header, and reset button. Most of the ATmega328P microcontroller pins are brought to the IO pins on the left and right edge of the board, which are then connected to two existing mikroBUS™ sockets. This Click Shield also has several switches that perform functions such as selecting the logic levels of analog signals on mikroBUS™ sockets and selecting logic voltage levels of the mikroBUS™ sockets themselves. Besides, the user is offered the possibility of using any Click board™ with the help of existing bidirectional level-shifting voltage translators, regardless of whether the Click board™ operates at a 3.3V or 5V logic voltage level. Once you connect the Arduino UNO board with our Click Shield for Arduino UNO, you can access hundreds of Click boards™, working with 3.3V or 5V logic voltage levels.
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Click board™ Schematic

Step by step
Project assembly
Software Support
Library Description
This library contains API for 3D Hall 7 Click driver.
Key functions:
c3dhall7_get_axis_data- Get Axis data functionc3dhall7_get_status- Measurement status functionc3dhall7_get_status- Measurement status function.
Open Source
Code example
The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.
/*!
* \file
* \brief 3dHall7 Click example
*
* # Description
* Read the position of magnetic
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initializes driver init, test communication and configuration device for measurement.
*
* ## Application Task
* Reads 3 Axis of the magnetic sensor and logs this data to USBUART every 500ms.
*
*
* \author MikroE Team
*
*/
// ------------------------------------------------------------------- INCLUDES
#include "board.h"
#include "log.h"
#include "c3dhall7.h"
// ------------------------------------------------------------------ VARIABLES
static c3dhall7_t c3dhall7;
static log_t logger;
// ------------------------------------------------------ APPLICATION FUNCTIONS
void application_init ( )
{
c3dhall7_dev_info_t info;
uint8_t red_data;
log_cfg_t log_cfg;
c3dhall7_cfg_t cfg;
/**
* Logger initialization.
* Default baud rate: 115200
* Default log level: LOG_LEVEL_DEBUG
* @note If USB_UART_RX and USB_UART_TX
* are defined as HAL_PIN_NC, you will
* need to define them manually for log to work.
* See @b LOG_MAP_USB_UART macro definition for detailed explanation.
*/
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, "---- Application Init ----" );
// Click initialization.
c3dhall7_cfg_setup( &cfg );
C3DHALL7_MAP_MIKROBUS( cfg, MIKROBUS_1 );
c3dhall7_init( &c3dhall7, &cfg );
c3dhall7_device_reset( &c3dhall7 );
// Test communication
c3dhall7_device_info( &c3dhall7, &info );
if ( info.device_id == C3DHALL7_DEVICE_ID )
{
log_printf( &logger, "---- Communication [ OK ]!!! ----\r\n" );
}
else
{
log_printf( &logger, "---- Communication [ ERROR ]!!! ----\r\n" );
for ( ; ; );
}
// Configuration
c3dhall7_default_cfg ( &c3dhall7 );
}
void application_task ( void )
{
c3dhall7_axis_t axis;
c3dhall7_get_axis_data( &c3dhall7, &axis );
log_printf( &logger, "---- Measurement data of magnetic sensor ----\r\n" );
log_printf( &logger, "X axis: %d \r\n", axis.x );
log_printf( &logger, "Y axis: %d \r\n", axis.y );
log_printf( &logger, "Z axis: %d \r\n", axis.z );
log_printf( &logger, "---------------------------------------------\r\n");
Delay_ms ( 500 );
}
int main ( void )
{
/* Do not remove this line or clock might not be set correctly. */
#ifdef PREINIT_SUPPORTED
preinit();
#endif
application_init( );
for ( ; ; )
{
application_task( );
}
return 0;
}
// ------------------------------------------------------------------------ END
Additional Support
Resources
Category:Magnetic


































