SOLVED: ToF and Digital Pot Control

Hi everyone.

I was wondering if you can assist me or point me in the general direction. I have basic understanding of coding enough to get me by with simple smaller projects. But I'm confused on this one.

I have a ToF sensor VL53L0x I want to control the RPM of a motor using the measurements taken from the sensor.

As my hand gets closer it speeds up to max then as it moves away it slows down until it stops.

I can do this using the built in PWM on my Arduino UNO and a 12v pc fan no problems. But when I want to go to a stronger higher RPM12v motor i need a more external powerful higher freq output PMW controller. The one I have is controlled by a 100k Pot. I have an X9C104s chip that will do 100 steps. I can easily control this by code to control the motor automatically or with an on/off detection. But combining the ToF measurement to the X9C104s so it controls the resistance thus PWM and RPM based on the distance of my hand I can't seem to figure out.

Any help is appreciated and I thank you in advance.

What makes You think that a higher frequncy would be better? What problem would it take care of?

I don't see how a digital pot could control a motor.
They are designed for signals, with tiny currents.

Use a logic level N-channel mosfet if the motor should only turn one way.
Diagram#1 here.
Or a H-bridge motor driver for both directions.

You can convert the output of the VL53L0x to PWM values with the map() function.
Leo..

Hi,
Welcome to the forum.

Please read the post at the start of any forum , entitled "How to use this Forum".
OR
http://forum.arduino.cc/index.php/topic,148850.0.html.

Can you post the code you have now with your present motors?

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png of your present system, showing motor and power supplies.

Thanks.. Tom... :slight_smile:

Sorry I took so long to reply I have been gone awhile. I have a PWM controller that uses a 100k pot to determine the PWM Freq to output. I was wanting to replace the thumb turn pot with a digital one. (I already had these items on hand)I ended up doing as WAWA said before I read it and bought an H bridge motor driver. I already had the map() function setup so it was easy to just plug it in and go from there.

Thanks for the help.