FETOne - A 4 channel MOSFET driver board

From Electronic Sweet Peas
Jump to: navigation, search

Now available for preorder in our new web shop

Introduction

Fet4one-iso1-900.JPG

The FETOne module is a simple 4 channel MOSFET driver that can be used to control simple motor applications, relays, high power LED's, Glow Lamps and pretty much anything that needs up to about 60V, 310mA (max ~2W).

The board uses 4 2n7002 MOSFET transistors to drive the output. Each MOSFET is connected to an ESP210 GPIO pin allowing the ESP210 full control over the MOSFET. You can do PWM or simple on/off control directly using the GPIO pins.

Technical specifications

The MOSFET drivers are connected directly to the following GPIO pins of the ESP210 module:

GPIO pin Relay output
GPIO4 Driver 1
GPIO12 Driver 2
GPIO13 Driver 3
GPIO15 Driver 4

Jumpers

SJ1 - SJ4 enables or disables the flyback protection diode for each MOSFET. The board is shipped with these solder jumpers bridged. To open them a soldering iron and a solder wick braid should be used.

FetOne-0.1-overview.png

Examples

This short example illustrates the usage of the Fet4One board.

/*
 * ----------------------------------------------------------------------------
 *            _____ _           _                   _
 *           | ____| | ___  ___| |_ _ __ ___  _ __ (_) ___
 *           |  _| | |/ _ \/ __| __| '__/ _ \| '_ \| |/ __|
 *           | |___| |  __/ (__| |_| | | (_) | | | | | (__
 *           |_____|_|\___|\___|\__|_|  \___/|_| |_|_|\___|
 *            ____                   _   ____
 *           / ___|_      _____  ___| |_|  _ \ ___  __ _ ___
 *           \___ \ \ /\ / / _ \/ _ \ __| |_) / _ \/ _` / __|
 *            ___) \ V  V /  __/  __/ |_|  __/  __/ (_| \__ \
 *           |____/ \_/\_/ \___|\___|\__|_|   \___|\__,_|___/
 *
 * ----------------------------------------------------------------------------
 * "THE BEER-WARE LICENSE" (Revision 42):
 * <pontus@sweetpeas.se> wrote this file. As long as you retain this notice you
 * can do whatever you want with this stuff. If we meet some day, and you think
 * this stuff is worth it, you can buy me a beer in return - Pontus Oldberg
 * ----------------------------------------------------------------------------
 */
 
#define DRIVER_1   4
#define DRIVER_2   12
#define DRIVER_3   13
#define DRIVER_4   15
 
#define BLINK_RATE    500;    // 500 ms between toggles on driver 2
static uint32_t  blink_timer = 0;
 
void setup()
{
  // Make all FetOne pins outputs
  pinMode(DRIVER_1, OUTPUT);
  pinMode(DRIVER_2, OUTPUT);
  pinMode(DRIVER_3, OUTPUT);
  pinMode(DRIVER_4, OUTPUT);
 
  // Bring all GPIO outputs low = drivers are not activated
  digitalWrite(DRIVER_1, LOW);
  digitalWrite(DRIVER_2, LOW);
  digitalWrite(DRIVER_3, LOW);
  digitalWrite(DRIVER_4, LOW);
}
 
void loop() 
{
  static uint8_t ratio = 0;
  static boolean d1_state = false;
 
  analogWrite(DRIVER_1, ratio++);
 
  if (millis() >= blink_timer) {
    // Set new timeout for blink
    blink_timer = millis() + BLINK_RATE;
    if (d1_state) {
      digitalWrite(DRIVER_2, 0);
      d1_state = false;
    } else {
      digitalWrite(DRIVER_2, 1);
      d1_state = true;
    }
  }
  // The sweep rate
  delay(20);
}

Downloads

Tips, Tricks and useful links

Please note that due to the fact the this module uses some of the pins from the SPI interface it can not be used together with the SdOne module