LM317 problems with digital rheostat

I don't think this is going to fix your problem, but since I brought the subject up and for the sake of completeness. I was suggesting you connect 18V GND to Arduino GND, so there is a common ground reference for all parts of the circuit. When a normal isolated ACDC power supply produces (say) +5v and 0v it just means the + is 5v higher than the -. There is no absolute 0 for the -ve to be, just that the + is 5v higher than whatever -ve is. (Isolated basically means the power supply has no continuity from the DC + or - to any of the AC input pins, the AC side is not providing an absolute reference.) Your second 18v supply is almost certainly doing the same. What you cannot say is how the potentials on the 18v supply compare to the potentials on the 5v in absolute terms. Your circuits are definitely joined at the SPI link. When the arduino wants to send a high it sets the SPI output pin to 5v above arduino ground but the MCP is comparing that signal to a delta above 18v ground. Unless both sides have the same 0v reference there is no absolute point of reference between the two circuits. Just connecting the -ve's does no harm in the same way that just connecting the -ve of a battery won't power a circuit until the + is conneted to complete a loop. There is no loop between the two power circuits as long as only the grounds are linked, but linking the grounds does establish the same 0 point for both power circuits and allows signalling between them. Having said all of this, there are situations where you need to be careful, non-isolated supplies, supplies being split to create a virtual ground (i.e. take a +12v - 0v supply and convert it to a +6 to -6v by creating a midpoint voltage and declaring it as the circuit ground reference point.) (Deep breath) The most common example of this is using an arduino output to switch a transistor controlling on/off or pwm in a second circuit, the 2 grounds must be linked as the transistor exists in both circuits. Here, in your case, the SPI connections exist in both circuits. Having said all of this, and being 95% sure you should be connecting the grounds, I only have limited schematic info and limited time to look at it and I would hate to be responsible for causing you more trouble so proceed at your own pace/risk. Best of luck.

/r/AskElectronics Thread Parent