I cant get Sensors to work. What is wrong?

Hi all,

I built a handheld CNC and I’m now trying to wake the monster up — but I can’t get any sensors to be detected. Maybe I bought the wrong ones, maybe all my PCBs are faulty, or maybe someone just doesn’t want me to use this awesome machine :wink:

How can I figure out what the actual problem is?

Is there a debug version of the firmware for the Arduino Mega so I can see more detailed information? Right now, the only thing I see in the serial monitor is:

Reconnecting to COM5 Connected!
SCREEN: Initializing…
Loading calibration coefficients:
Sensor 0: Cx:0.0102, Cy:0.0102, Cr:0.0000
Sensor 1: Cx:0.0102, Cy:0.0102, Cr:0.0000
Sensor 2: Cx:0.0102, Cy:0.0102, Cr:0.0000
Sensor 3: Cx:0.0102, Cy:0.0102, Cr:0.0000
Sensor0 initialization failed
Sensor1 initialization failed
Sensor2 initialization failed
Sensor3 initialization failed
Initializing SD card…Initialization failed!
SCREEN: Zero Machine XY
10655: sensing time = 10654783
SCREEN: Zeroing Machine XY…
SCREEN: Zero Workspace Z
31914: sensing time = 1516271
SCREEN: Zeroing Workspace Z…
SCREEN: Turn to
set thickness
0.00 mm

I disassembled one of the sensors again and soldered the wires directly, but that didn’t solve the problem either.

The sensors are from 1PCS Neue und Original PMW3360DM-T2QU LM19-LSI DIP PMW3360 PMW3360DM sensor objektiv LM19 - AliExpress 502 , and the PCBs were ordered from JLCPCB but soldered manually.

greetings from Germany :slight_smile:

EDIT:1

addes some debuging Serial.print to PMW3360

bool PMW3360::check_signature() {
SPI_BEGIN;
byte pid = adns_read_reg(REG_Product_ID);
byte iv_pid = adns_read_reg(REG_Inverse_Product_ID);
byte SROM_ver = adns_read_reg(REG_SROM_ID);
SPI_END;
Serial.println(pid);
Serial.println(iv_pid);
Serial.println(SROM_ver);
return (pid==0x42 && iv_pid == 0xBD && SROM_ver == 0x04); // signature for SROM 0x04
}

looks like SPI is not working:

Sensor0SS Pin: 30
0
0
0
initialization failed
Sensor1SS Pin: 10
0
0
0
initialization failed
Sensor2SS Pin: 31
0
0
0
initialization failed
Sensor3SS Pin: 32
0
0
0
initialization failed

Hi @smuk3d, can you please attach a close up picture of the sensor PCB with the soldered sensor? From what I can see, the wiring looks correct, so maybe there is an issue with the chip soldering.

Hi,

here some shots .. hopefuly good enougth.

Did some serious debugging and checked all the resistors on the PCB. Found a few that weren’t soldered properly. Re-soldered everything — and now the first sensor is working! I’ll go ahead and re-solder all the pads. Might’ve been a bit too stingy with the solder paste.

More updates to come :wink:

2 Likes

Awesome, great to hear! And thanks for those pics. I can definitely see how a cap or resistor could be messed up while hand soldering those. Good on you for going that route, though. I respect it

Looking forward to more updates!