In this video I (with some help) wire the connections for the NPN normally open proximity sensors, which I’ll be using as limit switches to the phoenix control board.
These switches operate between 6 and 36 volts, and I am planning to wire a pair of sensors in parallel for both the x and y axis, and a single sensor for the z axis. My plan is to use the sensors for the x and y to scan the perimeter of my available cutting area on my CNC machine.
My controller uses GRBL and needs an active low signal for these pins. Which means the pin will receive a constant 5v or little below, and only be active when a transition to zero voltage is applied. So when something metal moves in front of the sensor, the otherwise normally open switch will close (a little red light will turn on, on the sensor) and the voltage from the signal drops to zero – letting the controller know the limits have been reached.
As I couldn’t find proximity sensors which operated with 5 volts, or had a controller which could accept a higher voltage I was advised by both the controllers maker Hayri, and Nathan from Opentronic to use voltage dividers to drop the voltage down below the required threshold.
There are instructions online as to how to use voltage divider with the exact same proximity sensors I am using, when creating a bed levelling probe for open-source 3D printers. These often utilise 10k and 15k resistors with a 12v PSU. I thought this would be simple but I confused myself with a message in a previous video, in which I was advised to reduce the resistors by a factor of 10 to prevent problems with interference from the stepper drivers and spindle.
I subsequently bought the wrong resistors and have made this part of the project a little harder to edit.
I began by fitting a barrier block to one side of the controller which I can use to secure the cabling from the aviation mounts.
This has a bit of plastic which can protect the terminals. There’s only six (terminals) which means I can only connect the signal and ground coming in. and then to power the proximity sensors I’ll have a cable coming in from the 12v, and then use a small section of terminal like this maybe inside or further along.
I made sure to solder an extension wire to the screening on the cabling, and cut everything to size and crimped forked ends onto the wires I’ll be using.
I then installed them into the appropriate panel holes.
The green and black wires are a little shorter, and those are the signal and ground, while the red is the power.
I’m just putting some boot ferrules onto the end of those wires which I’ll then fix into the terminals.
I also daisy chained the ground terminals on the barrier block to the ground on the 12v PSU.
So I’ve just wired the ground to the black wire that goes to the aviation panel mounts and those intern go to the blue wires on the proximity sensors.
It is really important to make sure all your PSU’s are connected together so the ground potation between all three are the same.
I also checked that these PSU’s don’t have floating grounds by checking the connection between the earth and ground terminals with a voltmeter. So I can use the voltage dividers with the proximity sensors on a 12v power supply, and the control board on a 24v, and still use the ground terminals to screen any cabling.
So just wired an aviation socket mount to one of the proximity sensors. If I haven’t made a mistake the black wire goes to green, the blue goes to black, and the red goes to brown. Which means as I’ve used an extra bit of wire of wire to connect to the control board, red is number 4 which is brown, and black is number 3 which is blue, and green is number 2 which is black. I think that makes sense.
What voltage am I getting down there, have I done this correctly?
Using the helping hands, I hold the 10k and 15k resistors roughly in place, tin the two areas that will be join and finally solder the two wires together.
I use heat-shrink to cover the exposed wires and label one resistor so I know how to orientate them when installing. The 10k resistor goes to the terminal with the green wire which is the signal wire from the proximity sensor, and the 15k goes to the terminal connecting the ground from the sensor and the 12v Power supply.
The other thing to mention is you’ll need to have the proximity sensors wired and plugged into the aviation panel mounts, otherwise the circuit will not be complete and the voltmeter will read zero after the voltage divider.
Ok I think I need to wire the rest of the proximity sensors, just so all the circuits are complete, because it seems to be doing something a little bit weird there.
Because I’m still unsure as to how I will manage the cabling from the sensors on my CNC machine, and I know I want to redesign and recut the plates. I’ll just wire a single sensor to each socket so I can test the connections for now.
If I do the X the same thing happens, but for some reason if I do the Y it goes all the way to zero.
I was getting some odd results from the voltmeter, and naturally began undoing what I had put together thinking that would identify the problem, but electronics doesn’t seem to work like that. I asked Nathan to pop down and use a fresh pair of eyes to help me problem solve.
So this is Nathan from OpenTronic, the first thing he… I am OpenTronic. He is OpenTronic Yes. He looks human but he’s actually a cyborg sent from the future. I’ve got a feeling my life would be a lot easier if I was. So the first thing he’s noticed is that I wired one of the proximity sensors aviation panel mount sensors wrong. I suppose the point with this is though I didn’t immediately see that, but I just kept saying to Savvas, with what you are describing you physical wiring is not the same as your electronic diagram. I started measuring the output – so basically what Savvas has done is wired the ground of the sensor to here (black wire) and the output of the sensor to here (green wire) and basically we weren’t seeing any output at all, and so the most obvious thing to do then is follow this hole thing back to the panel, and considering what Savvas has been saying about how difficult it is to wire up these aviation sockets, I just thought no output coming from the sensor. Bingo. Means my brain must have sabotaged the process without me realising. But then the next strange thing that we’ve notice is when I measured the output… when we measured a different sensor which was wire correctly. So this is the expected behaviour of the sensor. Have that probe on ground and that probe on the output, and when it’s not triggered it’s 12 volts, and when it is triggered it should drop all the way to zero. But then when we connect the voltage divider just now we were seeing that the overall potential when the voltage divider was connected was something like 7v, and at the Arduino it was only 2v. And that might have worked for the Arduino’s TTL inputs but it’s very peculiar. We need to get you a theme song for every time you turn to the rescue. Something along the lines of superman. So I guess like I was saying, before potentially the Arduino itself is acting like part of a voltage divider and making a very complicated bottom half of the voltage divider. I just wonder if the, because you have these but they are again, the circuit diagram isn’t complete because these are not connected to ground (on the PSU). I mean I had it all set up like that before, and I took it all apart just to see what would happen. Yeah. I don’t know if you could use these to bridge them. oh yeah.
We reconnected all the ground terminals to the 12v power supply, but was still getting an unusual reading. Even Nathan was a bit stumped and I didn’t want to take up too much more of this time, and when he left I systematically went over all the connection tightening all the terminals, adding boot ferrules to the end of the voltage dividers which gave me a little more material to make sure those were securely in place. And once I was sure nothing else was loose it just started to work.
XYZ, 4.6, Z 4.6, Y, 4.6 on X, that’s really confusing. A combination of not wiring my panel mounts correctly at the start, and possibly not connecting something correctly over here, but the voltage dividers seems to be doing what they meant to be doing. That’s with the proximity sensors being triggered. That one works. That one works as well, what a bloody relief.
It’s clearly important to check, double check, and triple check you’re soldering and crimped connections. Making mistakes is very easy to do and I seem to do then quite often on this project – but I haven’t electrocuted myself yet, so you lot might get to see the end of this.
So the final thing I need to do is ground the shielding on the limits of the x, the y and the z. And I think I’ll leave this as it is for now, and get a larger terminal size between this and the large one, and swap that over just so I can get another cable over there.
So I’m really thankful to Nathan upstairs, and everyone else who’s sort of given me some good suggestions along the way. I’m not sure what happen at the end there, the reading weren’t coming out as they were expected, even Nathan noticed that and didn’t quite understand why that was happening. I just tighten everything up and made sure the connections were ok. Obviously I made the mistake of wiring one of my proximity sensors panel mount sockets incorrectly, but it seems to be working now, and that’s a relief. I think this is my new catch phrase, for this series of videos. Welcome to the end of another episode of how to nearly electrocute yourself and destroy your equipment while making a CNC machine. That was a relief.