Height Adjustment with ky-008 sensor

Hi to all,

i want to control a dtg printer platen height. i have ky-008 laser sensor and ldr sensor. When the ldr sensor low the motor will turn on and get the platen lower. is there anybody to help me about coding that ?

Thank you.

Can you read the LDR?

Can you read the laser sensor?

Can you make the motor "turn on"? Do you know how far the platen needs to move? Do you know how long to run the motor for to make the platen move that far? What kind of motor is it? I'd expect the printer to use a stepper motor to control the platen height. You do not just "turn on" a stepper motor.

Hi Paul,

With ldr unit i can read the analog and digital signal. i just need to drive motor if digital signal low.

The laser will be open all the time targeted to ldr and when the ldr doesnt get light the Step Motor will start to move untill ldr gets light again.

Thank you