Project showcase
Hydrolic Engine with Arduino

Hydrolic Engine with Arduino

There is a hall sensor that sends signals to Arduino to close the relay for the solenoid valve to pass through the oil.

  • 846 views
  • 0 comments
  • 0 respects

Components and supplies

Necessary tools and machines

About this project

Code

magnetic_switch.inoArduino
const int hall1Pin = 7;     // the number of the hall effect sensor pin
const int ledPin1 =  2; // the number of the LED pin
const int hall2Pin = 10;
const int ledPin2 = 4;
int hall1State = 0; 
int hall2State = 0;  // variable for reading the hall sensor status

void setup() {
  // initialize the LED pin as an output:
  pinMode(ledPin1, OUTPUT);
  pinMode(ledPin2, OUTPUT);      
  // initialize the hall effect sensor pin as an input:
  pinMode(hall1Pin, INPUT);
  pinMode(hall2Pin, INPUT);     
}

void loop(){
  // read the state of the hall effect sensor:
  hall1State == digitalRead(hall1Pin);

  if (hall1State = HIGH) {     
    // turn LED on:    
    digitalWrite(ledPin1,LOW);
     
  } 
  
  else {
    // turn LED off:
    digitalWrite(ledPin1, HIGH);
  } 
    
    
    
   hall2State = digitalRead(hall2Pin);

  if (hall2State == HIGH) {     
    // turn LED on:    
    digitalWrite(ledPin2,LOW);  
  } 
  else {
    // turn LED off:
    digitalWrite(ledPin2, HIGH); 
  }
}

Schematics

untitled_sketch_bb_IVg5KrAyD7.jpg
Untitled sketch bb ivg5krayd7

Comments

Similar projects you might like

Arduino UNO Mini-Weather Station

Project tutorial by Igor Fonseca Albuquerque

  • 25,835 views
  • 21 comments
  • 67 respects

Control Home Appliances Through Web Or Mobile

Project tutorial by Team Gadget Programmers

  • 7,599 views
  • 4 comments
  • 18 respects

WaterPi: Houseplant Remote Watering and Monitoring System

Project tutorial by Demirhan Aydin

  • 29,489 views
  • 14 comments
  • 128 respects

Water Quality Monitoring System

Project tutorial by Hao Jie Chan

  • 35,724 views
  • 65 comments
  • 73 respects
Add projectSign up / Login