Porting Software from UNO to a larger board

I have built a family of sensors that connect to UNO Wifi R4 and communicate with a Windows computer via UDP. My latest project is to measure the power usage from an AC panel box that has 5 branch circuits and a main breaker.

To measure current I plan to use the Gravity analog AC current sensor which has a split CT on each branch circuit. Each has an analog output and I am using 6 of them going into A0 -> A5.

To measure the Mains voltage, I was planning on using the ZMPT101B board which also has an analog output. The problem is I am out of analog inputs on the UNO.

Does any know of an 120VAC voltage sensor that outputs to SDA and SCK?

If not, how difficult would it be to port my routines to a another arduino devices with more than 6 analog inputs. Which board would be closes to an Uno Wifi in terms of software compatibility. I use the WifiNINA, SPI and WIFIUdp libraries.

My code uses my own libraries I've developed with literally hundreds of procedures and don't want to port (rewrite/test/move into production) them for a single sensor into a new development environment. Any help appreciated.

Get an analog multiplexer to expand the number of pins.

Or an external ADC board, connected via I2C.
Like Adafruit ADS7830 8-Channel 8-Bit ADC with I2C [STEMMA QT / Qwiic] : ID 5836 : Adafruit Industries, Unique & fun DIY electronics and kits (8 * 8bit) or maybe Adafruit ATtiny1616 Breakout with seesaw - STEMMA QT / Qwiic : ID 5690 : Adafruit Industries, Unique & fun DIY electronics and kits (9 * 10bit)

You can keep your code if you switch to a Nano, you will gain two additional A/D inputs. It may even be less expensive.

In the opening post is a reference to an Uno R4 WiFI :wink: But it's not 100% clear if this project runs on a normal Uno or on the Uno R4 WiFi.

I also wasn't sure but the OP does mention using the WiFiNina and WIFIUdp libraries so it would indeed seem most likely that he is using a UNO Wifi R4 rather than a Uno R3. The R4 has a more powerful 32-bit Renesas RA4M1 (Arm® Cortex®-M4) processor which has much more memory and includes a larger number of analog pins than the 6 that are actually exposed on the UNO R4 board as well as other additional feature pins.

There is a discussion here about using the 'not connected' pins, but its not trivial and its one thing trying to implement them in code but quite another trying to make a physical connections to them!

^Using Not Connected Pins on RA4M1 - #6 by KurtE

I did wonder whether the Portenta C33 might be a suitable upgrade:

^https://docs.arduino.cc/hardware/portenta-c33/
https://www.mouser.co.uk/ProductDetail/Arduino/ABX00074?qs=ulEaXIWI0c%2FkaqBZMljOXw%3D%3D

It has an even more powerful Renesas R7FA6M5 processor and although it exposes just one additional analog pin on the edge connectors, a lot more is exposed on the high-density connectors on the bottom of the board, . These pins can be accessed using the Portenta Hat Carrier.

^https://www.mouser.com/pdfDocs/ASX00049-datasheet.pdf?srsltid=AfmBOor9e-bEfIh57AilK7gNbMjgQh4uOQr61CsOj6WJDKLc2CU0LXbQ

Of course the downside is the cost. An external ADC board is cheaper by a factor of 10x....

I am not sure that I understand the reasoning behind choosing such a powerful processor but then hindering its potential by squeezing it into the UNO R3 form factor. I guess familiarity of board layout and compatibility with shields were factors that outweighed tapping into the full potential of this Renesas chip.

The sensors modules in my system (arduino boards) all used Arduino UNO WiFi Rev2.

Thank you all for your help I do appreciate it.

Please clarify which board you are using, the UNO WiFi Rev2 or the UNO R4 WiFi.

The UNO WiFi Rev2 has more than six analog inputs, if you use the MegaCoreX board package.

https://forum.arduino.cc/t/does-the-arduino-uno-wifi-rev-2-have-more-than-6-usable-analog-pins/1134068

Thank you will research the MegaCoreX.

consider using an ESP32 which has sufficient ADCs for your application and is low cost (approximately sensors £7 on EBAY in UK)

I have used a ESP32-4-Channel-Mains-Current-Sensor module with three CT sensors to measure 3-phase current loads and plot graphs