PIR Sensor analog value oscillation?

You're not missing anything; it's OK as it is. Heed the advice of @Paul_B on wiring though.

The 'problem' is that you keep mentioning in your schematic a 'led driver'. A led driver as such is NOT a 12V power supply. However...in this case, it probably is. I know this is confusing, but the confusion mostly boils down to the inappropriate/inaccurate use of terminology by producers and sellers of (low cost) electronics.

A 'led driver' does exactly what the label says: it drives leds. Leds need to be fed with constant current and as such, a led driver is generally a constant current source (ccs). This means that regardless of the voltage it needs to put out (within reasonable limits), it will always try to supply a certain number of amperes/milliamperes to the load. Led drivers also generally have a dimming input for either an analog or a digital (PWM) dimming signal to reduce the light output of the leds.
Due to its task, i.e. supplying constant current, a led driver inherently does not have a constant voltage output. In other words: if you have a module that requires a specific voltage (12V), a led driver is not a good choice, since it may give a higher or lower voltage as a function of the current that is actually drawn by the module.

A constant voltage power supply is what you need, and that does exactly the opposite of the led driver: it tries to keep the voltage constant, no matter how much (or little) current is consumed by the load. Of course, again within reasonable bounds. This is what you need for modules like relay boards etc. that need to be fed a specific and constant voltage.

Now, why is the above relevant to know, but not necessarily a problem with your component choice? The issue is that these days, many sellers (especially on eBay, AliExpress etc.) sell constant voltage supplies intended to power led modules, and call them 'led drivers'. This is not accurate, and actually confusing, as they technically are NOT led drivers! This happens because many led modules (such as the popular led strips that you can cut to any desired length) have the current limiting electronics built into them and therefore want to be fed with a constant voltage.

It seems that you have one of these so-called 'led drivers' that is in fact a constant voltage power supply, more specifically a small switch-mode power supply. If so, it will likely work fine as a 110VAC to 12VDC converter.
However, it makes more sense (also economically) to just search for a '12V switching power supply' and then pick a unit that can supply at least the amount of current your project is expected to draw at its peak with a margin. Generally, by searching this way, you'll find more, cheaper and potentially also smaller power supplies that actually do what you want.
Give it a try; I'm sure you'll quickly find unboxed SMPS modules that are even smaller than the one you have now, or the Meanwell-style power supply units that come in shiny metal boxes with screw-mount terminals on one side. They generally work quite well and are very cost-effective.

It would certainly go to the same "5V" pin, the important thing being that this pin is where both terminate - the 5 V from the power supply (which is the buck converter), bundled with the ground to the Arduino from that converter, and the connection back to "VCC" on the relay module, bundled with the control wires to the "IN" pins on that module.

So the wiring to the relay module is not shared with the wire connecting the power supply.

There are other types of 12v power supplies. the MeanWell mentioned is common and simple to use.


you connect 120 VAC to the AC input and 12VDC to the output

There is one point about 120 VAC. trying to eliminate myths and opinions. the NEC or National Electric Code requires that 120 VAC be isolated from any voltages under 54 volts. this is very simple to do, you may have seen cardboard inside of a TV set that separates the two voltages.

In the hobby world, we are concerned that a stray wire or slip of the screwdriver might make your work, exciting.

It is good practice to limit low voltage wires in the AC side of the project to only wires that need to be there. and vice versa.

And you need a plug and cord with the ground pin, and connect the ground wire the the "Earth" symbol connection of the power supply. Note that this terminal is between the AC mains and 12 V output terminals. :grin:

An true warning is that all indications are that you are switching neutrals.
Very bad.

The 120vac hot is live all the time when plugged in.

You should switch the 120vac hot line.

Sorry for any delay in replying - it’s the work week again and my time for working on this has been limited. I have been reading the replies and continue to appreciate the advice!

I don’t have cardboard separating the two but I do have about a yard of electrical tape around all exposed contact points for the 120VAC except the NO/C terminals on the relay that switches it, which will be covered next. Which brings me to…

I saw that suggestion back in post #9 and have updated my design to switch the hot line, as shown in my updated block diagram in post #15.

I get how that works with a standard receptacle - are you suggesting that I replace the GFCI receptacle I have with a standard?


Nope. Don't replace

I had assumed you were planning. Not troubleshooting

Once you have things in place, the selection bit is done.

I will be curious if switching the neutral affects the GFCI.

Doing some of both. :grinning: I have all of the components shown in my diagrams but I’m willing to replace them if there are better solutions.

Me, too - in the limited testing I had done of that part of the project with the hot switched the GFCI tripped every time the relay turned it on.

I suspect the relay needs to come after the GFCI. If the GFCI is integrated into the outlet you are somewhat likely to have problems. :face_with_raised_eyebrow: