Answers.Body: <p>The hardware solution is to simulate the motor circuit on pins 5 and 6.</p>
  
  <p><a href="https://i.sstatic.net/ZNwcd.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/ZNwcd.png" alt="snippet of official LEGO motor schematic"></a></p>
  
  <p>There is a <a href="https://youtu.be/Ns3TODgRlCE" rel="nofollow noreferrer">YouTube video</a> by TechnicRobot that shows one way to do this. </p>
  
  <p><a href="https://i.sstatic.net/Dvbre.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Dvbre.png" alt="wiring diagram from video"></a></p>
  
  <p>I'm not sure I understand completely the logic behind this wiring. Personally, I would just connect pin 6 to pin 3 directly and connect pin 5 to pin 3 using a 3.3k resistor so that it exactly matches one of the 4 possible states of an EV3 Large motor.</p>
  
  <p>When you do this, the EV3 will detect your motor as an EV3 Large Motor. However, you shouldn't use the Large Motor blocks in the EV3 software. Since this hardware hack won't provide a position feedback signal, those blocks won't work correctly. Instead, use the Unregulated Motor block (one of the blue "advanced" blocks) to control the PWM duty cycle.</p>
  
  <hr>
  
  <p>To get a PWM signal on pin 2, simply run the motor in reverse. It is not possible to get a PWM signal on both pin 1 and pin 2 at the same time using the official LEGO firmware.</p>
  
  <hr>
  
  <p>For anyone looking for a software solution rather than a hardware solution, there are some similar questions that should be helpful:</p>
  
  <ul>
  <li><a href="https://bricks.stackexchange.com/q/9881/3498">Using the unregulated motor block and conversion cable to light LEDs</a></li>
  <li><a href="https://bricks.stackexchange.com/q/2325/3498">How to use Power Functions with Mindstorms EV3?</a></li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-28T19:40:57.637Z
Answers.LastActivityDate: 2018-10-28T19:40:57.637Z
Answers.UserDisplayName: David Lechner
Body: <p>Looking at the hardware developer pdf, it looked like the EV3 should output a PWM signal with a duty cycle corresponding to power level. It does, but only for 100ms and only on pin 1.</p>
  
  <p>Is that how the signal should look or is it because the EV3 know there's no motor attached?</p>
  
  <p>I'd like to do this all in hardware if that's at all possible.</p>
  
Tags: <ev3><motor>
Title: How can I get the EV3 to control an ordinary motor with PWM?
UserDisplayName: griffin175
ThreadText: # How can I get the EV3 to control an ordinary motor with PWM?
  
  (Asked by: username_0 on 2018-10-28)
  
  Looking at the hardware developer pdf, it looked like the EV3 should output a PWM signal with a duty cycle corresponding to power level. It does, but only for 100ms and only on pin 1.
  
  Is that how the signal should look or is it because the EV3 know there's no motor attached?
  
  I'd like to do this all in hardware if that's at all possible.
  
  **Tags:** ev3, motor
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-10-28. Score: 1 | Accepted answer
  
  The hardware solution is to simulate the motor circuit on pins 5 and 6.
  
  [![snippet of official LEGO motor schematic](https://i.sstatic.net/ZNwcd.png)](https://i.sstatic.net/ZNwcd.png)
  
  There is a [YouTube video](https://youtu.be/Ns3TODgRlCE) by TechnicRobot that shows one way to do this.
  
  [![wiring diagram from video](https://i.sstatic.net/Dvbre.png)](https://i.sstatic.net/Dvbre.png)
  
  I'm not sure I understand completely the logic behind this wiring. Personally, I would just connect pin 6 to pin 3 directly and connect pin 5 to pin 3 using a 3.3k resistor so that it exactly matches one of the 4 possible states of an EV3 Large motor.
  
  When you do this, the EV3 will detect your motor as an EV3 Large Motor. However, you shouldn't use the Large Motor blocks in the EV3 software. Since this hardware hack won't provide a position feedback signal, those blocks won't work correctly. Instead, use the Unregulated Motor block (one of the blue "advanced" blocks) to control the PWM duty cycle.
  
  ---
  
  To get a PWM signal on pin 2, simply run the motor in reverse. It is not possible to get a PWM signal on both pin 1 and pin 2 at the same time using the official LEGO firmware.
  
  ---
  
  For anyone looking for a software solution rather than a hardware solution, there are some similar questions that should be helpful:
  
  * [Using the unregulated motor block and conversion cable to light LEDs](https://bricks.stackexchange.com/q/9881/3498)
  * [How to use Power Functions with Mindstorms EV3?](https://bricks.stackexchange.com/q/2325/3498)
  
  
  ---
  
  