Writing PCB surface detection