July 19, 2016 at 9:16 am #2226
Guys, I am trying to run this example and there is something wrong.
So the Serial Monitor of the Arduino IDE could work and thats it, I left everything else as it was. I connected the output of a Linear Hall Sensor to the 1,0 Pin in the Mux and I was expecting to see the reading from the sensor in my Serial Monitor, but instead I see what appears to be the reading and a bunch of other random lower numbers in the other 15 pins.
IO1 analog values: 507 346 348 240 348 238 153 104 341 227 145 95 56 34 16 7
So, 507 looks to me like an expected value, however the rest I would expect them to be 0.
I feel we are shifting something wrong bitwise, however I dont know what it could be.
Thanks in advance for your comments and support
JsscortesJuly 19, 2016 at 1:25 pm #2230Mark MayhewKeymaster
Does your hall sensor read correctly with a baud rate of 28800? I would try the example code exactly as provided, and change the baud rate setting in the Serial Monitor from 9600 to 28800.
Can you provide a better description or sketched schematic of your application?
Unused analog inputs will float and read arbitrary values, and sometimes read the value of a connected sensor on another channel if nothing is plugged into them. You can connect them to 5V or GND if you would like to see them read a set value instead of floating.
MarkJuly 19, 2016 at 3:13 pm #2231
Thanks for your prompt response Mark, I already deleted my question from Amazon to avoid misunderstandings.
About the baud rate, the Arduino Serial Monitor does NOT have the 28800 Option which surprised me initially, it is a drop down box and you can not edit it. I will research more from the Arduino side and will see how to change it probably from the back end.
I liked you idea about testing the reading with a 5v and 0v entry.
Well, when nothing is connected, it works perfectly, I get a row of full 0es.
IO1 analog values: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
However with 5v, I was able to confirm my thoughts, the first value is the correct reading, however I have no idea where the rest of the values are coming from:
IO1 analog values: 1023 717 728 519 728 519 370 266 718 493 345 241 164 112 67 45
About the schematics, I am just connecting my linear hall sensor to ground and 5v and connect the reading signal pin to the MuxShield, thats it.
The initial prototype without the Mux was working fine with 9600 bauds connected to the Analog0 in my Arduino UNO.
Please note that the above data is still with the 9600 baud setting since I still dont know if it is possible to select 28800 in the Arduino Serial Monitor.
Any other suggestion or test? is there any piece of the code or the library that I can take to make a mini-test with only one of the Muxs, Analog Input?
Thanks in advance for your comments
JCJuly 19, 2016 at 4:19 pm #2232
Well, actually I think I know what you meant… I should put ground in all the rest of the pins if I am not using them IF what I want is to see a 0 value on them (or 5v if what I want is a 1023).
That would work, so for now, let’s just say that the “mystery” reading in the unused pins is caused by the “floating” thing.
I am happy with that, now that I know what causes it and that my actual readings in the used pins are correct.
May I suggest you guys to include this behavior somewhere in the technical documentation?
Thank you very much for your support, thats a 5 starts in my Amazon review.
- You must be logged in to reply to this topic.