Skip to content

A9 - Outputs

Brief


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

xxx TODO HERO IMAGE

Supplying water to plants


A pump draws a lot of current, a GPIO pin cant supply enough current.

We need to use a MOSFET, a solid-state switch to control the device (as an added benifit over a relay we can PWM it to control the speed).

To calculate the power consuption a power supply will give the pump 5V and see what the current usage is.

xxxx TODO Test results

Connecting it to our PCB

The MOSFET module I ordered didnt include a flyback diode or current limiting resistor for the FETs gate capacitance, this would be a quick test so none were added.

The gate was connected to an IO pin. Then the power input was connected to 5V and GND connected to the microcontroller breakout boards GND pin (the MOSFET breakout has the 2 connections connected).

The pump was connected from 5V to the Drain.

xxxx TODO Schematic photo

Programming

I connected the MOSFET's drain to D0 (P26). The MOSFET pin was assigned to a Pin object meaning it could be on or off. If finer control was needed a PWM could be used but a binary on off turned out to be fine.

TODO Code snippet

Results

The pump ended up working well! It was able to pump liquid with ease, it did take a little bit for the pump to y'know start pumping liquid out of the end of the tube but all in all it was a great outcome.

TODO video of pumping

Resources - DESCRIPTION

FILES

DOWNLOAD LINKS HERE