Giter Site home page Giter Site logo

Comments (15)

DotEXEGaming avatar DotEXEGaming commented on May 23, 2024

image
circuit diagram *

from pi_ina219.

DotEXEGaming avatar DotEXEGaming commented on May 23, 2024

@chrisb2 sorry to at you but this is important for its use

from pi_ina219.

chrisb2 avatar chrisb2 commented on May 23, 2024

Code and circuit look good. Please can you check that the device is visible on the i2c bus with:
sudo i2cdetect -y 1
as explain in https://learn.adafruit.com/scanning-i2c-addresses/raspberry-pi, you should see it at address 0x40.

Just checking but have you enable i2c as described in https://www.raspberrypi-spy.co.uk/2014/11/enabling-the-i2c-interface-on-the-raspberry-pi/.

Chris

from pi_ina219.

DotEXEGaming avatar DotEXEGaming commented on May 23, 2024

I2C is enabled and when running i2cdetect -y 1 the sensor is detected on 0x40

from pi_ina219.

chrisb2 avatar chrisb2 commented on May 23, 2024

Searching in Google it seems the OSError: [Errno 121] Remote I/O error error is a pain to track down. Here are a few questions, sorry if you have already thought of some of these:

  1. How long are leads between the Pi and the ina219?
  2. Is the circuit diagram accurate or just a representation (sometimes the issue is something small)?
  3. What version of Pi OS are you running (cat /etc/os-release)?

Things to Try
Add the following delay before you call ina.configure() in your program:
utime.sleep_ms(10)

Verify all the wires to the device are good and joints are solid? Are they soldered (dry joints?), or is this a prototype board (dodgy connection?)?

from pi_ina219.

DotEXEGaming avatar DotEXEGaming commented on May 23, 2024

The leads are about 10cm long, and the circuit diagram is accurate minus the light and 12V battery.
when running cat /etc/os-release:

PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

I'm having issues with installing utime so i used time.sleep(0.01) instead but no luck.
All wires are solid dry joints.

from pi_ina219.

chrisb2 avatar chrisb2 commented on May 23, 2024

Maybe try sleep(1).

Using a Pi 4B and latest Bullseye and a simple circuit like yours except bulb is a LED and series resistor powered from Pi 5V, I can make a measurement using example.py with busnum=1. I think it most likely the issue is something to do with your circuit, can you try the following to try and eliminate where:

  1. In your circuit what happens it you disconnect the load and make a measurement?
  2. Replace your existing load under measurement with an LED and resistor power from Pi 5V (so same as my setup). Does this work?
  3. If it does not work, that might indicate an issue with the ina219 breakout itself. If you have spare, trying swapping to it in the LED circuit.
  4. If it does work, then there must be some issue with your actual load, perhaps you can use a process of elimination to try and work out the problem? If you have a logic analyzer this might be the time to use it.

Chris

from pi_ina219.

DotEXEGaming avatar DotEXEGaming commented on May 23, 2024
  1. Same error.
  2. The LED lights but the error persists.
  3. I have not got any spare (soldered) boards currently.
    Also the LED only lit when connecting to the screw terminals not the header (they should be the same?)

from pi_ina219.

chrisb2 avatar chrisb2 commented on May 23, 2024

Header should work same as terminals. If you use a magnifying glass do the tracks look OK, or use a multimeter to check tracks.

Given LED circuit is not working its beginning to sound like your ina219 has a problem. So we are clear, below is a sketch of my LED circuit.

circuit-ina219

Chris

from pi_ina219.

DotEXEGaming avatar DotEXEGaming commented on May 23, 2024

To be clear, the LED does work now, yes, and I am using a separate power source with the ground shared with the pi.

from pi_ina219.

chrisb2 avatar chrisb2 commented on May 23, 2024

So you can measure current and voltage with LED circuit?

from pi_ina219.

DotEXEGaming avatar DotEXEGaming commented on May 23, 2024

The LED lights, but the board gives the same error.

from pi_ina219.

chrisb2 avatar chrisb2 commented on May 23, 2024

So I think your ina219 has a problem, I have never seen this simple led circuit fail with my library. The LED is always going to light unless the shunt resistor is dead, the ina219 chip on the breakout is another matter. I think you need to obtain a new breakout.

from pi_ina219.

DotEXEGaming avatar DotEXEGaming commented on May 23, 2024

Oh alright. I'll resolder another one and try then. Probably later today.

from pi_ina219.

DotEXEGaming avatar DotEXEGaming commented on May 23, 2024

After soldering a new board and closely inspecting the old one to see the ground pin wasn't even soldered on, it works! Thank you so much. Have a great day/evening what be it.

from pi_ina219.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.