UNO to D1 Mini to MQTT

I’ve looked for an answer to this but failed to find the answer, so hoping someone can give me some help.

I have an Arduino UNO, most of the analogue inputs are used for analogue reading.

I wish to send all these analogue readings via WiFi to an RPi MQTT server (Broker).

I have a D1 Mini to do the WiFi part (with a level shifter).

Using these components what is the best way of sending my analogue readings to the RPi? The UNO is using Software Serial to send messages to the D1 Mini.

Does the #include <PubSubClient.h> run on the UNO or D1 Mini?

Advise would be much appreciated.

On the D1 Mini.

Idahowalker:
On the D1 Mini.

Thanks for answering.

Would you suggest sending result from each AtoD on the UNO as "SoftSerial.print(An's result)" to the D1 mini with some form of identifier?

e.g. A0#23.23 and then get the D1 Mini to send the data (prefixed by A0#) with client.publish("xxxxx", 23.23).

Why two processors and two sketches.
Could be more logical, depending on the sensors, to connect an A/D to the D1 mini, like the ADS1115.
No Uno.
Leo..

Read this: How to connect ESP32 to Amazon AWS IoT Core using MQTT find Sending sensor readings to AWS IoT using MQTT and read from there to see the thing do's to be done. Ignore the AWS stuff.

If you need WiFi, use a board with Wifi. You will sleep much better.

Wemos D1 Mini plus MCP3008. Done.

Thanks to all for ideas, I will use an ADC IC and dispense with the UNO.

Different sensors need different types of A/Ds.
The ADS1115 or the MCP3008 might not be suitable for your unspecified sensors.
Leo..

Wawa:
Different sensors need different types of A/Ds.
The ADS1115 or the MCP3008 might not be suitable for your unspecified sensors.
Leo..

One analogue input is from a Voltagesensor ZMPT101B , another is from DFROBOT SEN0098 , and another is from a pressure sensor which measures water content in a tank. The remaining inputs measure temperature etc.

The ADS1115 looks an interesting device, the MCP3005 I am familiar with. I will consider the best device since you have raised the point.

The ACS758 definitely needs a 5volt ratiometric A/D, so maybe not an ADS1115 for that one.
The MCP3008 seems suitable if you power it with 5volt.
In that case level shifting must be done when interfacing it with a 3.3volt processor.

If... the pressure sensor has a 10%-90% output (wrongly sold as 0.5-4.5volt), then the same as above.

Don't know about the ZMPT101B, but it could be better with an absolute A/D (like the ADS1115).

Temp sensors could be analogue or digital. Digital is usually less problematic and more stable.
Leo..