Basic Information:
Printer Model: custom
MCU / Printerboard: stm32f429
How can I connect an external ADC ads1115 via i2c? Thermistors will be connected to the ADC. I can’t find the information in the documentation. Has anyone done this before?
Printer Model: custom
MCU / Printerboard: stm32f429
How can I connect an external ADC ads1115 via i2c? Thermistors will be connected to the ADC. I can’t find the information in the documentation. Has anyone done this before?
Hi, gaolst
Thanks for the answer
But I’m talking about connecting the ADC to which the thermistor will be connected. Communication should be with the ADC, not with the sensor.
In terms of task what you want to achieve - it’s the same, you have i2c device from which you want to pull a values, for klipper it’s just a numbers, they can represent temperature, voltage or distance - klipper don’t care, it’s up to you how you would process those numbers.
From temp sensor use it directly (i2c device already did calculations).
From ADC (i2c device just measured voltage) voltage you will recalculate thru formulas and thermistor tables to temperature
Difference is only where do we do calculations, directly in sensor or externally.
About ads1115 - you need to analyze what kind of protocol it uses and search simmilar sensor protocol in klipper sensors implementation, if it don’t exist in clipper - use existing as a guide and build your own.
in this case, let’s say I connect the ADC or thermistor an i2c device in the config? Should I make any other changes to the firmware? How then can I set up the ADC?
ads1115 is an ADC, but I get what you’re talking about.
I have seen how people write scripts for connecting an ADC via i2c by type ads1115.py in extras. Is this a necessity or one of the solutions?
You need to read about Klipper architecture before asking this kind of questions …
Firmware - usually is related to MCU (multi controller unit), it’s task to do low level stuff like i2c (and others) communications, motor controls, endstops, etc…
Klipper - is just a program written in Python which is doing asynchronous communication with MCU (one or multiple) and sending commands to them, querying statuses, getting feedback also in asynchronous mode.
So in terms of your goals - configure i2c device means explain to MCU what to send\receive from/to i2c device.
In terms of ads1115.py
- most probably this is extension module for Klipper (not native - I don’t see it in vanila klipper)
So this extension should integrate with Klipper define new “sensor” type and will be responsible for setup/initialization/querying of i2c device thru MCU, it will use Klipper API for that, that API do know what is i2c device.
To summarize: No, you don’t need firmware changes for MCU, but you need extension in Klipper which can support your i2c device and integrate it in Klipper.
That link what I did send you - is this kind of extension, and there are multiple of those natively present in Klipper, the Statement like “It should not be used for extruder or heat bed” is there for some reasons, or integration is weak and it’s unreliable, or device can report wrong temp, or something else, but for example i don’t see this kind of statement on this sensor: Configuration reference - Klipper documentation
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.