WEEK 10

Output Devices

How the week started

Input device week did give an idea about how these devices work. So the output devices have been chosen after discussing with my instructor Sibin and Saheen.

How the week ended

The week did start off well. As part of the spiral development, I chose to try out a servo motor and a stepper motor. A bit of planning would have been better on my side. I am yet to test the module.

Week 10’s Assignment

Group assignment:

  • Measure the power consumption of an output device.
  • Document your work on the group work page and reflect on your individual page what you learned.

Link to group assignment

Individual assignment:

  • Add an output device to a microcontroller board you’ve designed and program it to do something.

Group assignemnt insight

We are calculating the power consumed by 3 NeoPixel lights (WS2812B). In NeoPixel lights, we can change the colors and the brightness. These affect the power consumption.

Source

Source

The board was programmed and then the NeoPixel was set to white light and 50/255 (20%) brightness level. The NeoPixels were powered from Bench Power Supply 9123A with a 5V supply voltage and 0.5A maximum current limit.

The probes were connected to the power and ground pins. A digital multimeter was used to measure the current consumption. The meter was set to current measurement mode. The probes connect the meter in series with the power supply to measure the current consumption. The measured current consumption was 0.0337A at a 5V input supply.

NeoPixel Power Consumption = Current × Voltage = 0.0337A × 5.0V = 0.16W
This means that if we want to run 20 NeoPixels for 3 hours, we will need 3.2Wh or about a 640mAh 5V battery.

Source

Source

With a motor controller board, we powered the servo motor. With a 5V input supply, it consumed 0.011A of current.
Motor Power Consumption = Current × Voltage = 0.011A × 5.0V = 0.05W

If you scroll a bit above you could find the group link. In case you are feeling lazy to do so Here is the link to group assignment

Why I need an Output Device?

This week we are using devices that interact with us. In my final project I need the sun to move in a curved path. This movement of the light is linked to the time in the RTC. The RTC tells time to the microcontroller, then the light moves. This is the output part.

To do this movement I need a motor. There are stepper motors and servo motors.

My understanding of Output devices

How Electric Motors Work

Introduction

What is a Motor?

An electric motor converts electrical energy into mechanical energy, usually as rotational motion. There are two types of electric motors based on the type of current they use, the coil design, and the magnetic field created.

Image source ‖ An Introduction to Motors ‖ What is an Eelctric Motor? ‖ ‖ Youtube - How does an Electric Motor work? ‖

DC motors

Image source

The DC motor works by direct current flowing to the commutator. The commutator is connected to the electromagnets. The electromagnets rotate as the polarity changes due to the current. The electromagnets are surrounded by permanent magnets. The rotation happens because of continuous switching of current direction through the commutator and brushes.

DC motors are of two types based on the commutation they use: brushed motor and brushless motor.

Brushed DC Motor

Dc Motors that use mechanical commutation , that is they use brushes as the mechanical contact. The current is delivered as the rotor turns, the brushes make contact with the commutor. These brushes stay in contact with the rotating part (Shaft).

Image source ‖ Brushed DC Motors ‖

BLDC - Brushless DC Motor

Dc Motors that use elctronic commutation are called Brushless DC motors (BLDC). As it operates without brushes it has high efficiency, long life, and precise control when compared to brushed dc motor.

  • ESC (electronic speed controller) electronically commutates the motor by controlling the flow of current in the stator’s winding based on feedback from hall sensors.
  • Hall sensor gives real time rotor position feedback, allowing the electronic controller to switch the stator coil current (commutation) at the precise moment for smooth, efficient operation.

Image source

‖ Working Principle of BLDC Motor (Brushless DC Motor) ‖

Stepper Motor

Stepper motors are a type of brushless motors. It is rotated by direct current. It is an electronic motor which rotates in steps rather than an continuous rotation motion. Since it rotates in steps it has larger number of magnetic poles.It divides a full rotation (360°) into a series of equal steps. This results in a step angle of 1.8°, which means each electrical pulse moves the shaft by exactly that amount.

Stepper motors have a relatively large torque, especially at low speeds .

Image source
What is Stepper Motor?

Stepper Motor + Driver

Stepper motors work based on the number of steps required for the motor to rotate. The number of steps can be called input impulses. The driver rotates the motor based on the number of steps it is instructed to move. The driver does not know the exact position of the motor, it only follows the given steps. Therefore, if there are any unexpected changes in the load or the device, the change in position of the rotation is not known by the driver.

Image source

Note

Before you read more, let's see some terms.
Feedback device: This is a sensor on the motor which keeps note of its position in real time, speed, steps, and direction. For example, a rotary encoder. If this is the knob on a stereo player and I turn it clockwise, it would increase the volume, so this converts physical rotation to digital pulses.
Open-loop system - NO feedback device If the motor is told to move 20 steps, and I happen to apply too much load on it, the motor may miss a few steps. The controller would have sent 20 pulses for it, but the load applied might have been too much to handle, and let's say it missed a few steps. The controller wouldn't know this.
Closed-loop system - WITH feedback device If the motor is to send out 20 pulses and only 16 steps are taken by the motor, the controller would get this report and send 4 more steps to complete the move to the correct position.

There are different types of stepper motors:
- Permanent Magnet (PM)
- Variable Reluctance (VR)
- Hybrid motors

A hybrid stepper motor has a closed-loop system. This allows for precise control of the steps with help from the feedback device. All basic stepper motors run as open-loop by default.

Motor used in board is 28BYJ-48 - 12V stepper motor Permanent Magnet (PM) stepper motor. - open-loop stepper motor.

REFERNCE and Gemini interaction

‖ Stepper Motors ‖ ‖ Brushless DC Motors vs. Stepper Motors 1 ‖ ‖ Brushless DC Motors vs. Stepper Motors 2 ‖

Image source

Servo Motor

Servo motors can roate to a specific angle or position. It has built-in position feedback mechanism therfore allowing precise control over angular velocity and position of motor. the servo motors are usually DC motors but somethimes AC motors. Servo motors are usually rated in kg/cm (kilogram per centimetre), Exanmple:

Stepper motors have a relatively large torque, especially at low speeds .

Image source

‖ Servo Motor Basics ‖ servo control of stepper motors ‖ Understanding Basics of Servo Motor Working ‖

Image source

Servo motors are usually rated in kg/cm (kilogram per centimetre). This means the torque the motor can provide at a certain distance from the shaft. For example, a 25 kg·cm servo means it can support 25 kg at 1 cm from the shaft. If the distance increases to 2 cm, it can support 12.5 kg. At 3 cm, it can support around 6.25 kg.

If the motor is unable to move due to excess weight, the current consumption increases.

Servo - Closed-loop feedback system

The servo motor control system continuously compares the input signal (desired position) with the feedback signal (actual position) obtained from the position sensor. When there's a difference, the control circuit generates an error signal that drives the motor until the desired position is reached. This closed-loop feedback system ensures precise positioning accuracy.

Image source

Image source

When connecting a servo motor, make sure the connections are correct:
• Yellow to PWM (Pulse Width Modulation)
• Orange to power
• Brown to ground
Note: One must cross check the pinout diagram of the microcontroller to identify the PWM pins and ensure the servo motor functions correctly.

Image source

MG90S Micro Servo Motor – 180° Rotation

image source

Pulse Width Modulation (PWM) is a technique used in electronics to generate an analog-like signal using a digital source. It is basically the digital signal being turned ON and OFF.

Lets meet the chosen ones - components

Stepper Motor : 28BYJ-48 Stepper Motor 12V DC

Buy
image source
Datasheet

Motor used in board is 28BYJ-48 - Permanent Magnet (PM) stepper motor. - open-loop stepper motor. This motor needs 12V to run and the XIAO could not be powered by 12V directly, so a voltage converter is added. Needs a stepper driver connected between the motor and the microcontroller. ULN2003 Driver Module, unipolar. This allows microstepping.

Stepper Driver : ULN2003 Driver Module

Datasheet

image source image source
image source

UNIPOLAR: These have 2 motor phases, with 2 coil windings in each phase, making a total of 4 coil windings. The current can flow in only one direction through each coil. Only half of a phase is powered at a time.

BIPOLAR: This requires only 1 coil winding per phase. Unlike a unipolar stepper motor, the current can flow in both directions through the coil.

This device allows control of small 4 phase, 5 wire stepper motors, such as the 28BYJ-48 stepper motor that we are using. The XIAO sends signals at 3.3V, which would not be sufficient to directly drive a 5V or 12V stepper motor. The stepper driver uses these signals to drive the motor using the external power supply (here the 12V connected). This helps the microcontroller safely control the motor. The ULN2003 usually comes as a driver module. In this module, LEDs are included on the board to indicate the active outputs.

Refrence : portescap.com & Reference : zbotic.in

Servo motor : MG90S

DATASHEET
image source

The motor is a 180° rotation motor. It is beginner friendly and mostly used in robotics and automation.

Operating Voltage: 4.8V - 6.6V DC
Stall Torque: 1.8 kg-cm (at 4.8V) to 2.2 kg-cm (at 6V). That means the servo can move 1.8 kg if it is at 1 cm from the motor pin with 4.8V. At 6V, the stall torque is 2.2 kg-cm.
Stall torque: this is the maximum rotational force that the motor can produce, after which the servo would not move. Even though the servo would not move, it would start to consume more current.

Schottky diode

image source

Schottky diode controls the direction of current flow. It allows current to pass in only one direction. Therefore, it is used in devices that require low voltage operation and the ability to switch quickly with minimal power loss.

Example: In my PCB this week, I am using a motor that requires 12V and a XIAO that requires only 5V. To ensure that only 5V reaches the XIAO, I used a Schottky diode. The diode provides a low voltage drop and fast switching characteristics, making it suitable for power management circuits.

This makes Schottky diodes an ideal choice for radio frequency applications and devices with low voltage requirements.

In the XIAO RP2040, all pins support PWM, so I could connect the servo motor to any pin. I connected it to D0.

Developer Baord - Seeed Studio XIAO RP2040

Pinout diagram Image source

Read more about this in wiki.seeedstudio.com/ or from my documentaion in WEEK-3 Used this becasue this was the XIAO I had used earlier, this could get the work done. I didint explore other Xiao Developer boards untill the further weeks.

KiCAD Designs

Electronics Rules Checker

ERC. I added the power flags to the mentioned points. This error occurs because KiCad doesn't understand where the power is connected to the board. This error wouldn't affect the physical aspects of the design.