Did I get fake Chips? Long,very fun journey (for me),with a puzzle.-(Title Edit) - Page 1
Forum section: electronics / general

author: phuzzyday
author_rank: Newbie
timestamp: March 28, 2023, 12:43:17 pm
content: EDIT - Sorry, lots of rambling here. I THINK I got some fake INA226 breakout boards. LOVE some opinions, I am fairly new to tons of this, so lots of childish excitement in here, hands on is VERY cool after watching so many EEVBLOG Videos!Am I in the right section for this?Phil - from Alberta. Apologies for the wall of text, I am more excited about the fun I have been having troubleshooting than I am stressed about the remaining problem. I'm having fun! (Huge depression problem, it's a bigger deal than you think.)Also recovering from everybodies favorite 'C' word virus, so my head is not right, and sore. Very sore.I've been learning about electronics for years since I had to go on disability. Well, I have always really loved it, (Radio Shack 150-in 1 Kit around 1977), but for the past 5 or 6 years I have been getting much more into it! (Micro Starter kit let to me learning and collecting a lot of very neat parts I saw in videos, as well as a couple tools.. Not too great.. (Hantek 6022BE Scope with OpenHantek actually DID something today!)Anyhow, I am trying to get an ina226 sensor to talk to an Arduino. It's a current and voltage sensor, China, breakout board. I2C. I've tried three controller boards, with two different controllers, and a different sensor, from the SAME BATCH......So I downloaded the library from 'Rob Tillart', and it seemed to run, and it was happy with seeing the board, but showed the same illogical values no matter what I connected to it for currents to measure or other pins.The code in the example sktech I ran did have a check to see it it had a connection, and it was happy.Still, something was wrong. I ran the I2C Scanner example sketch, and it seemed like every odd address showed a device on it!Yep - It looked like The sensor was answering calls for most of the neighborhood.I guess the library has been eliminated!I put the stuff away after looking at other videos etc. showing how they wired it up, and it was the same. I've done several projects with I2C, almost all worked!I then realized that I had a couple tools that could give me a better look, and I would learn something, even if I didn't fix it.A very good electronics wizard from the analog days lives in town, and we are very good friends! (Learning a lot there too!) He gave me a little logic analyzer a while back! Neat!I connected it up, told it I was looking at I2C, asked it to decode things, and almost everything was.. error. Even the first pulse or two said error. Still, I could see every address that the I2C scanner sketch called out to, and the address was consistently matched in the replies!Yes, it was responding to .. everything, it looks like. (I haven't looked closely enough at a normal working line since to see the differences though.)I think this may have eliminated wiring, and the signal lines themselves, but errors were flying around everywhere!So I grabbed the USB Hantek, connected the lines, and there wasn't any noise, and the signals looked.. ok.. but the pullup seemed slow! It didn't get to VCC during runs of multiple clock pulses, but it did get past the 70% Vcc in the spec.. I didn't think it was above 70% as long as required for the signal speed I thought I was looking at.So I started tacking on resistors to add pullup to the 10K. The waveform looked different, and I could see the pull down was a bit slower, but the pullup was quite similar.The problem remained no matter what I did or tried, but the journey was so fun, I don't mind so much!Anyhow, I did a screencap of the scope app for the pattern before the new resistors, so I scaled it and put it underneath the one with the extra pulldown resistors just to look.And something weird came up. Past a certain point, the signals seemed to speed up! Same timebase setting!So I decided to get curious, and looked in the spec to find out how the speed negotiation worked.Sure enough, I had discovered a feature! When the devices first negotiate, they look at the pullup/down times of them and their peers, and set the speed properly according to that!I had unknowingly sped up the (Still not working right though) I2C busses by adding more pullups, just as more devices on the line would have done. Had no idea it worked like that, but it was very cool to find out by tinkering on my own!So that is fine and good.. But I still haven't gotten a reading from the sensor(s) yet.So, as regards the current sensors, I am currentlythinking I may have gotten a couple of defective or fake chips on the boards! I could check the boards more closely also, but I think things would have been a lot worse before now if they were actually broke. So... anyone think fake chips? Better yet, could anyone tell me if I have goofed something up?But for now, I need to try to get some sleep. It's 6:45AM here, and I have been unable to sleep, and I need to try again!Thanks for reading.Phil

author: GromBeestje
author_rank: Frequent Contributor
timestamp: April 05, 2023, 05:19:38 pm
content: I am not familiar with the INA226, but I have worked with the INA220 before.Regarding the I²C addresses, the INA220 has two address selection pins, which either connect to GND, VCC, SDA or SCL.I would assume the INA226 would have something similar. Ensure the address selection pins are not floating.

author: phuzzyday
author_rank: Newbie
timestamp: April 05, 2023, 11:21:58 pm
content: Thank you for being the only guy to help!Yea, unfortunately, I dug deep on that one also. They have pull resistors on them and solder pads under the board to alter the setting. Tried changing, still answered ALL addresses somehow.Thanks for trying though!

author: thm_w
author_rank: Super Contributor
timestamp: April 06, 2023, 11:13:08 pm
content: Link to where you bought it from?When you disconnect the INA226, there is no response on the I2C address scanner at all right.Do you have another I2C device, when you connect that one it scans ok?Maybe add the scope photo of the waveforms or photo of your setup. You can also post the code.