Arduino
Environment

๐Ÿค– Arduino Setup Guide for Chilibot ๐ŸŒฑ

๐Ÿ“‹ Overview

This guide details the steps for connecting various components to an Arduino board for the Chilibot project. Follow these instructions to ensure proper setup and functionality.

๐Ÿ“ฆ Required Components

  • Arduino Board
  • MCP2515 CAN Module
  • Relays for solenoid valve, water pump, and grow light
  • Ultrasonic Sensor (HC-SR04)
  • I2C Sensor (for soil moisture and air parameters)
  • Stepper Motor and Driver
  • Jumper Wires and Connectors

๐Ÿ”Œ Pin Connections

๐Ÿ“ก CAN Module (MCP2515)

  • CS Pin: Connect to digital pin 10 on Arduino.

๐Ÿ”ง Relays

  • Solenoid Valve Relay: Connect to digital pin 9.
  • Water Pump Relay: Connect to digital pin 8.
  • Grow Light Relay: Connect to digital pin 7.

๐Ÿšฆ Ultrasonic Sensor (HC-SR04)

  • Trig Pin: Connect to digital pin 6.
  • Echo Pin: Connect to digital pin 5.

๐ŸŒฟ I2C Sensor

  • SDA: Connect to Arduino's SDA pin.
  • SCL: Connect to Arduino's SCL pin.

โš™๏ธ Stepper Motor

  • Direction Pin: Connect to digital pin 3.
  • Step Pin: Connect to digital pin 4.

๐Ÿ› ๏ธ Setup Instructions

  1. Assemble the Circuit: Carefully connect all components as per the pin connections above using jumper wires. ๐Ÿ”Œ

  2. Configure CAN Module: Set up the MCP2515 CAN module with the CS pin connected to digital pin 10. Ensure the module is properly configured for communication with the Arduino.

  3. Connect Relays: Attach the solenoid valve, water pump, and grow light to their respective relays. Ensure the relays are capable of handling the current and voltage requirements of these components. ๐Ÿ’ก

  4. Set Up the Ultrasonic Sensor: Connect the Trig and Echo pins of the HC-SR04 ultrasonic sensor to digital pins 6 and 5, respectively. ๐Ÿ“ก

  5. I2C Sensor Configuration: Connect the I2C sensor for soil moisture and air parameters to the Arduino's I2C pins (SDA and SCL). Ensure that the sensor's address (0x40) does not conflict with other I2C devices. ๐ŸŒฟ

  6. Install the Stepper Motor: Connect the stepper motor to the driver, ensuring that the direction pin is connected to digital pin 3 and the step pin to digital pin 4. ๐Ÿš—

  7. Upload the Code: After making all connections, upload the provided Arduino sketch to your board. ๐Ÿ’ป

  8. Testing: Power up the Arduino and test each component to ensure they are functioning as expected. โšก

โš ๏ธ Safety Precautions

  • Double-check all connections before powering up the Arduino.
  • Ensure power ratings for relays and motors are within the specifications for your components.
  • Avoid making or altering connections while the power is on.