Posts

Showing posts with the label adc

Low-cost solar power source for microbits

Image
  Solar panel, microbit, battery and regulator Update I have made a few improvements since this post was published in September 2022: The key change is to use a   separate low-dropout regulator (LDO) to provide the 3.3V supply to the microbit and other components. I had previously used the microbit's internal regulator. I found subsequently that it has a curious high-current region as the battery voltage drops, which leads to a period of rapid battery discharge.  AA rechargeable cells, with 1200 mAh capacity, replace the previous AAA 850 mAh cells I use a 2W solar panel and a smaller current limit resistor, so that I can get a higher charging current I added a PNP transistor to the output of the TL431 shunt, so that it can handle more than 100 mA These changes do add a little to the overall cost, but they do give more reliable operation under a wide range of solar input. Introduction This article describes a low-cost DIY solar power source which is aimed at school...

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...