“Things Talk To Each Other :-)”
Alfred J. Pennyworth and batman (Batman: Pennyworth R.I.P. Vol 11)
And Finally we arrived to the last development on this Project with Alfred v3 adding wireless controlling feature. :-)
Software:
Electronics:
2x (330 Ohm) Resistor.
3x (1k Ohm) Resistor.
2x LED.
1x Slider Switch.
1x Arduino UNO R3.
1x IR Sensor. (HW-201)
1x LDR Sensor.
1x Temperature & Humidity Sensor. (DHT11).
1x Liquid Crystal I2C.
Bluetooth Module (HC-05).
In this Part, I Used Fritzing to simulating the circuit wiring and design like circuit below:
Note that
Then I implement the real circuit:
The code running as follows:
First Thing we include:
SoftwareSerial Library to define costume TX & RX for connections. Pin (2, 3)
LiquidCrystal_I2C Library and define the LCD Address.
DHT Library and define the DHT Configurations and type.
Then Define the Parameters of :
BT. (For Bluetooth Connection)
Mic and Mic_Value. (For Microwave sensor)
Light_Value, Val and analog. (For Light Sensor and White LED)
IR. (For IR Sensor)
Fan. (For Orange LED)
After this In Void Setup we begin the LCD, DHT, Serial connections in to start to communicate with Arduino then set the pin mode for each component.
In Void Loop, we start my serial to listen and put make BT read what inside mySerial, Mic_Value read what's inside Mic, Val read what's inside analog.
Then begin Switch Condition in case '1':
We clear the LCD from the Previous condition and declare the Humidity and temperature Variables for DHT then we can print the reads in the serial monitor if we want same for the LCD we print the values of the DHT readings on it.
Print the Result in the LCD Screen.
Then go to IF condition if IR is LOW and Mic_Value Is HIGH then Map the data ftom Val to pin 11 from 0 to 255 and if not then Fan and Light_value is LOW.
and inside it there's another if condtion than if t is greater than 30 then fan HIGH and if not then Fan LOW and break the While Loop.
In case '2':
Clear the LCD from the Previous condition.
Print “Light: ON” in specific part in the LCD and Light_Value is HIGH.
In case '3':
Clear the LCD from the Previous condition.
Print “Light: Off” in specific part in the LCD and Light_Value is LOW.
In case '4':
Clear the LCD from the Previous condition.
Print “Fan: ON” on specific part in the LCD and Fan is HIGH.
In case '5':
Clear the LCD from the Previous condition.
Print “Fan: Off” in specific part in the LCD and Fan is LOW.
In case '6':
Clear the LCD from the Previous condition.
Print “Auto [1]”, “Lights [2,3]”, “Fan [4,5]” in specific parts.
And the final thing in the Void Loop is delay (10) by 10 milliseconds, then begin the Void Loop again.
Testing the Real Circuit
While I was Dealing with Bluetooth Module I Struggle in how to configure it for that I searched though the internet and found this helpful website explain in detail how to configure use your Bluetooth Module.
Problem: In Auto Mode, the while loop don't break even if BT it's not equal '1'.
Issue: The While loop doesn't read the new Value for the BT.
Solution: Add another sensor (Microwave motion sensor) then add If Statement for the two conditions else to break the while loop.
Dealing with Bluetooth module
Accelerometer in Mobile
The Accelerometer Is a very interesting Module for me and I wonder what's my Mobile's Accelerometer stashes for me :-)
We Compete in Fishing Competition with our servo arm hands and it was so much fun :D