• Newbie
  • *
    • Posts: 1
    • View Profile
for the AST1006-D,
I am looking to connect the sensor directly to a arduino uno
From the schematic of the sensor (Vcc, grd, sdk, sda)
I am connectig the module pins to the typicals associted pin of the arduino Unoa

it does seem to work using the source code available for the arduino uno AST1006-D

Any idea on the pin configuration I should used?? Thank


  • Administrator
  • Hero Member
  • *****
    • Posts: 437
    • View Profile
Hiya JS,

I know I answered this over email, but I thought I would copy the response here if anyone else runs into the same question:

The digital hall sensor relies on an analog pin rather than an I2C (SDA/SCL) connection. So the three pins you would need to connect are A0, GND, and 3.3V. Then you could use this code example that I have modified from what’s available in the tutorial(

Code: [Select]
#define magPin A0        // Corresponds to PORT# of Wireling used (Do not use A0)
bool hallOutput = 0;     // What is directly output from Wireling
bool magnetDetected = 0; // Make sense of output

void setup() {

  // Set Hall Switch Pin to input
  pinMode(magPin, INPUT);

void loop() {
  hallOutput = digitalRead(magPin); // If no magnet, hallOutput == 1
  magnetDetected = !hallOutput; // Flip the hallOutput so magnetDetected == 1 when there is a magnet


For the three pins you would need to connect to the Arduino Uno (GND, 3V3,INT), you can look at the diagram in this tutorial:

The Breakout Wireling is a great quick reference of the pin layout as well (all Wirelings have the same pin connector order of GND, 3V3, SCL, SDA, INT):


SMF spam blocked by CleanTalk