Charging Reminder

by arielhuang1206 in Circuits > Arduino

211 Views, 0 Favorites, 0 Comments

Charging Reminder

Charging Reminder
IMG_1138.jpg

It is for reminding you to charge your computer or your phone, so when you put your phone on the reminder, and the LED will turn off, and if you forget to put your phone on it, the light will stays on.

(when I charge my phone, I will put it in the same place, so I can remember to charge my phone)

Prepare Your Material

IMG_1135.jpg

Arduino Leonardo *1

Breadboard *1

Wire *7

Long Wire (one side) *4

Photoresistance *1

Resistance *2 (1 Blue and 1 Yellow)

LED *1 (any color)

USB line *1

Circuit Diagram

截圖 2020-05-27 下午3.36.14.png
IMG_1132.jpg

Code

截圖 2020-05-28 上午12.18.01.png

https://create.arduino.cc/editor/arielhuang1206/e9...

void setup(){ // put your setup code here, to run once:
pinMode( 10 , OUTPUT); // sets the digital pin as output }

void loop(){ // put your main code here, to run repeatedly:

if ( analogRead( A0 ) < 550 ) { digitalWrite( 10 , LOW ); // sets the digital pin on/off }

if ( analogRead( A0 ) > 650 ) { digitalWrite( 10 , HIGH ); // sets the digital pin on/off }

}

Outlook

IMG_1138.jpg

Use a box to put your Arduino inside, and let the Photoresistance and the LED light stays on the outside of the box.

Try It