Posts

Showing posts from August, 2022

Microbit with an external ADC

Image
Update 4 Sept 2022: I found that the ADS1115 code below works fine when you are reading one channel. But when you are reading more than one channel (i.e. switching from one to the other) you can easily get a wrong reading. The reason behind this is described on a TI forum here . Briefly, you need to have a delay between setting the ADC channel and reading the conversion result. I have written an unpublished MakeCode extension which adds simple blocks and handles this delay. It can be used by pasting its Github location into the MakeCode Editor's "add extensions" search bar. Introduction This post shows how you can connect up a low-cost external ADC to a microbit using the I2C bus. The ADS1115 ADC has 4 channels and an on-chip voltage reference. Example code is provided for Micropython and MakeCode/JavaScript. Background The microbit includes an ADC, but it has limited usefulness for measuring voltages - particularly if you want to monitor the microbit's supply voltag...