In this lesson we demonstrate a simple project that reads the brightness in a room, and then displays the brightness on a device consisting of a servo with an arrow pointing at vaiouse visual indications of brightness. This project demonstrates how to use Algebra and the equation of a line to take the data read from the light sensor, and calculate the desired angle value to send to the servo.
If you want to follow along at home, an official Arduino Uno R3 is available HERE. In this new series of lessons, I will be using the sensor and other components found in this KIT.
Typically, the servos in electronics kits are not the best ones, but are suitable to learn with. If you want a more stable and better quality servo, this is the one I user in more of my projects: HiTEC
In this lesson we explain step-by-step how to incorporate a servo into your Arduino project. This allows you to put motion into your prototypes. Servos act like little motors to create motion, but unlike motors, they do not spin all the way around. A typical servo can move between 0 and 180 degrees. They are relatively easy to program, and this video shows you the ins and outs of using a servo.
If you want to follow along at home, an official Arduino Uno R3 is available HERE. In this new series of lessons, I will be using the sensor and other components found in this KIT.
Typically, the servos in electronics kits are not the best ones, but are suitable to learn with. If you want a more stable and better quality servo, this is the one I user in more of my projects: HiTEC
In this lesson we show you how to create a Dimmable LED using two pushbuttons. Pressing one button will gradually increase the brightness, while pressing the other button will gradually decrease the brightness. The project also includes an active buzzer to provide the user feedback that either maximum or minimum brightness have been reached. I encourage you to try and build this yourself before watching the video. Then see if you can do it on your own, and then see if you are doing the way I do it, or if you find an alternative suitable solution.
If you want to follow along at home, an official Arduino Uno R3 is available HERE. In this new series of lessons, I will be using the sensor and other components found in this KIT.
Below is the code we used to achieve the toggle operation. The video gives details on how to connect up the circuit.
In lesson 27 we learned how to incorporate a pushbutton into an arduino project. We learned how to utilize pull-up and pull-down resistors in order to incorporate a button into a circuit. The operation of the button in lesson 27 was pretty simple . . . if the button was held down, the LED would come on. When the button was released, the LED would turn back off. This is an interesting demonstration, but much more interesting is the case where we make a toggle switch. If you press and release the button, the LED comes on, and then if you press and release the button again, the LED goes off. While this sounds very similar to the previous case, it turns out to require a lot more thought. This video lesson explains how to think about this problem, and how to make it work.
If you want to follow along at home, an official Arduino Uno R3 is available HERE. In this new series of lessons, I will be using the sensor and other components found in this KIT.
Below is the code we used to achieve the toggle operation. The video gives details on how to connect up the circuit.
Being able to add push buttons to your projects adds important new capabilities to your prototypes. It is a clever way you can get input from a user. You could imagine using push buttons to turn something on or off, or they could be used to set motor speed or direction. In order to incorporate buttons into a project, you need to understand the concept of pull up and pull down resistors. In this tutorial we show you how to include buttons in a project, by demonstrating a simple on/off function on an LED.
If you want to follow along at home, an official Arduino Uno R3 is available HERE. In this new series of lessons, I will be using the sensor and other components found in this KIT.
This is the code we used in this project to switch the LED on and off.
Arduino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
intLEDPin=8;
intbuttonPin=12;
intbuttonRead;
intdt=100;
voidsetup(){
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(LEDPin,OUTPUT);
pinMode(buttonPin,INPUT);
}
voidloop(){
// put your main code here, to run repeatedly:
buttonRead=digitalRead(buttonPin);
Serial.println(buttonRead);
delay(dt);
if(buttonRead==1){
digitalWrite(LEDPin,LOW);
}
if(buttonRead==0){
digitalWrite(LEDPin,HIGH);
}
}
Making The World a Better Place One High Tech Project at a Time. Enjoy!
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok