I am designing and building a CNC drill press machine and need to find a way to detect a scribe mark in dykem fluid on part with a flat surface. The machine will detect this scribe mark as the reference point and drill a path based on that point on the part.
I am having trouble finding some kind of photo sensor or camera sensor that will detect the fine scribe lines within the dykem that can connect to an arduino. Is there anything that exists?
A camera would be your best choice but what you need is not inexpensive.
Which color you are using will help!
I think that it's possible with a fine line sensor. I had a project a couple of years ago where I needed to build a custom counter that could detect a fine line (0.5mm thick) and count every time it was seen. Sensor for detecting thin lines | Cedar Lake Instruments
Now, a scribed line in Dykem is much thinner than that, but I think it's doable. When I was doing sensor research, I noticed that I could detect lines much thinner than 1mm but it required amplifying the voltage out of the sensor and seeing if the change in output was above a certain threshold.
So assuming that you are a fixed height above the surface, and you are illuminating it with a constant light level, your sensor should see a "blip" when it hits the higher reflectivity of the scribe mark. The trick will be adjusting to the background level, and looking for that sudden signal level change.
It's a fun project, but not trivial.
I saw that a pixy2 camera works well in detecting lines and making them into vectors. Also crucial to my project is they can detect the intersection between lines. They are $70. Are there cheaper options?
The fact is that the part could be any color. What I would be detecting is the absence of blue dykem, not its presence.
Thank you very much for your comment. Very nice project solution. Is the Optek OPB70DWZ sensor from your project the same one you would recommend for my project?
It would be a good start. TBH, one of the main reasons I created that blog post was so I didn't forget what sensor I used 
Hello again. I received the sensor and am wondering how to wire it to control using arduino. I've put the cathode and emitter to ground and am wondering what resistance to wire the anode to 5V and the collector to the logic pin. I saw that you had wired 4.7k ohm resistance to 5V to the anode, however I only own 10k and 330 ohm resistors. 14 resistors in series would achieve 4.7k ohm resistance, unless you have some other advice.
It's not likely to be a plug & play situation. I'd recommend starting with 10k LED resistors so the light doesn't swamp the sensor. In my situation I was able to read it as a digital input because there was a sharp contrast between the line and the background. In your case I think you're better off connecting it to an analog input and reading that value while printing the output to the serial terminal and moving the sensor to see how it reacts as it goes past the scribe mark.
You're going to be experimenting a lot!
Okay thank you. Did you put any resistors between the collector and digital pin? I just don't want to fry the sensor because I have a history of doing that to some stuff. Even with the 10k resistor the sensor tends to get warm. Is this normal? (And also I'm going to be starting out with black sharpie on white.)
That sort of depends on the WATTAGE of your resistor.
It is a very small resistor, I think 1/8.
Compute the power is must dissipate and see if that is why it heats.
That's not right. Unless you're powering stuff from a very high voltage, the power dissipation should be measured in milliwatts and nothing should noticeably change temperature. Check your connections!
Thank you for all your help. The sensor works just as I need it and no heating anymore.