output devices¶
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.
Individual assignment:
- Add an output device to a microcontroller board you've designed and program it to do something.
Added Unexpected Bonus¶
Learned to use UGS¶
I learned about other ways to connect to my Genmitsu and got lots more practice at it.
Got to meet Prof. Neil GershenfeldNeil and his amazing wife in person. I also got to meets lots of other people who are associated with fab and [Heaven from Atlanta] - in my fab cohort.
The Work¶
My asset files are here.
Mr. D gave us a presenation make sure that the motor shares the ground.
Stepper Motors¶
Website Tutorial from Tom Dubick
Key Learnings - Current Limiting: make sure your motor driver current rating is equal to or higher than your motor so that you dont burn up the driver. If it is lower, the motor will be limited on how fast it can go. - to protect the driver from current spikes. power suply 8-36V then use a decoupling capacitor atlest 47uF microFarads capacity - two phases on motor - one set goes to 1A ansd 2A pins. The other goes to 2A and 2B pins ( to find the phase pair use the multimeter and then check for continuity. If you find the phase, you will heere a beep becasue the two wires are connected.) - DRV8825 might be easier to use. has higher 1.5 A and can be measured easier (current limit = Vref x 2).
NEMA 8 Motor¶
Oukeda Motor, model 8HY2001-10
Although, I couldnt find a data sheet, I did find some information on the NEMA 8. Source.
This is a Nema-8 bipolar stepper motor 0.6A 33x20mm for mill cutting, CNC engraving machine, 3D printers.
- Step Angle 1.8° ± 5%
- Power: 3.9 Volts
- Current 0.6A
- Resistance per phase: 6.5Ω ± 10%
- Inductance per phase: 1.5mH
-
Holding Torque: 2 kg-cm
-
Bipolar stepper, requires 2 full H-bridges!
- 4-wire, approx ~16" leads
- 33mm x 20mm rectangle body
- 4mm diameter drive shaft, ~9mm long
- 3.9V rated voltage (you can drive it at a lower voltage, but the torque will drop) at 600mA max current
- 35 ohms per winding
A4988 Motor Driver¶
A4988 Motor Driver Pins (1 Amp Max): - 1A ansd 2A pins. The other goes to 2A and 2B pins - power for pins (3 to 5V) from controller - power for motor (5V + external power supply) - STEP and DIRECTION pins (each pulse we send to the Step pin, the motor will advance one step in the selected direction.) - Sleep and the Reset pins (both of these pins are active low) Sleep pin by default is HIGH state, but the RST pin is floating. To have the driver enabled connect these two pins to each other, If not using these pins functions. - Enable pin is also active low, so unless if not HIGH, the driver will be enabled. - MS1,2,3 are for microstepping - energizing coils at intermediate locations to get more steps and smaller steps.
Picture is from this site
V= Imax * 8 * R Amps 0.6 max (use 80% of this) = .46 Amps V was 5.15 from the 4 batteries R from the little resisters on the A4998 - maybe .1 Ohm like video?
PROMPT: why is there an 8 in the formula for the A4988?
V= Imax * 8 * R
ANSWER: The 8 comes from the A4988's internal current sensing circuit.
The A4988 doesn't measure current directly — it uses a comparator that triggers when the voltage across the sense resistor reaches a threshold. But that threshold isn't V_ref directly. Inside the chip, V_ref is fed through a voltage divider that scales it down to 1/8 of its value before comparing it to the sense resistor voltage.
So the chip is actually comparing:
V_sense = V_ref / 8
Rearranging to solve for the current at which the chip will cut off:
I = V_sense / R = (V_ref / 8) / R
Flip it around to solve for V_ref:
V_ref = I × 8 × R
That's where the 8 comes from — it's just the reciprocal of the internal voltage divider ratio (1/8 → multiply by 8).
My NEMA 8 needs 3.7 V - so my 5.15 Volts from my 4 batteries should work.
Practical implication: if you measure V_ref and it reads higher than expected, your current limit will be higher than you think — which is why setting it carefully with a multimeter before connecting the motor matters.
Hook up the microprocessor 5V and the ground. then use alligator clips
Turn the potentiometer until you get V = .6(80%) * 8 * .1 V = .384
So I need to measure and adjust as noted below.
Current Limiting: - adjusting the trimmer potentiometer - Clockwise - limit rises. - Method One: - measuring the reference voltage across the potentiometer itself and GND using a multimeter (in ammeter mode), and use that value in the following formula to calculate the current limit of the driver: - Current Limit = Vref / (8 x Rcs) - The Rcs is the current sense resistance or the values of the current sensing resistors located right next to the chip. Depending on the manufacturer, these values are usually 0.05, 0.1 or 0.2 ohms. - Method Two: directly measure the current through the coils - connect the stepper motor and the driver, skip the controller connections (except for the 3.3/5v power and ground using here), but instead connect micro controller power/3.3V/5V to the Direction and the Step pins (the motor stays active and holds one position). - connect the - disconnect one line or coil from the motor, and connect it in series with an ammeter. - When the driver is powered with both the logic voltage, the 5V, and the power for the motor (maybe 12V depending - know your voltage) then read how much current is running through the coil.
Stepper Programming
Can be done with or without library.
// defines pins
#define stepPin 2
#define dirPin 5
void setup() {
// Sets the two pins as Outputs
pinMode(stepPin,OUTPUT);
pinMode(dirPin,OUTPUT);
AccelStepper library - install from library manager
Define your motors - Basic example code for controlling a stepper with the AccelStepper library by Dejan
#include <AccelStepper.h>
// Define the stepper motor and the pins that is connected to
AccelStepper stepper1(1, 2, 5); // (Typeof driver: with 2 pins, STEP, DIR)
AccelStepper stepper2(1, 3, 6);
void setup() {
// Set maximum speed value for the stepper
stepper1.setMaxSpeed(1000);
}
void loop() {
stepper1.setSpeed((analogRead(A0));
// Step the motor with a constant speed previously set by setSpeed();
stepper1.runSpeed();
}
Open Time Help¶
Help from Adriann Torres in GLobal Help Saturday and a couple other people. I was not fast enough to get the names I should have screen shotted the chat. Adriann gave me a link to his site and how he worked with the Esp32c6.
I did the twist on the motor test to figure out which two wires of my NEMA8 are a pair. When the twist was clicky, those were a pair compaired to smooth when you turn the motor shaft.
DRV8428 SMD Motor Driver¶
Working on a new board with a surfacemount motor driver. I have been using the A4988, but its near impossible to find VERTICAL surface mount female pins in KiCad to mount that on my board. They make them Horizontal THT and then the pad is very small and round becuase it wants you to make the hole to have better stability. Also, the ones that are listed in the fab library on KiCad site are no longer available. I can see that they were used in previous work by fab students.
The preferred fab motor driver for stepper motors is the DRV8428. So we are workign on mapping pins from the ESP32C6 to the DRV8428.
Tom Dubick provided us with this motor driver comparison chart
I used this and the following claude conversation to map pins to the ESPC6.
Tom Dubick also sent his own suggested wiring instructions. https://docs.google.com/document/d/1acNblAnlg70Kan-OT0NuM_hm--GMW3qd4d_s9w-fnFA/edit?usp=sharing
AP2112K-3.3 regulator suggested by Claude.¶
NEW RABBIT HOLE>>>
CLAUDE SAID: Your ESP32-C6 needs 3.3V The ESP32-C6 can't run directly off 6V — you'll need a regulator between your battery pack and the ESP32.
CLAUDE PROMPT: "find other fab academy student sites from the last 3 years that used the AP2112K-3.3 and give me links to their sites"
CLAUDE RESPONSE: I'm not finding direct hits for the AP2112K on Fab Academy student sites through search — the search engines aren't indexing the actual schematic content deeply enough to find specific part numbers on student pages.
CLAUDE PROMPT: look in outputs week in thier assignments and look for a surface mount motor driver
RESPONSE SUMMARY: All the response claude sent were using a chip more like the A4988 and having the vertical female connector pins that are no longer available for us. One used a different motor driver.
I found some very relevant results. Here are Fab Academy students who designed custom SMD stepper motor driver boards — the most relevant to your project:
DRV8428 specifically:
-
Svavar Konradsson (2023, Iceland) — researched the DRV8428 directly, noted it was used in the Urumbu boards, and designed an A4950-based board as an alternative when DRV8428 was out of stock:
-
Judy Curie (2023, Mexico) — tried to use Neil's DRV8428 reference design, documented the exact PCB and wiring, but had to switch due to chip availability:
- Laxmi Renjith (2024, Kochi) — designed a custom - SMD PCB using DRV8825, created her own SMD footprint — very close to what you're doing.
Claude gave me some conflicting advice. So I decided to go look at some past fab projects to see how they mapped it. CLAUDE PROMPT: find other fab academy student sites from the last 3 years that used the DRV8428 and give me links to their sites
Students who actually built a working DRV8428 board:
- Jyo Pari— MIT HTMAA 2025 (the MIT equivalent of Fab Academy) The best example I found — actually designed the schematic, built and debugged a working DRV8428 board, and modified Neil's reference code. Detailed documentation including schematic design process and wiring notes:
Students who researched the DRV8428 but switched to something else:
A recurring theme — chip availability and trace width requirements (0.1mm minimum) stopped most students from completing DRV8428 boards on milled PCBs.
-
Svavar Konradsson — Fab Academy 2023, Iceland. Researched DRV8428 via Urumbu boards, had 2 chips but unavailable at Digikey, switched to A4950:
-
Judyta Cichocka — Fab Academy 2023, Mexico City. Found Neil's DRV8428 reference design, couldn't mill it (0.1mm traces), switched to A4988:
-
Sara Fernandez — MIT HTMAA 2025 Chose the DRV8428 from lab inventory, designed it in KiCad, but found the pin pitch too fine for the Carvera to mill:
Neil's official reference design (the one all these students referenced) This is the source — Neil Gershenfeld's DRV8428 hello board that all Fab Academy students point back to here.
The consistent theme you'll notice: the DRV8428's HTSSOP package requires very fine traces (~0.1mm) that most Fab Lab milling machines struggle with — which is exactly the challenge you're navigating by designing for PCBWay fabrication instead of milling it yourself.
OK - between the need for a regulator and the small traces.. this is not a beginner project. This is an after FA project - let's go back to the vertical pins and get this thing working.. back to the A4988
BIG STOP>>>>>>> I CAN'T MILL THAT SMALL .. tried many many times...

Milling Board 4¶
Much time spent milling boards... Since it's week 10, I am putting it here, but this board is really a week 9 10 combo. I started over and designed a new board. Its good practice. If all goes well, it should be able to read the photo sensor and then turn a servo based on the readings.. I also left room to add lights in case the servo JST was just too small for me to solder.
Milled a new board using USG as suggested by my open group team: Adrián Torres, Rico Kanthatham, Pablo Nuñez, Miriam - AKA Ye Eun Miriam Choi
Miriam - AKA Ye Eun Miriam Choi has used the same machine.. so she shared her code and I was able to find her settings inside the code. She has been mattermosting back and forth with me all day yesterday and this morning. Super grateful for that support team this weekend.
This site by Mateusz Nowak was also super helpful. He also has the same machine.
Kicad Settings for milling board on the 3018¶
Traces should be greater than 0.5mm.
Here are the trace settings I used in my board set up.

Let's also talk about the resistor sizes... I learned about those as well. There are a few sizes in the Fab Library: Small, Smaller, and Smallest (603)..

The ones we were give in our lab are 805. I was able to find those in the standard libary and use those. It also helped explain why it they didnt seem to fit the pads when I was soldering.

I wanted to have bigger pads to solder onto, so I changed the footprint in the footprint editor.

Which changed the footprint on the PCB makinga bigger pad.

I also changed through hole pads to surface mount pads to be able to use connectors and jumper wires or add ons to my board easier.

I tried to renumber my connectors to match my ESP32, but it didnt like that.. and ended up throwing errors.. so I had to change it back.


KiCad likes the switches to be connected. This is redundant, but not terrible.. and makes sure that if one side is not contacting, the other can be a redundant system.

Gerber to PNG¶
Then took it to the Gerber to PNG website.
See the settings that I copied from Adrian during open time.

Settings in MODS¶
So I followed the settings in the instructor bootcamp.

UGS¶
So I used the following resources to get my UGS up and running. - https://academany.fabcloud.io/fabacademy/2024/bootcamp-instructors/workshops/Soldermask/
I used a youtube video by James Dean Designs - highly recommend to help me understand how to make the measurements for the calibration.
I did follow all the machine calibration steps which took me a good 2 hours. I had to move things around and take off the side shield on my machine to be able to use the calipers correctly.

My machine was actually in good shape. I made some very minor adjustments, but wonder if those measurements were more operator error than actual calibration being off on the machine.
Then as suggested by Adrian, I used the following links to use a PNG - dont use the SVG for some reason..
These settings are closer to Miriams. Slightly different from the instructor training. I need to do some controlled testing to see which is best for me and my machine. https://fabacademy.org/2020/labs/leon/students/adrian-torres/week04.html#cubiko
https://fabacademy.org/2026/classes/embedded_programming/t412/hello.t412.3.blink.traces.png
https://fabacademy.org/2026/classes/embedded_programming/t412/hello.t412.3.blink.interior.png
UGS Auto Leveling (Height Mapping)¶
Then I learned to do the leveling map in UGS. See the Universal Gcode Sender AutoLeveler page that Claude and I wrote all about that so it will be easier to find for me to use as reference later.
Another tutorials... No sounds... but walking through it video
New Vcarve Bits¶
Got some new vcarve bits. They seem more sturdy, maybe will have less runout.I am posting a picture here so I can have a reference to see what angle is which when I go to use them.
My new VCarve Bits

Milled that Board # 4¶
Board Milled at Home Machine

The tabs didnt cut out, so we will have to dremel them. The settings must have been way too high.. I will have to remember that next time. It's like they didnt even mill them partially.. the board is completely connected at those tab spots.
.
Went back to the Carvera at school, and milled a new board there. I again followed the tutorial from Charlotte Latin School to upload a basic board and to learn to run the Carvera. See more documenation on using carvera on week8. I learned a few more things from classmate angela on the machine itself including making sure the probe is charged.

I forgot to fill traces, but I'm ok with that.

It took a bit longer to mill, but may help with my soldering.

Soldering¶