Wiring an Electric Motor with the mySTEM for NI myDAQ

kristielNational Instruments, Tutorial

How to Wire an Electric Motor with mySTEM Project Board for NI myDAQ

Share this Post

We’ve been working on a series of activities that explain how you can enhance the capabilities of the National Instruments myDAQ using the mySTEM Project Board. This week, we’ve got another exciting mySTEM Project Board project to share. This time around, Mark will walk you through how to wire a 12V DC motor to the mySTEM and control it using the ElvisMX tools from NI. At the end of this project, you should have a 12V DC Motor that you can turn on and off using a digital input. You’ll also be able to reverse the direction of the motor.

Getting Started: Materials List

First things first, here is everything you will need for this project.

Start by watching this video tutorial. Instructions appear below.

How to Wire an Electric Motor with mySTEM

1. Connect a pin-pin cable into the DIO 0 port and connect it to the EN 1 port on the mySTEM Project Board

mySTEM Electric Motor A

Connect a pin-pin cable into the DIO 0 port and connect it to the EN 1 port

2. Plug another pin into the DIO 1 port and run it to the DIR 1 port:

mySTEM Electric Motor B

Plug another pin into the DIO 1 port and run it to the DIR 1 port

3. Use your screwdriver to loosen the Output 1 screws, as seen here:

mySTEM Electric Motor C

Use your screwdriver to loosen the Output 1 screws

4. Take a pin-pin cable and push one end into the left Output 1 port and then tighten the port to make sure it holds the cable in place. You should be able to lightly tug on the cable and not have it slide out of the port. This is your positive port.

5. Do the same thing with the right-hand port of Output 1

6. Now, plug the 12V Power supply into the power supply port of the mySTEM board.
NOTE: My power switch is set to OFF in the picture below. I highly recommend that you switch it to the OFF position while you wire things to make sure you don’t accidentally shock yourself or damage the board.

7. Connect your Output 1 cables into your motor. Your motor should have + and – terminals listed. Plug the right-hand port into the negative terminal and the left-hand port into the positive terminal. You must make sure that the metal of the pin is touching the metal of the terminals.

8. Connect the mySTEM to the myDAQ and plug the MyDAQ into your computer

9. Open the ElvisMX Instrument launcher on your computer. The easiest way to find it is by opening your start menu and typing “Elvis”. Open the ElvisMX Instrument Launcher that shows up.
NI ELVISmx Instrument Launcher

10. Once it’s open, choose the Digital Writer option
ELVISmx Digital Writer

11. Now that the digital writer is open, click the “Run” option at the bottom of the window. Now that it’s running, you can turn channel 0 on to turn the motor on. You can turn the channel off to turn the motor off. While the motor is on, you can turn on channel 1 to reverse the direction of the motor. Be sure to set all the pins to off before you stop the program.

And that’s all there is to it!

Summary & Conclusion

We wired our mySTEM Project Board so that a digital signal sends an electrical signal to our board, which then triggers a 12V signal to send to our motor. We use the DIO 0 port for our digital signal, which can be controlled via the NI myDAQ using ElvisMX or the LabVIEW software. The DIO 0 port sends a signal to the EN 1 input, which tells the board to send 12V to the motor via the Output 1 port. The DIO 1 port sends a signal to dir 1, which reverses the polarity of Output 1, which causes the motor to spin the other way. It’s a very simple setup. The main thing to notice here is that we are using, essentially, a 5v board to power a 12V motor. This is possible because of the external 12V power supply that we have connected to the board. If we wanted to, we could use a 5V motor and connect it directly to the breadboard of the mySTEM board and it would work without the external power supply. Of course, we wouldn’t want to do this with our 12V motor since 5V isn’t enough voltage to power our 12V motor.

Hopefully, you can see why this setup can be beneficial. The mySTEM Project Board is largely intended to be an educational tool.  Because you can hook it up directly to the NI myDAQ, and control it with NI software, it is incredibly powerful.

Get more mySTEM projects: Check out the curriculum prepared by STEM expert, Tom White.

Blogger: Mark Philipp, Application Engineer at Studica

Share this Post