Table of Contents

lamaPLC : Arduino wiring

HI active switch connection

HI active switch connection

The image above shows a HI active switch connection. In the open, resting state of the circuit, the Arduino is connected to ground through a 10 kΩ (pull-down) resistor, so it is in the LO state. By pressing the button, the power supply is connected to it (it is recommended to connect a 100Ω resistor) to the input, so it goes into the HI state.

HI active switch connection

Mosfet driver

This Power Mosfet driver use two MOSFETs in parallel and can handle currents up to 15A - 400W (25A with cooling). This module is perfect for driving DC motors, DC pumps and using a PWM signal the speed can be controlled.

Mosfet driver

Example code

// Arduino Power Mosfet Driver with Two Parallel MOSFETs
 
#include <Arduino.h>
 
// Pins
const int pwmPin = 9;  // PWM signal to the gate driver IC
 
void setup() {
  // Set up pins
  pinMode(pwmPin, OUTPUT);
}
 
void loop() {
  // Adjust the duty cycle to control the power output
  int dutyCycle = map(analogRead(A0), 0, 1023, 0, 255);
 
  // Write the duty cycle to the PWM pin
  analogWrite(pwmPin, dutyCycle);
 
  // Optional: Add a delay to control the update rate
  delay(20);
}