smcdouall

*
Newbie
Posts: 2
Logged
Hi, I'm getting an error with the code here when using the code in this tutorial https://tinycircuits.com/blogs/learn/arduino-speedometer-hall-sensor-magnet.

The result from hall.readMag() in the TinyCircuits_A1454.cpp is always -1. This is because the x and y values in the function are also -1. This is regardless of the magnets position to the sensor. I have tried swapping out various sensors/cables/Arduinos and even tried it on other computers and it still doesn't work. Around two weeks ago this code did work as intended. I am wondering if there has been an update to one of the libraries that has caused something to no longer work?

I tried ChatGPT a little and it found that running the following:

byte err = Wire.endTransmission();
Serial.print("I2C error: ");
Serial.println(err);

Resulted in err = 2 which apparently means "2: Received NACK on transmit of address".

This apparently means the board sent the sensor's I²C address, but the sensor didn't acknowledge it (NACKed it)

It also suggested trying an I²C scan to see what devices it could find. The only one it could find was 0x70 which I believe is the TinyCircuits Wireling TinyShield.

Any help would be greatly appreciated. This code was working before and now doesn't when I've tried to upload it to other Arduinos/the same original one.

smcdouall

*
Newbie
Posts: 2
Logged
Solved it. Looks like the issue was I was using the digital hall sensors instead of the analogue ones. Looking on this https://learn.tinycircuits.com/Wirelings/Hall-Effect_Wireling_Tutorial/ you can see the two sensors do vary slightly (the analogue one has a larger chip).

Just posting my reply here in case this helps anyone else out in the future.

DorothyJames

*
Newbie
Posts: 2
Logged
Quote from: smcdouall on September 01, 2025, 08:30:17 AMSolved it. Looks like the issue was I was using the digital hall sensors instead of the analogue ones. Looking on this https://learn.tinycircuits.com/Wirelings/Hall-Effect_Wireling_Tutorial/ you can see the two sensors do vary slightly (the analogue one has a larger chip). Pacman 30th Anniversary

Just posting my reply here in case this helps anyone else out in the future.

Seeing "Received NACK on transmit of address" is frustrating! Have you tried shortening your I²C wires? I had a similar issue once, and simply using shorter, higher-quality wires solved the problem, seemingly addressing some signal degradation.

Could signal degradation be the issue?

ardenthop

*
Newbie
Posts: 1
Logged
Quote from: smcdouall on August 29, 2025, 04:12:04 PMHi, I'm getting an error with the code here when using the code in this tutorial https://tinycircuits.com/blogs/learn/arduino-speedometer-hall-sensor-magnet. unblocked games

The result from hall.readMag() in the TinyCircuits_A1454.cpp is always -1. This is because the x and y values in the function are also -1. This is regardless of the magnets position to the sensor. I have tried swapping out various sensors/cables/Arduinos and even tried it on other computers and it still doesn't work. Around two weeks ago this code did work as intended. I am wondering if there has been an update to one of the libraries that has caused something to no longer work?

I tried ChatGPT a little and it found that running the following:

byte err = Wire.endTransmission();
Serial.print("I2C error: ");
Serial.println(err);

Resulted in err = 2 which apparently means "2: Received NACK on transmit of address".

This apparently means the board sent the sensor's I²C address, but the sensor didn't acknowledge it (NACKed it)

It also suggested trying an I²C scan to see what devices it could find. The only one it could find was 0x70 which I believe is the TinyCircuits Wireling TinyShield.

Any help would be greatly appreciated. This code was working before and now doesn't when I've tried to upload it to other Arduinos/the same original one.
It looks like the hall sensor isn't being seen on the I²C bus. The err=2 means it's not acknowledging. Make sure you're using Wireling.begin() and Wireling.selectPort(port) before talking to it, since only the mux (0x70) shows up until a port is enabled. If it still doesn't show after that, either the library changed recently or the sensor module itself has failed.

SamanthaColebe

*
Newbie
Posts: 1
Logged
Quote from: smcdouall on August 29, 2025, 04:12:04 PMslope unblocked

The result from hall.readMag() in the TinyCircuits_A1454.cpp is always -1. This is because the x and y values in the function are also -1. This is regardless of the magnets position to the sensor. I have tried swapping out various sensors/cables/Arduinos and even tried it on other computers and it still doesn't work. Around two weeks ago this code did work as intended. I am wondering if there has been an update to one of the libraries that has caused something to no longer work?

I tried ChatGPT a little and it found that running the following:

byte err = Wire.endTransmission();
Serial.print("I2C error: ");
Serial.println(err);

Resulted in err = 2 which apparently means "2: Received NACK on transmit of address".

This apparently means the board sent the sensor's I²C address, but the sensor didn't acknowledge it (NACKed it)

It also suggested trying an I²C scan to see what devices it could find. The only one it could find was 0x70 which I believe is the TinyCircuits Wireling TinyShield.

Any help would be greatly appreciated. This code was working before and now doesn't when I've tried to upload it to other Arduinos/the same original one.
My brain just did a little skip! Getting precise readings with those things can be a real pickle sometimes. Once I tried rigging up a similar setup to measure the rotational speed of a pottery wheel, and boy was it jumpy. The readings were all over the place, making it impossible to get a consistent speed, It was a real problem with me during my experience.
Slope Unblocked, this issue reminds me of that time.

SMF spam blocked by CleanTalk