Skip to content

13. Output devices

1. Group assignment

1. Measure the power consumption of a small 28 by 48 stepper-motor

We needed to use 2 of those in an object I am making, that has to move around. We connected both and put the multimeter in between the power line to measure the current going through.

This measures around 520mA, which is in line with the datasheet. The datasheet tells us such motor would draw around 240mA each. This is setup was powered by a 7.5V DC/1A wallwart power supply.

We can now calculate Power consumption in Watts with the following formula:

P = V x I → P = 7.5V * 0.520A = 3.64 W

2. Measure vibration motor

For our final project we would need the vibration motors like in a cellphone to make our pager puck vibrate. To figure out if we can run them on the 3.3V lipo battery we want to use and if we could directly power them from the output pins of the ESP8266. We hooked on up to a lab powersupply and measured how much current it needs to run.

We gave the motor around 3V DC to run smoothly. The current output of the PSU was set around 0.3 A. With the multimeter connected in series between the power source and the motor we saw that it actually uses 167.5 mA. The motors we have, we don’t find the details of them anymore. But we looked up something similar from the same supplier. We think ours are a somewhat older and also less efficient.

On this website https://diyi0t.com/control-dc-motor-without-ic-motor-driver we found the esp8266 only supplies 12mA on the digital output pins. That will definitely need a transistor or a mosfet to control the vibration motor.

2. Individual assignment

I used the same board as I did for the input devices using the ESP chip. As an output I chose to work with an RGB Led.

On the RGB led you have G V and I. G connects to ground. V connects to the power. I connects to the pin you want to use to send data.

It ends up looking something like this:

With the RGB led in place, it time to make it burn.

Again, I used arduino to code the ESP. If this is your first time using the ESP, you can find how to set it up in the input devices

The code to have the

/* Blink RGB ESP test

#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <espnow.h>
#include <Adafruit_NeoPixel.h>

#define PIN 13 //=wemos D1

Adafruit_NeoPixel pixels = Adafruit_NeoPixel(1, PIN, NEO_GRB + NEO_KHZ800);
int delayval = 500;

void setup() {
pixels.begin();
}

void loop() {
pixels.clear();
pixels.setPixelColor(random(0), random(0, 255), random(0, 255), random(0, 255));
pixels.show();
delay(500);
}

The result:

3. The files

Arduino code


Last update: June 18, 2021