Posts

Measuring and Displaying Solar Panel Voltage on an LCD using Arduino

Image
 Measuring and Displaying Solar Panel Voltage on an LCD using Arduino Step 1: Components Required Arduino Board (e.g., Arduino Uno) Solar Panel (small panel with known voltage range) Voltage Divider Resistors (e.g., 15kΩ and 5kΩ) 16x2 LCD with I2C Interface Jumper Wires Breadboard (optional for ease of connections) Step 2: Circuit Diagram Connect the Solar Panel: Connect the positive terminal of the solar panel to the input of the voltage divider circuit. Use resistors R1 (15kΩ) and R2 (5kΩ) to step down the voltage to a range readable by the Arduino (0-5V). Voltage Divider Connections: Solar Panel + connects to the junction between R1 and R2. R2 connects to GND . The voltage reading point (junction between R1 and R2) goes to A0 (analog input) of the Arduino. Connect the LCD: If using an I2C LCD , connect the LCD pins as follows: GND to Arduino GND VCC to Arduino 5V SDA to Arduino A4 SCL to Arduino A5 Step 3: Arduino Code Use the following code to read the solar panel ...
arduino comunication  

4.Displaying Weight and Force from an FSR on an I2C LCD using Arduino

 Displaying Weight and Force from an FSR on an I2C LCD using Arduino Circuit: FSR Setup : Connect one end of the FSR to 5V. Connect the other end of the FSR to an analog pin (e.g., A0) and a 10kΩ resistor. Connect the other side of the resistor to GND. I2C LCD Setup : Connect the LCD's SDA and SCL pins to the corresponding pins on the Arduino (usually A4 and A5 for Arduino Uno). Connect VCC to 5V and GND to GND. Code: Here's the code that reads the FSR value and displays the weight in grams and force in newtons on the LCD: C++ Code # include <Wire.h> # include <Adafruit_LiquidCrystal.h> Adafruit_LiquidCrystal lcd ( 0 ) ; // Initialize the I2C LCD (default I2C address 0x20) int fsrPin = A0; // Analog pin connected to FSR int fsrReading; // Variable to store the FSR reading float calibrationFactor = 0.5 ; // Calibration factor to convert FSR reading to weight in grams (example value) float weight; // Calculated weight in gr...

3.FSR with Buzzer

 FSR with Buzzer Circuit: FSR Setup : Connect one end of the FSR to 5V. Connect the other end of the FSR to an analog pin (e.g., A0) and a 10kΩ resistor. Connect the other side of the resistor to GND. Buzzer Setup : Connect the positive terminal of the buzzer to a digital pin (e.g., pin 11). Connect the negative terminal of the buzzer to GND. Code: The code below reads the FSR value and activates the buzzer if the force exceeds a defined threshold. C++Code int fsrPin = A0; // Analog pin connected to FSR int fsrReading; // Variable to store the FSR reading int threshold = 600 ; // Threshold value to activate the buzzer int buzzerPin = 11 ; // Pin connected to the buzzer void setup () { pinMode (buzzerPin, OUTPUT); // Set the buzzer pin as an output Serial. begin ( 9600 ); // Start serial communication at 9600 baud } void loop () { fsrReading = analogRead (fsrPin); // Read the value from FSR Serial. print ( "FSR Reading: " ); Seria...

2. FSR with led

 FSR with led Circuit: FSR Setup : Connect one end of the FSR to 5V. Connect the other end of the FSR to an analog pin (e.g., A0) and a 10kΩ resistor. Connect the other side of the resistor to GND. LED Setup : Connect the positive (anode) of the LED to a digital pin (e.g., LED1 to pin 13, as per your setup). Connect the negative (cathode) of the LED to a current-limiting resistor (e.g., 220Ω) and then to GND. Code: The code below reads the FSR value and turns on the LED if the force exceeds a defined threshold. C++ Code int fsrPin = A0; // Analog pin connected to FSR int fsrReading; // Variable to store the FSR reading int threshold = 600 ; // Threshold value to turn on the LED int ledPin = 13 ; // Pin connected to LED1 void setup () { pinMode (ledPin, OUTPUT); // Set the LED pin as an output Serial. begin ( 9600 ); // Start serial communication at 9600 baud } void loop () { fsrReading = analogRead (fsrPin); // Read the value from FSR Se...

1.Force Sensor Serial print

 Force Sensor Serial print Circuit: Connect one end of the FSR to 5V. Connect the other end of the FSR to an analog pin (e.g., A0) and a 10kΩ resistor. Connect the other side of the resistor to GND, creating a voltage divider. Code: The code below reads the analog value from the FSR and converts it into weight using a simple calibration factor. C++Code int fsrPin = A0; // Analog pin connected to FSR int fsrReading; // Variable to store the FSR reading float calibrationFactor = 0.5 ; // Calibration factor to convert FSR reading to weight (example value) void setup () { Serial. begin ( 9600 ); // Start serial communication at 9600 baud } void loop () { fsrReading = analogRead (fsrPin); // Read the value from FSR float voltage = fsrReading * ( 5.0 / 1023.0 ); // Convert analog reading to voltage // Convert voltage to force (in Newtons or weight in grams based on calibration) float weight = voltage * calibrationFactor; Serial. print ( "FSR Rea...

4.Keypad-Controlled Lock System with Servo and I2C LCD Using Arduino

 Keypad-Controlled Lock System with Servo and I2C LCD Using Arduino Components Needed: Arduino board 4x4 or 4x3 Keypad I2C LCD Servo motor Jumper wires Breadboard (optional) Connections: Keypad : Connect the keypad pins to Arduino digital pins (e.g., rows to pins 9, 8, 7, 6 and columns to pins 5, 4, 3, 2). I2C LCD : Connect the SDA and SCL pins to Arduino I2C pins (A4 and A5 on an Uno). Servo : Connect the servo motor's signal pin to pin 10. Example Code: #include <Keypad.h> #include <Servo.h> #include <Wire.h> #include <Adafruit_LiquidCrystal.h> const byte ROWS = 4; // Number of rows const byte COLS = 4; // Number of columns char keys[ROWS][COLS] = {   {'1', '2', '3', 'A'},   {'4', '5', '6', 'B'},   {'7', '8', '9', 'C'},   {'*', '0', '#', 'D'} }; byte rowPins[ROWS] = {9, 8, 7, 6};    // Connect to row pins of keypad byte colPins[CO...