Week 9. Output Devices

Group Assignment

  • Check the LEDS before using them with microcontrollers.
  • Digital power supply is great as it shows both voltage and current
  • Our group assignment link.

    Individual Assignment

    This week we need to add output device in our micro controller PCB board that we have design last week. so in my case i have re-design the PCB board for my output device. I was thinking to use 12V Solenoid Lock as a output device, as in my final project i want to use this in my smart door lock.

    PCB Design

    Here i have exported the outline and traces of my board in png format.

    My final board

    Programming the board.

    Solenoid lock as Output with Esp32-CAM Board

    Components Required

  • PCB Board
  • Solenoid Lock
  • DC 12-v supply
  • Single channel Relay Module
  • USB cable for uploading the code
  • The connections I made with ESP32-CAM are

  • UOR to RX
  • UOT to TX
  • GND to GND
  • 5v to VCC
  • GND to GPIO 0 (To upload Programming)
  • The connection I made with my board and Solenoid lock

  • Connect the 5-volts pin of your board to the VCC pin of the Relay module
  • Connect the GND pin of your board to the GND pin of the Relay module
  • Connect the Relay IN pin of the Relay module with the digital- GPIO 4 pin of the ESP32-CAM board
  • Connect the positive wire of the DC power supply to the other side of the Relay module and the negative wire to the solenoid
  • Connect the positive wire of the solenoid lock with the Relay module.
  • After the connections were made, then started coding:

    Before uploading the code to ESP32-CAM, please check the following setting that i have done here:

  • Update the Preferences –> Aditional boards Manager URLs:
  • https://dl.espressif.com/dl/package_esp32_index.json

    Board Settings:

  • Board: “ESP32 Wrover Module”
  • lash Mode: “QIO
  • Partition Scheme: “Hue APP (3MB No OTA/1MB SPIFFS)”
  • Flash Frequency: “40MHz”
  • Upload Speed: “115200”
  • Core Debug Level: “None”
  • Programmer: “AVR ISP”
  • COM Port: Depends On Your System
  • Don't forget to assign your Wifi SSID and Password here to access camera

    Here i have define relay pin and added the coding for Lock to function

    After connecting GPIO 0 to GND pin, upload your code and press ESP32 CAM on-board RESET button to put the board in the flashing mode

    After uploading the code disconnect the GPIO-0 pin from GND pin from your board.

    Then Open Serial Monitor

    Set the Baud rate to 115200

    Press the ESP32 CAM on-board RESET button to get IP address and Lock to function.

    Video

    Design File

    ESP32-CAM Board Design

    Code