Week 7 - Journal

Ideation

Tell us about your assignment's idea for this week. Why do you care about this idea? What inspired you? (Please include images or links to sources of inspiration)

Smart Fan & Lamp (Clap Switch)

The Inspiration Image

I did a search on the Internet, and through the picture above, I was inspired by the idea of ​​making a Smart fan & Lamp, and after that I began to imagine the components and tools needed to make the project and prepare for that




Website Link (Source of Inspiration)


https://www.watelectronics.com/clap-switch/

Tool Chain

Which software/machines/materials did you use in the assignment? Why?

DC motor


Adapters  (9 v)


Relay 

Card Board


DC Jack to terminal block converter

Crocodile Wires

Software :

Fritzing

IDE Arduino


Material & Tools 


Resistor  220 Ohms

Led

Jumper Wires (Male - Male, Male - Female)


Small Bread board

Arduino Uno

LCD I2C (16*2 )

Fritzing 

Bottle Cap

Bread Board

H- Bridge

Avometer

IDE Arduino

AC Bulb

Temp & Humidity Sensor (DHT 11)

Voice Sound Detection Sensor

Design/Preparation Process

Explain the design and/or preparation process of your assignment. How did you use the tool or software to design and/or prepare your assignment before fabrication/implementation?

Pin 2 - AC Bulb

Pin 3 - Temp & Humidity Sensor DHT 11 

Pin 6 -  led 

 Pin 7 - Voice Sound Detection Sensor

Pin A4 - SDA for LCD

Pin A5 - SCL for LCD

Development/Implementation Process

Explain the development/implementation process of your assignment. How did you use the machine/tool to manufacture or implement the design of your assignment?

Line 1 to 27 (Coding)

Line 28 to 54 (Coding)

Line 55 to 81 (Coding)

Line 82 to 100 (Coding)

Pseudo code 


The idea of ​​the Smart Fan & Lamp depends on the following inputs and outputs


First: The Input

****************

1- DHT 11 Sensor for measuring temperature and humidity

2- Sound dedection Sensor to track sounds, so the device can be controlled by clapping


Secondly : The Outputs

**************************

1- DC motor to drive the fan and the fan is driven by a Motor Driver (H-Bridge)

2- The AC Lamp operates on an AC household electrical current through the Relay Module

3- Green LED when the motor is running

4- LCD screen 16 * 2 (I2c) to show data for temperature and humidity data



Thirdly: How The Circuit operate and work

************************************************

- By clapping twice, the fan motor ,the AC lamp and the Green led are turned on in a smart way.


- As soon as you clap twice after that, the fan motor ,the AC lamp and the Green led are turned off smartly.


-The DHT 11 sensor, which is used to measure temperature and humidity, as well as the LCD screen, works simultaneously and continuously, as they are separate from the on or off statuses of the light and the fan.

Writing the code for controlling and operating the fan and smart lighting device, and measuring temperatures and humidity levels, I relied on downloading the library for the LCD, which is LiquidCrystal_I2Ch and the DHT sensor library was also downloaded.



And the work of the code depended on the function if as well as else, and the millis function was also used, through which the code can read and process the data coming from the sound sensor, and the toggleState function was also used, which is used to set two states "on - off" and through these functions the control is carried out In the working conditions of the device, it was used as follows


When you clap twice, the fan and the AC bulb work in addition to the green led, and after that, when you clap twice, the work of the aforementioned components is closed.


It was also taken into account that the code to operate the DHT 11 sensor, as well as the LCD, should work continuously and separate from the above components (fan and lighting), so that the temperature and humidity sensor continues to continue making measurements as inputs, and these inputs appear on the screen of the LCD synchronously.

٢٠٢٣٠٣١٧_٢١٣٦٢٣.mp4

Overcoming Challenges

What kinds of challenges or problems did you face while doing the assignment, tutorials, or exercises?  How did you solve them? Did you ask for help from an instructor or peer? Please provide a link to the tutorial or article that you used to solve your problem (if any)

Before Overcoming Challenge

NO (Normally Open)

After Overcoming Challenge

NC (Normally Close )

The challenge that I faced was summed up in that there was no synchronization in the operation of the lamp with the fan, when I was clapping in order to turn on the lamp with the fan, I would find that the fan was working while the lamp was not working, and when I clapped again, I would find that the fan was not working and the lamp was working, meaning that both components They work opposite each other

Therefore, I thought of overcoming this challenge by changing the connections of the Relay Module, Where I connected the end of the AC power cord as follows, by connecting the NO wire in the relay module and changing it to the NC, and thus I missed this challenge and the fan became working and closed with the lamp simultaneously with just clapping

Final Project

How can you use the skills and knowledge that you've acquired this week in your final project?

I think that I have become able to deal with the Arduino-Uno control board in a much better way, and I have become able to use Pseudo code and C++ programing language for coding  to do programming, and I have also become able to integrate several inputs and several outputs and make them work harmoniously together, and I have also become able to use most The sensors that were shared in the explanation videos and linked to the various projects, in addition to that I feel a great development in the ability to logical thinking based on solving problems and creating alternatives and thinking about the development of problems that may face the end user with the development of the largest number of solutions Which will greatly reflect on facilitating work on my final graduation project.

WOW!

What is the coolest thing that you've learned this week? What is something that you will never forget from this week?



The most enjoyable thing for me is that I was able to Design, write programing code and have the full remotely control on my Smart Home Circuit, taking into account User Experience including simplicity, and aesthetic form, which is one of the most important customer requirements in products.

Smart Fan & Lamp.mp4

Weekly Digest [OPTIONAL]

Tell us about any other cool things that you've made this week: in the Hands-on activity, tutorial examples, exercises, or any other cool mini-project that you tried out aside from the assignment.

Assignment Design Files