Close

Current Measurement and finding 5 V on the Nano33 IoT

A project log for MicroGrid Connection Unit

Connecting multiple autonomous (renewable) energy installations in a safe way

tiefpunkttiefpunkt 05/11/2021 at 20:040 Comments

The current prototype of the MicroGrid Connection Unit uses a regular 5V Arduino Nano, and an ACS712 current sensor to measure the current flow to or from the grid. Unfortunately, the Nano33 IoT is running at 3.3V instead of 5V, but the ACS712 doesn't work at that voltage level. At least it's not really intended to. So there are a few options to deal with this:

---------- more ----------

Finding a different current sensor

Why did I go with the ACS712? Easy, because it's what I had on hand. I have a bunch of these little things in my parts drawer:

ASC712 Module

They are quite easy to use, so that's what i decided to go with. Its data sheet mentions the following supply voltage range:

So this won't do for the 3.3V of the Nano33 IoT.  So what do we do about it? The first idea was to check out the ACS712 maker, to figure out if it's part of a series, which also has modules for a different supply voltage range. And tada, turns out, there is the ACS711:

This would be just the part. This definitely goes into the next parts order. But that'll take a few more days, so what are the other options we have?

Finding 5V on the Nano33 IoT

It would be quite possible to just keep using the ACS712. How? Power the ACS712 off 5V, and use a voltage divider to adjust the output of the module to be compatible with the Nano33. Like so:

Most of this is rather straight forward, but one thing was interesting: Where do we get the 5V from? If you look at the pinout of the Nano33, there is a 5V pin:

In the MicroGrid Connection Unit, the Arduino will be powered from the local (solar) system via the VIN pin, and it will not be connected via USB. Now my memory tells me that there's only one voltage regulator on that Arduino, so where do the 5V come from? Let's look at the schematics. This is the connector section of the official schematic:

Pin 12 is the +5V pin, and if you look at it, you'll see that it's normally not connected at all. No 5V without doing some soldering, on the underside of the Nano33:

And then it's connected to VUSB. What's that? Also in the schematic:

VUSB is connected to the USB connector. Which, when plugged in, gets us our 5V. So how does the voltage regulation to 3.3V work?

That's where this section of the schematic comes in. The right side is the 3.3V voltage regulator. It "feeds" off of the VIN pin, and puts out 3.3V. But how does the Arduino power up on USB, without VIN connected? That's the part I almost missed. But there's a tiny schottky diode, D2, connecting VUSB to VIN. So if the USB port is connected, there's 5V on VUSB, and 4.5V on VIN. If VIN is connected, D2 blocks that from passing over to VUSB, potentially breaking whatever is connected to the USB connector. 

So where does this leave us? Pretty simple: No USB connection, no 5V. I wish that were a little clearer in the pinout. Can we still use the ACS712? Sure, but we do need a separate voltage regulator. Good enough for now, while I wait for the ACS711 order, but not really the nicest hack to go into some sort of a product later down the road. 

Other options

Of course there would be other options I could look into to measure the current, the most obvious one being a shunt. But I've never done that. and I also don't have the parts on hand to do so. I found this blog post, which will be something I'll look into and need to learn the ins and outs of but for now, I'll stick with what I know.

Discussions