Posts | Comments

Planet Arduino

Archive for the ‘digikey’ Category

DigiKey shared this vide on Youtube!

Which should you use for your project, Arduino or Raspberry Pi? In this video, Becky Stern shows you the primary differences and explains why you would choose a microcontroller or single board computer (SBC) for your project.

See more!

This week’s EYE ON NPI (video) is a compact and capable analog-to-digital converter, it’s the Microchip MCP3421 18-bit, 240 SPS, single-channel ADC.

This SOT-23-6 part is simple, inexpensive, and easy to use with an I2C interface that can run up to a 3.4MHz clock rate. Being able to power it from 2.7V to 5V makes it an easy-to-integrate component whenever you need an ADC that has differential inputs, adjustable gain, and a built in precision/low-drift reference voltage.

One of the trade-offs with getting 18-bit precision is that the ADC is not going to be very fast: you can configure the chip to do a faster 12-bit conversion at 240 SPS, but at 18-bits, it slows down to 3.5 SPS.

That’s because the way a sigma-delta ADC works, it ‘guesses’ the analog voltage and uses a comparator to determine whether the input is higher or lower. Each ‘guess’ takes an extra step, and thus halves the throughput, so 12-bit is 240 SPS, and 14-bit is 1/4 (2-bit) slower, 60 SPS. Ditto 16-bit is 1/4 slower, 15 SPS, and finally 18-bit is 3.75 SPS. However, sigma-delta ADCs are inexpensive, so as long as you don’t need high speeds there’s no reason to spec a faster and more expensive part!

The MCP3421 is already set up for differential inputs, which means that you can read positive or negative differences between the two inputs, as long as both signals are between 0 and 2.048V.

This means it’s not going to be great for reading stuff like potentiometers, where you have a single-end reading referenced to ground, and you want to read the full range from 0 to Vcc. It is great, however, for reading sensors like strain gauges, pressure sensors, or thermocouples.

The I2C interface for the MCP3421 is simple and well documented: there’s a command byte that can be written directly to set continuous or one-shot, gain from 1x to 8x and the ADC bit depth. Then, the current data can be read directly, with the status/’command’ byte following. Since the ADC is differential, note that the data will come out as binary 1’s complement for easy casting to a signed 16 or 24 bit variable.

Since there’s no address selection pin, you can determine which I2C the device responds to by purchasing a part code variant. For example, A0 is address 0x68, A1 is 0x69, etc.

We used ChatGPT to quickly put together an Arduino-compatible library in about an hour and it pretty much worked right out of the box minus a few typos. The final, tested library code is available here.

We also spun up a quick prototype PCB for the MCP3421 and it works very nicely, with a terminal block for the differential input, and Stemma QT ports to quickly plug into a variety of dev boards.

If you’re on the look-out for a well-designed high precision ADC to integrate into your next design, the Microchip MCP3421 18-bit, 240 SPS, single-channel ADC is an easy win. And, best of all, it’s in stock right now for immediate shipment from Digikey. Order an MCP3421 today and you’ll be convertin’ by tomorrow afternoon!

Want to see something super cool? Go grab your copy of Make: Vol. 68 and download the Digi-Key AR Guide to Boards app, then put them together to watch real magic happen. 

Read more on MAKE

The post Make’s Guide to Boards Has a Hidden Secret! appeared first on Make: DIY Projects and Ideas for Makers.



  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook