Our builder has some other pics on his website from when the house was almost done. We are missing our big fridge and backsplash in these pics, but I think most of the other stuff was done. http://www.arkoscustomhomes.com/scenicview.html
Here is the wiring schematic. One relay will control 2 inputs and one output. So, for stereo sound left and rigth you will need two relays.
Connect the “-” terminals for all 3 RCA jacks on each speaker side (RCA input 1 Left, RCA input 2 Left, and RCA output Left). Repeat for right inputs and outputs.
Connect the RCA outputs to the middle “common” terminal on the relay. Connect the left output to one relay and the right to the other
Connect RCA input 1 to the “NC” on the relay. Connect the left to one relay the right to the other.
Connect RCA input 2 to the “NO” on the relay. Connect the left to one relay the right to the other.
With this setup you can individually trigger the left and right relays, so you could have input 1 playing through the left speaker and input 2 playing through the right. I use my script in HA to always change GPIO23 and GPIO22 at the same time so that both speakers play the same input. You could also hardwire this by soldering a “Y” wire that goes from one GPIO pin on the ESP32 to 2 input pins on the relay that you always want to switch together.
The “Output L” and “Output R” are RCA outputs. They plug into the input of an amplifier. The speakers plug into the amp output. So it goes: Input audio device (chromecast, tv, etc) > RCA switcher > amp > speakers.
The “input 1” and “input 2” can be any audio device that uses RCA. In my case, input 1 is a Chromecast device (chromecast device is plugged into an HDMI > Audio extractor) and input 2 is the TV in my garage.
You could “Y” the output L and output R into multiple amp inputs then hook the speakers into those amp channels. For example, I use this amplifier. Each channel handles 1 speaker and there are 2 channels per zone. So, if I wanted two speakers in the garage and two speakers in the living room to always play the same thing I would “Y” the output L and output R cables from the RCA switch box into zone 1 and zone 2 input. Then I would hook the garage speakers to zone 1 and living room speakers to zone 2. Or, in the case of my amp I linked to, it has 2 Bus inputs. So I could hook my output L and output R to the Bus 1 in on the amp then set zone 1 and zone 2 to use bus 1 as the input source.
This was great to read. Thank you for sharing your journey and definitely giving me ideas of what to do next. It took me 5 years to make my home smart, slowly and gradually buying different things. Please keep sharing your updates or if any of the things you used didn’t work out. I am actually thinking about buying few of the hard-wired sensors you used.
Also how long did it take you to set all the things you mentioned? I am very curious.
Incredible work Brad thanks for sharing.
One little question, when connecting your esp32 to the relay board aren’t you using a shift level? The esp32 outputs are 3.3V and the relay board is fored with 5V signals, I’m I right?
It’s hard to put an exact time frame on it, mostly because it’s a work in progress and always will be. I’d say the system was 95% operational within 4 months of moving in. But, I was also preoccupied with moving in, working full-time, and helping my wife raise a 3-month-old and 3-year-old.
During construction, it took me 9 full days to pull all the wires and conduit. It took two and half more full days to terminate all the wires at both ends. After that, a lot of the implementation into HA was a couple of hours at night for several weeks. I already had the ESP/Opto-coupler boards built and code written, so that helped.
I’d say if the wires are all pulled and all that was left was to terminate them and add everything to HA it could be done in 40 hours.
Yeah no I meant the digital outputs of the esp32. You will be driving each relay in your relay board with the 3.3V digital outputs, ex GPIO23, 22, 21, etc. So wouldn’t you need a level shifter to convert to 5V?
I’ve never needed one. I just hook the 5v and gnd from the ESP to the relay board then hook a GPIO to each relay. It’s been working great.
I did accidentally hook the 3.3v from the ESP to a relay once. It would sometimes flip the relay and sometimes not. Once I realized I had it hooked up wrong and I correctly hooked it to the 5V on the ESP it has always worked.
Hi Phillips, Nice writeup and thanks you so much, my question is do I have to use Optocoupler? I was thinking if I can use ESP32 internal pulup voltage for 20 door and windows contact, is it possibible?
I originally tried that and I had some issues with false triggers. I think the long wires were picking up interference and messing with the GPIO inputs.