ESP-32 Cam + Arduino IDE = IOT Surveillance Car Arduino Projects For Beginners

Image
The  AI-Thinker ESP32-CAM module  comes with an ESP32-S chip, a very small size OV2640 camera and a microSD card slot. MicroSD card slot can be used to store images taken from the camera. Here  HTTP  communication protocol will be used to receive video streaming from the OV2640 camera over the web browser.  Components Required ESP32-CAM 4WD CAR Chasis FTDI Programmer DC Motors (4) Jumper Wires Wifi Antenna Motor Driver (L298N) Battery  Installing ESP32 Board on Arduino IDE We will  program the ESP32-CAM using Arduino IDE . For that, we have to install the ESP32 add-on on Arduino IDE. To install the ESP32 board in your Arduino IDE, go to  File> Preferences Now copy the below link and paste it into the “Additional Board Manager URLs” field, as shown in the image below. Then, click the “OK” button: https://dl.espressif.com/dl/package_esp32_index.json Now go to  Tools > Board > Boards Manager In Boards Manager search for E

32 Inch DIY Arduino RTC Wall Clock





Arduino Seven Segment Display Clock by Multiplexing Four 7 Segment Displays:

Digital wall Clocks are getting more popular now days and they are better than analog clock as it provides accurate time in hours, minutes and seconds and its easy to read the values. Some digital clocks also have many facilities like displaying temperature, humidity, setting multiple alarms etc. Most of the digital clocks use Seven Segments.

     Step 1: Gathering The Materials














This tutorial is about making a clock using DS1307 real time clock module, Arduino and a Four digit Seven segment led display which we can made by ourselves

The following material is required:

1x Arduino Uno
1x 4 digit common cathode 7 segment
1x DS1307 RTC
1x 3v lithium button cell for RTC
1x 12 Volts Battery Or Power supplySolder wire and soldering iron
2x pushbuttons
8x 100 ohm resistors
4x BC547 NPN transistors


1 : Cut led strip at appropriate size.
2 : Now Connect them just like this seven segment internal fiqure 2

Step 2: Making Custom sized seven segments


fiqure 2
Figure 2 is the reference image for connecting led strips 
follow this image to connect the led strips whether it is common anode or common cathode.


                                          fiqure 3

Now its time to multiplex the 7 segments together! 
be careful while connecting them together one wrong move and the project gets stuck!


Step 3: Interfacing 7 Segments and RTC Module With Arduino



A 7 segment is a 7 segment because its made up of 7 leds to represent a digit from 0-9 when turned on in a specific manner. There is an 8th led for the decimal point.
We are using a 4 digit display because we have multiple numbers to display. First lets connect our Arduino with the display.
Here are the connections. The digits are connected to Arduino via the transistors. Base is attached to digital pin of Arduino while the collector is attached to the common cathodes.
[Segment to Arduino Pin]: A – 2, B – 3, C – 4, D – 5, E – 6, F – 7, G – 8, DP – 9.
[Common terminals to Arduino Pin]: D1 – 10, D2 – 11, D3 – 12, D4 – 13.
                                                 
                                                             Back View Blurry

Accuracy of Digital Clock with RTC Module:
The accuracy of DS1307 RTC based clock is still going to depend on the ambient temperature variations. The RTC module still depend on the quartz crystal but the good thing is that the time drift will be minimal.
Download and add the following library files to the IDE:
Timelib.h: click here
DS1307.h: click here
SevSeg.h: click here
How to Set Time to RTC DS1307:
You should ready with completed hardware setup before you set time to RTC:
  • Connect the USB to Arduino and make sure that time on your computer is correct because the time on the computer will be set to the RTC.
  • Open the IDE and click on Files > Examples > DS1307RTC > SetTime.
  • A window with a program code will pop-up, just upload the code to Arduino with RTC connected. Don’t forget to select the correct COM port and set the baud rate as 9600.
  • Now open the serial monitor, it will say the time is set. Once this step is done successfully, upload the below given code to the circuit.
Here It Is The Working ! Enjoy!
We can witness time deviation anywhere between +/- few seconds to a couple of minutes per month. A good quality DS1307 RTC will have minimal time deviation, but cheaper DS1307 module from china will have more time deviation, this is because of the bad quality crystal used.

 Download the “SevSeg” library before compiling this code: click here


Program Code:
//dexterlab0.blogspot.com//
#include "SevSeg.h"
#include <Wire.h>
#include <TimeLib.h>
#include <DS1307RTC.h>
SevSeg Display;
const int ledPin =  A0;
unsigned int number;
unsigned long currentMillis;
unsigned int Hour;
int ledState = LOW;
unsigned long previousMillis = 0;
const long interval = 500;
void setup()
{
  pinMode(ledPin, OUTPUT);
  byte numDigits = 4;
  byte digitPins[] = {10, 11, 12, 13};
  byte segmentPins[] = {2, 3, 4, 5, 6, 7, 8, 9};
  bool resistorsOnSegments = true;
  bool updateWithDelaysIn = true;
  byte hardwareConfig = COMMON_CATHODE;
  Display.begin(hardwareConfig, numDigits, digitPins, segmentPins, resistorsOnSegments);
  Display.setBrightness(100);
}
void loop()
{
  unsigned long currentMillis = millis();
  if (currentMillis - previousMillis >= interval)
  {
    previousMillis = currentMillis;
    if (ledState == LOW)
    {
      ledState = HIGH;
    }
    else
    {
      ledState = LOW;
    }
    digitalWrite(ledPin, ledState);
  }
  tmElements_t tm;
  if (RTC.read(tm))
  {
    Hour = tm.Hour;
    if (tm.Hour > 12)
    {
      if (tm.Hour == 13) Hour = 1;
      if (tm.Hour == 14) Hour = 2;
      if (tm.Hour == 15) Hour = 3;
      if (tm.Hour == 16) Hour = 4;
      if (tm.Hour == 17) Hour = 5;
      if (tm.Hour == 18) Hour = 6;
      if (tm.Hour == 19) Hour = 7;
      if (tm.Hour == 20) Hour = 8;
      if (tm.Hour == 21) Hour = 9;
      if (tm.Hour == 22) Hour = 10;
      if (tm.Hour == 23) Hour = 11;
    }
    else
    {
      if (tm.Hour == 0) Hour = 12;
    }
  }
  number = Hour * 100 + tm.Minute;
  Display.setNumber(number);
  Display.refreshDisplay();
}
That's It!
Hope You Guys Enjoyed It 
Do Comment Below If You Have Any Question Regarding to This Project ! 

Comments

Post a Comment

Popular posts from this blog

ESP-32 Cam + Arduino IDE = IOT Surveillance Car Arduino Projects For Beginners

DIY Arduino CNC [Updated]