Add an output device to a microcontroller board you've designed,
and program it to do something
Group assignment:
Measure the power consumption of an output device.
Brief about output devices that I used
In this week I decided to use Servo motor , stepper motor and LCD as it will be used in the final project.
Here is a brief about servo motor: A servo motor is a device that contains an encoder which converts the mechanical motion (turns of the shaft) into digital pulses interpreted by a motion controller. It also contains a driver; and in conjunction, they make up a circuit that governs the position, torque and speed
And about the stepper motor: A stepper motor, also known as step motor or stepping motor, is a brushless DC electric motor that divides a full rotation into a number of equal steps. The motor's position can then be commanded to move and hold at one of these steps without any position sensor for feedback (an open-loop controller), as long as the motor is carefully sized to the application in respect to torque and speed.
Demo/Tips and Trics
Stepper motor
I starte to make a demo of the cicuit with Arduino UNO before working on the PCB ,just to make sure all the connections and the circuit design is correct.
Here are the components:
1)Arduino UNO
2) Power supply 24Volt
3)Driver"DM542E"
4)Bread Bord
5) Stepper motor Nema 23
6)Cable
I chose this motor to be compatible with the design of the final project as it will be mentioned later in the final project page the calculations that lead me to choose this motor.As for the driver : I could have made it myself with H-bridges ,I studied and reviewd how to make it.But this motor is too powerfull for H-bridges and modules,that is why I used this driver .Here is a brief why :
I needed the power suply to be 24V to operate the motor.
So to connect all the components together I serached in the datasheets,it's not complicated but it could be tricky.
So to begin with I started connecting the motor with the driver ,I reviewd the datasheet of the motor which is bipolar with 8 leads.So the motor could be wired in series or in parallel.
Here is the explaination that I found:
Then I proceeded by connecting the microcontroller with the driver.
I connected the power supply to VCC and ground to the driver and from the other side of the cable 220V .This cable has 3 wires .The trick here is to search for the color code to know which is L,N and ground of the cable ,but if you can't find it just use a multimeter.
And finally:for the PA settings:
Tips and tricks:
If the circuit doesn't function, here are some tips
Divide to conquer.
Test every component alone then test the connections for example :-To test the stepper motor, attache two connected leads to a led and turn the motor shaft manually if the led blinks then the motor works properly.
-To test the power supply use a multimeter and read the values.
-To test the Arduino, programe it to set some pins high and read the output with a multimeter.
Then I programmed with Arduino UNO here is the code: