Hi All,
I am trying to get this script working but failed despite days of grappling blind, without enough knowledge.
The input of CH1) of the mcp3008 varies between 3,3 and 1,6V by 10k +10k potmeter divider.
Please be assured that there is no wiring fault, grant me that much after 50 years in ICT.

The script runs ok but the returned readings are erratic and do in no way reflect the input.
The output seems to rise and fall cyclically. The valeus rise to 265 and then falls to 0 and rises again and so on.
Varying the potmeter has no visible effect on the reading.

The script runs ok but the returned readings are erratic and do in no way reflect the input.
The output seems to rise and fall cyclically. The valeus rise to 265 and then falls to 0 and rises again and so on.
Varying the potmeter has no visible effect on the reading.

Any suggestions?
Thanks

Have you actually put a meter between the input pin and ground and measured the voltage you never know you could have a faulty component in your potential divider circuit.

once you have proved the potential divider circuit try connecting the input to a ground and see if you get a reliable zero result then, you never know you could have a bad mcp3008 or just a bad connection.

never assume just because you think its right it is, prove the hardware first.

Remember we want information.......................no information no helpThe use of crystal balls & mind reading is not supported

I have the same issue. Can't figure out what it is. Channel 1 to 7 on my MCP3008 reads fine. Channel 0 shows a nonsensical value. When I have my transistor switch on all the time that powers the sensors, the readings are fine. When I power them up 5 - 30 seconds before taking the readings, channel 0 shows nonsense.