Olenka Odar - Fab Academy

11 Output Devices

In this section we list the activities to be solved in the following table:

Checklist Estatus
Linked to the group assigment page Finished
Documented how you determined power consumption of an output device with your group Finished
Documented what you learned from interfacing output device(s) to microcontroller and controlling the device(s) Finished
Described your design and fabrication process or linked to previous examples. Finished
Explained the programming process/es you used.   Finished
Explained any problems you encountered and how you fixed them. Finished
Included original design files and code Finished
Included a 'hero shot/video' of your borad Finished

Individual assignment

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

For this part I will use the Fab XIAO RP2040 board that I made in electronic production and the following devices:

Stepper Motor 28BYJ-48

It is an electromechanical device that converts electrical pulses into discrete mechanical movements. The shaft or spindle of a stepper motor rotates in discrete step increments when electrical pulses are applied to it in the proper sequence and at the proper time intervals.

learn more

Servo motor DP0090

A servo motor (0 to 180 degrees) is a device that has the ability to move to any position within its operating range and remain stable in that position.

learn more

WS2812B LED strip

The strip of RGB LEDs, which can be individually controlled using a single-cable interface, giving you full control over the color of each RGB LED.

learn more

Stepper Motor 28BYJ-48

This device works with the ULN2003 Driver, a driver specially designed to drive the 28BYJ-48 (unipolar) stepper motor. It works at 5V and has up to 7 control channels, in my case I used the IN1, IN2, IN3 and IN4 channels connected respectively to the D0, D1, D2 and D3 pins of my card. Do not forget to feed the card at 5V. The connection is very simple.  

Servo motor DP0090

This device only consists of 3 cables: GND, VCC and a third one for the signal output that will be connected to pin D0 (GPIO 26). I take as a base the program modified by Adrián Torres to make it work.

Final Project Test

WS2812B LED strip

My project consists of making a lamp for children who are afraid of the dark. But what can I use so that the lamp illuminates, in different colors and shapes and also does not need many connections? An interesting alternative is this RBG led strip because I can independently control each led with a single control cable.

I used a 20 led strip, it comes with a projector and works with a 5V voltage; it has three wires: 5V (red wire), GND (white wire), and a control pin (green wire). 

I made a small test program, after several tries you can manage to activate two leds.

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.

I will also do this assignment individually. 

DP0090 Servo Motor Power Consumption Measurement

To know the power consumption of the servomotor, I used the multimeter connecting it as shown in the figure (we must measure in series, that is, the circuit will be closed through the multimeter).

When making the measurements, the current varies from 18.66mA to 49.17mA.

To find the energy consumption, we must use the formula: P = I x V.

Taking the highest current consumption 49.17mA and the supply voltage of 5V, we have:

Converting to amps.

P = 5V x 0.4917A

P =  0.24585 W

PWM output signal on oscilloscope

Finally, I use the oscilloscope to see the variation of the frequencies when the servo moves, for this I place one end of the oscilloscope on pin D0 and the other on GND.

Here the images of the output signal from pin D0 are shown, configuring the oscilloscope to see the waveform in "multiple cycle" (image on the left) and as "single cycle" (image on the right).

In the video I configured the oscilloscope to see the wave as "simple cycle" since the variation of the pulse width is better appreciated. 

  • Video on the left: current measurement with the multimeter.
  • Video on the right: variation of the pulse width of the output signal on pin D0.

Drawbacks, solutions and what I learned

  • Including the "Servo.h" library in the Arduino program greatly facilitates working with the servo motor.
  • Do not forget that to measure the current consumption in the servo motor, we must place the multimeter in series in such a way that it closes the circuit and configure the multimeter to measure in mA and direct current.
  • To be able to work with the LED strip it is necessary to have the Adafruit NeoPixel library installed. At first I couldn't activate them, but after reviewing Adrián Torres's program, I realized that I was missing that library (thanks again Adrián).

  • It is also important to indicate how many leds are going to be controlled and that the number 0 corresponds to the first led, so if we are going to use 8 leds we must address from 0 to 7, in order to control the leds. Thanks to this, it is possible to independently control each LED.
  • Some tutorials recommended placing a resistor between the output pin of the card and the control pin of the led strip, I did it but the leds didn't turn on, so I decided to remove it and it worked.
  • Another thing that must be taken into account and that they recommend is to feed the led strip with external 5V, but if it is done that way we must not forget to connect all the GNDs.
  • The ULN2003 driver makes it easy to connect and control a stepper motor.

Programs

   10.   12 .