0
\$\begingroup\$

I wanted to design a clock based system that would do a task at a certain time, but I do not possess a microcontroller like Arduino due to lockdown(Corona pandemic). My task involves making a motor run at 6 am in the morning. I know that USB can give 5V supply to the motor(I have a motor that can handle 5V and actually needs 5V). Now what I am asking is, is it possible to manipulate or write a program and load it in phone that would turn on the motor connected to the phone via USB(the USB portion of the micro USB cable has been cut off to expose the 5V line). The motor would turn on when clock in phone strikes 6 am. So how can I achieve this control mechanism?

\$\endgroup\$
3
  • 1
    \$\begingroup\$ This type of low level control of the usb port is not available on many phones and on the few that it is, require root and kernel hacking. \$\endgroup\$ – Passerby Apr 14 '20 at 17:15
  • \$\begingroup\$ So, if I am able to root it then can I switch on and off the USB output voltage at any desired time? \$\endgroup\$ – Prasanjit Rath Apr 14 '20 at 17:16
  • \$\begingroup\$ Root is only one part of it. You would need to modify the system, and develop code to enable any hardware PMIC that may possibly allow usb otg power control. It's so many IFs that it's unlikely to happen and you probably don't have a phone that can do it. \$\endgroup\$ – Passerby Apr 14 '20 at 19:09
2
\$\begingroup\$

Don't use USB. Anything you do with USB will require a processor of some kind, and complicated software on the phone - if it can be done at all

Do it the easy way.

Your phone certainly has an alarm clock.

Plug an earphone plug into the phone, and use an analog circuit on the earphone output to turn on the motor.

Something like this circuit:

enter image description here

Leave off U2, the microphone, and the associated parts.

Connect the earphone output of your phone to C6 and ground.

When the alarm clock on the phone rings, the alarm tone will activate the circuit and turn on the motor. A second alarm tone will turn the motor off.

You'll probably have to try out various alarm tones to find one that triggers reliably. You may also have to try it with different volume settings.


There are simpler circuits. That's one I found by searching for "sound activated switch."

You'll probably want to use a relay to switch the motor.

You can leave out

\$\endgroup\$
1
  • \$\begingroup\$ Sound, yes!! Thank you for pointing me in this direction, it looks it can be implemented relatively easily, although I have to check if i have all components to build a circuit. But how did that slip-sound from audio jack. Let me get back to this answer after trying. Thanks again! \$\endgroup\$ – Prasanjit Rath Apr 14 '20 at 17:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.