Mini Projects
Mini Projects
#### Components:
- Arduino Uno
- GSM module (e.g., SIM900)
- 16x2 LCD display
- Power supply (9V battery or adapter)
- Connecting wires and breadboard
- 10kΩ potentiometer (for LCD contrast control)
- 220Ω resistors
- Push buttons (optional for manual input)
void setup() {
lcd.begin(16, 2);
Serial.begin(9600);
boolean notConnected = true;
while (notConnected) {
if (gsmAccess.begin() == GSM_READY) {
notConnected = false;
} else {
delay(1000);
}
}
}
void loop() {
char smsBuffer[160];
if (sms.available()) {
sms.read(smsBuffer, 160);
sms.flush();
lcd.clear();
lcd.print(smsBuffer);
}
delay(1000);
}
```
---
#### Components:
- RFID reader (e.g., MFRC522)
- RFID tags/cards
- Arduino Uno
- LCD display (16x2)
- Buzzer (optional for feedback)
- Power supply
- Connecting wires and breadboard
#define SS_PIN 10
#define RST_PIN 9
MFRC522 rfid(SS_PIN, RST_PIN);
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
SPI.begin();
rfid.PCD_Init();
lcd.begin(16, 2);
Serial.begin(9600);
}
void loop() {
if (!rfid.PICC_IsNewCardPresent() || !rfid.PICC_ReadCardSerial()) {
delay(50);
return;
}
lcd.clear();
lcd.print("UID:");
lcd.setCursor(0, 1);
lcd.print(uid);
delay(1000);
rfid.PICC_HaltA();
rfid.PCD_StopCrypto1();
}
```
---
#### Components:
- Energy meters (e.g., PZEM-004T)
- Current sensors (e.g., ACS712)
- Arduino Uno or Raspberry Pi
- Wi-Fi module (e.g., ESP8266) if using Arduino
- Power supply
- Connecting wires and breadboard
- Software for data visualization (e.g., Thingspeak, Blynk)
3. **Set Up Communication**:
- If using an Arduino, connect the ESP8266 Wi-Fi module for data transmission:
- ESP8266 VCC to Arduino 3.3V
- ESP8266 GND to Arduino GND
- ESP8266 TX to Arduino RX
- ESP8266 RX to Arduino TX (use a voltage divider to lower the Arduino 5V TX
to 3.3V)
WiFiClient client;
unsigned long myChannelNumber = YOUR_CHANNEL_NUMBER;
const char * myWriteAPIKey = "YOUR_API_KEY";
void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
}
ThingSpeak.begin(client);
}
void loop() {
int sensorValue = analogRead(A0);
float current = (sensorValue - 512) * 5.0 / 1024.0;
ThingSpeak.setField(1, current);
ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey);
delay(15000);
}
```