Good day everyone,
I am a new face in the world of Arduino (and electronics) and I wanted to try my luck with an Allegro A1301 magnetic sensor.
My goal is to make a device that can be used to sense some metal approaching it.
One of my friends recommended me to buy an Allegro A1301 sensor.
So I did, I wired it and (first pin to 5V, second to GND and third to the pin nr.2.).
Thereafter I wrote a sketch which checks whether there are voltage fluctuations in the sensor (using the digitalread function and then printing the results in the console) when I approach a Neodymium magnet towards it.
My results show me random numbers varying from 412 to 350 which repeat at regular intervals.
I assumed that the differences were determined by me approaching and retracting the Neodymium magnet from the sensor.
In reality, after modifying the sketch and adding an extra variable to read an unused slot, I realized that the results were similar in nature.
Therefore I would like to ask the kind forum members the following questions:
Because I get the same results when I "read" both an empty slot and the slot with the sensor, is it possible that my sensor is broken? If yes, how can I test to find it out?
What kind of magnets is the AllegroA1301 sensible for? Does a magnetic sensor "feel" fluctuations caused by approaching a metal piece to it?
Is there another way to wire the sensor?
Are the results (412-350) voltages or random numbers? Do I have to process the raw data in order to get some better results?
Thank you and have a nice week ahead!