Skip to main content

Posts

Showing posts from March, 2023

Arduino Tutorial: Detecting Light with a Light Sensing Resistor for beginners

Learn How to Use a Light Sensing Resistor with Arduino In a world where technology is king, one lone inventor decided to create something truly chaotic.  Using nothing but an Arduino, a light sensor (LDR), and a buzzer, they created a machine that could turn light into sound. So, you want to know how I made this chaotic little machine? Let me show you the code. Resistor to Detect Light with Arduino components for the circuit: 1. Arduino uno 2.buzzer 3.battery 4.LDR (light dependent resistor). Explaining the code: The code is for an Arduino microcontroller, which is a small computer that can be programmed to interact with the physical world using sensors and actuators. In this case, the Arduino is connected to a light sensor and a buzzer. int lightpin = A0; int buzzpin = 8 ; int lightval; int delaytime; The first four lines of the code set up variables to store information that will be used later in the code. The `lightpin` variable is set to `A0`, which is the anal...

Blinking LEDs with Arduino Using FOR Loop: A Beginner’s Guide

Blinking LEDs with Arduino: A Guide to Using For Loops. Get ready to create your own light show with Arduino! In this tutorial, you’ll learn how to use for loops to blink LEDs with your Arduino board. This project is perfect for beginners who want to get started with Arduino programming and create something truly amazing in the process. You’ll be amazed at what you can do with just a few lines of code. Let’s get started! components to be used: 1.arduino uno 2.red led. 3.yellow led 4. resistor (330 ohms) 5.battery circuit diagram of blinking led using for loop int yellowled = 6 ; int redled = 9 ; int redde = 500 ; int yellowde = 100 ; int i; This code block is written in C++ and is used to control two LEDs (yellow and red) using an Arduino board. The first four lines of code define some variables that are used later in the code. yellowled and redled are the pin numbers for the yellow and red LEDs, respectively. redde and yellowde are the delay times for the red and yellow LEDs, r...

Create your own music player with a passive buzzer and Arduino

Unleash your inner musician with this DIY project Here are the Components needed: To build a music player using Arduino and a buzzer, you will need the following components: An Arduino A 5V battery A passive buzzer A speaker This project can be simulated using Proteus 8. You don’t need to download a passive buzzer module, as the buzzer in Proteus works just fine. Circuit diagram for the mp3 player with Arduino and buzzer only . Explanation of the code: The variables:   int dt = 100 ; This is the delay variable. The delay is used to pause the code for a couple of seconds. In Arduino, this function is called 'delay'. Specifically, the value for delay in this code is 100 microseconds. To make the code more efficient, instead of writing '100 microseconds' every time we want to call the function, we store it in a container (variable) labeled 'dt'." void setup () {     pinMode ( 4 , OUTPUT); // set a pin for buzzer output } This function tells the Arduino to ...