An Arduino & ESP project, multiple sensors

Hello all,

I have an intention to build a large system around an Arduino Nano (328) and ESP8266-12E. The system should have the FM tuner, option to receive bluetooth audio from a phone and to send the FM audio to a BT speaker. The controls should be capacitive through glass switches, an LCD pro showing the informations, an RTC for functions like clock, alarm, timer, temperature and humidity sensor, wifi, a sound path (source/destination) selector and a switch for 120 SK6812 LEDs.

Idea is to have an option to send MQTT data to other location from the temp/hum sensors. The ESP may be a slave to Arduino for just that function, for that and some other functions, because I assume that I will not have enough memory to implement all in one Arduino. I do not know enough about ESP to understand the pro’s and con’s of Arduino slave to ESP or ESP slave to Arduino.

Until now I have a working solution of MPR121 capacitive sensor with pcb switches behind a glass panel, a few SK6812 with logic level shifter reacting to the touches. On another Arduino I have a working SI4703 tuner with PAM8403 amp.

I have found out that some of the libraries that I will need would not work on an ESP (ex. SI4703 and MPR121 libraries). I have tried to find a bluetooth module which would be able to sink or source an AD2P signal, but at the end opted for an end user device which should be able to send or receive analog audio signal through AD2P protocol (I assume that I would need about three lines to control this device, one to set the direction, source or sink and two to start/accept pairing process, but the device has not yet arrived so I do not know for sure). There will be two audio sources, remote bt and FM tuner and two destinations, PAM8403 amp and remote bt speaker, so I need a selector. I intend to use Panasonic TQ2-L2-5V latching relays, two of them back to back. That brings me to the first question, what would be wise to use to control the latching relays?

The relays use reversing polarity to set/reset so I searched for DC motor control circuits which utilizes I2C control and found DRV8830 as one of the solutions and various H-bridges as the other. There are also specialized circuits intended for use with latching relays but they may be an overkill.

The other question that I have at this moment is about the display. I would take a Nextion display if I can benefit of it, but I have never worked with graphic displays so I do not understand is it beneficial to use a Nextion vs. a graphic I2C controlled display. I intend to use a 2.8"-3.5" graphic display to show data like temperature, humidity, fm station, volume, time/date, settings menu, while the mqtt data should be not accessible by the user. How would I use a Nextion on an Arduino when the Arduino has only one UART port, should I use an FTDI adapter for another uart port, or use the display on ESP and use some other method (I2C?) to communicate between Arduino and ESP? At this stage I am completely lost and any help would be appreciated.

You certainly have an ambitious project ahead of you if you intend to integrate all this stuff.

Arduino Nano (328) ESP8266-12E

120 SK6812 LEDs. MPR121 capacitive sensor logic level shifter SI4703 tuner PAM8403 amp Panasonic TQ2-L2-5V latching relay with DRV8830 Display (Nextion or graphic I2C) Various bluetooth device ??

You have specified an ESP8266-12E but not said (or maybe I've overlooked it) that you also require WLAN functionality.

The Nextion display uses a serial interface (even software serial) so can be used directly with an Arduino. I2C is not an option and FTDI is not relevant. See

You can interconnect a Nano with and ESP8266-12E using I2C (via level shifters). You define one as the master and the other as the slave.

Thank you for taking time to read and answer.

The only function that I need from the ESP is WLAN. This should be the first node of a larger set of modules throughout the apartment with with sensor and state data exchange through MQTT via central Raspberry node. On the other hand if I use the ESP for WLAN I can also use some other of it's resources.

But, at that point I am not yet able to evaluate the pro's and con's of ESP master Nano slave vs. Nano master ESP slave. Can you help on that matter?

I have come up to this block diagram: |500x312

The bluetooth device in question is this one. I am hoping to be able to connect arduino pins to imitate the button presses, but it's no deal breaker if the device would be used to start the pairing process.

The relays should be sufficient to transfer sound at line level. But, I am not yet sure about the control of the relays, the only option that I have found by now is DRV8830, is there anything more appropriate available?

SK6812 Singles are single diodes which behind capacitive switches which change color when the switch is touched (and the code for it works). SK6812 strip also works. FM tuner works.

An open question is still Nextion, but if it can be connected by use of Software Serial, it's clearly the better choice.

So, by now I have I2C (two lines) for FM, MPR121, DRV8830; two lines for two SK6812 sets; two lines for display; 2-3 lines for BT device control if applicable, two lines for sensor(s). So, the only issue is how soon will I run out of memory, and can I use memory available on ESP to control some external functions from the ESP (wifi, mqtt, display?).

My main problem is that I would not be able to make some device work if the lib for is not available, so I must constraint myself on circuits/modules which already have libraries available. Also, I want to avoid need for production of one of a kind circuitry and rather go with available modules.

Is there anything that I have missed to take into account?

I have found a possible alternative for the temperature and humidity sensor, the Si7021 module, which conveniently has also I2C interface, which can be more practical for my use case