Support Forum

Share your projects and post your questions

Register   or   Sign In
The Forum

[TimeoutError]: read_raw: channel X conversion timed out

126 Views - Created 05/06/2023


Posted by:

Suhyun Avatar

Hello abelectronics.

your ADC Pi s doing a huge role in my project. Thanks for great work.

I've built the circuit connecting Raspberry pi Pico W and ADC pi, activating 3 channels(1,2,8) and it works well at first. However, after 2~3 minutes or longer, it throws out the error like:

[TimeoutError]: read_raw: channel X conversion timed out

The timeouterror did not happen when I built the same system with Raspberry pi 4, but It started happening at connection with Pico W(fyi, I used different ADC pis, but I've build 3 same circuits and the error happens same at all 3, i think faultiness of a single one is not the problem).

Channels throwing out TimeoutError are random.

I searched on the forum to find some clues, and found some library modification was done for full-sized raspberry pi boards but I'm not sure it was done for micropython library( as well.

If it was done, can I get some clues about causes of TimeoutError I mentioned above to fix my work?

Sorry if the question was stupid, and if more information is needed, I'd be more then happy to give it to you.



Posted by:

andrew Avatar

United Kingdom

andrew Twitter  andrew Website  

Hello Suhyun

The timeout error could be cause by the ADC library not giving the Pico W enough time to fetch the ADC sample.  Try modifying the library to increase the timeout_time value and see if that fixes the problem. 

On line 218 in change:

timeout_time = time.time() + (100 * seconds_per_sample)
timeout_time = time.time() + (1000 * seconds_per_sample)


Posted by:

Suhyun Avatar

Dear Andrew.
Your solution absolutely fixed the problem. I ran the code for last 12 hours and it worked well.
I appreciate your help. Have a nice day.

Sign in to post your reply

Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view.
Download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.