Skip to content

methodize/neema_esp32_wifi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Neema ESP32 WiFi - Google Assistant Controlled Blinds

Control your window blinds with voice commands via Google Assistant! No potentiometer needed - just say "Ok Google, open the blinds" and watch them move.

Features

  • ✅ Google Assistant voice control
  • ✅ "Ok Google, open the blinds" (100% open)
  • ✅ "Ok Google, close the blinds" (0% closed)
  • ✅ "Ok Google, set blinds to 50%" (any percentage)
  • ✅ Smooth acceleration/deceleration with AccelStepper
  • ✅ WiFi connectivity (no physical controls needed)
  • ✅ Remembers last position after power cycle
  • ✅ Works from anywhere (phone, Google Home, Google Nest)

Hardware Requirements

Components

  • Arduino Nano ESP32-S3 (with WiFi)
  • Stepperonline 17HS19-2004S1 NEMA 17 stepper motor
  • Pololu DRV8825 stepper driver
  • 12V battery or power supply
  • Jumper wires and breadboard

Wiring

⚠️ CRITICAL: ESP32-S3 uses 3.3V logic (NOT 5V!)

DRV8825 Control Pins:

  • STEP → ESP32 GPIO3 (D3)
  • DIR → ESP32 GPIO2 (D2)
  • ENABLE → ESP32 GPIO4 (D4)
  • SLEEP → Connect to RESET pin (or 3.3V)
  • RESET → Connect to SLEEP pin (or 3.3V)

Microstepping Configuration (1/32 mode):

  • M0 → ESP32 3.3V (NOT 5V!)
  • M1 → ESP32 3.3V (NOT 5V!)
  • M2 → ESP32 3.3V (NOT 5V!)

Power:

  • VMOT → 12V battery positive
  • GND → 12V battery negative AND ESP32 GND (common ground required!)
  • VDD → ESP32 3.3V (logic power)

Motor Connections:

  • A1, A2 → Motor coil A
  • B1, B2 → Motor coil B

ESP32 Power:

  • VIN → 12V (or use USB-C for development)
  • GND → Common ground with DRV8825

DRV8825 Current Limiting

MUST set current limit before use!

For 17HS19-2004S1 motor (2.0A rated):

  • Target current: 1.4A (70% of rating)
  • Vref setting: 0.7V
  • Formula: Vref = Current / 2

Use multimeter to measure voltage between trimpot wiper and GND, adjust to 0.6-0.7V.

Software Setup

1. Install Required Libraries

Using Arduino IDE:

  1. Library Manager → Install "AccelStepper" by Mike McCauley
  2. Library Manager → Install "SinricPro" by Boris Jaeger

Using Arduino CLI:

arduino-cli lib install AccelStepper
arduino-cli lib install "SinricPro"

2. Sinric Pro Account Setup (Already Done!)

Your device is already configured with:

  • Device Name: (check your Sinric Pro dashboard)
  • Device Type: Blinds
  • App Key: c831c095-xxxx (in code)
  • Device ID: 694f82666ebb39d664d5169d

3. Link Sinric Pro to Google Home

One-time setup:

  1. Open Google Home app on your phone
  2. Tap + (Add) → Set up deviceWorks with Google
  3. Search for "Sinric Pro"
  4. Tap Sinric Pro and sign in with your Sinric Pro account
  5. Your blinds device will appear in Google Home!
  6. Assign it to a room (e.g., "Bedroom")

Done! Now you can control it with voice.

4. Upload Code to ESP32

Using Arduino IDE:

  1. Select Board: "Arduino Nano ESP32"
  2. Select Port: /dev/ttyACM0 (or your port)
  3. Click Upload

Using Arduino CLI:

arduino-cli compile --fqbn esp32:esp32:nano_nora neema_esp32_wifi.ino
arduino-cli upload -p /dev/ttyACM0 --fqbn esp32:esp32:nano_nora neema_esp32_wifi.ino

Monitor Serial Output:

arduino-cli monitor -p /dev/ttyACM0 -c baudrate=115200

Usage

Voice Commands

Once setup is complete, try these commands:

Basic Control:

  • "Ok Google, open the blinds" → 100% open
  • "Ok Google, close the blinds" → 0% closed
  • "Ok Google, turn on the blinds" → Open
  • "Ok Google, turn off the blinds" → Close

Position Control:

  • "Ok Google, set blinds to 50%" → Half open
  • "Ok Google, set blinds to 25%" → Quarter open
  • "Ok Google, set blinds to 75%" → Three-quarters open

Relative Adjustments:

  • "Ok Google, increase blinds by 20%" → Move up 20%
  • "Ok Google, decrease blinds by 10%" → Move down 10%

Serial Monitor Output

When connected via USB, you'll see:

Neema ESP32 WiFi - Google Assistant Blinds Control
==================================================
Motor initialized
Steps per revolution: 6400
Rotation range: 3200 steps (180 degrees)
Connecting to WiFi...
Connected! IP address: 192.168.x.x
Sinric Pro connected!
You can now control blinds with Google Assistant:
  'Ok Google, open the blinds'
  'Ok Google, close the blinds'
  'Ok Google, set blinds to 50%'

Setup complete! Listening for Google Assistant commands...
Google Assistant requested position: 50%
Moving to 1600 steps (50%)
✓ Movement complete! Position: 50% (1600 steps)

Configuration

Adjust Rotation Range

If your blinds need more or less rotation:

// In neema_esp32_wifi.ino:
const int ROTATION_RANGE = TOTAL_STEPS / 2;  // 180° (default)

// Options:
// TOTAL_STEPS / 4 = 90° rotation
// TOTAL_STEPS / 2 = 180° rotation (default)
// TOTAL_STEPS = 360° full rotation

Adjust Motor Speed

For faster or slower movement:

const int MAX_SPEED = 2000;        // Increase for faster (try 3000)
const int ACCELERATION = 1000;     // Increase for quicker starts (try 1500)

Change WiFi Network

Edit these lines in the code:

#define WIFI_SSID "Frontier2211_EXT"
#define WIFI_PASS "ChairNotebook8146"

Troubleshooting

WiFi Won't Connect

  • Check SSID and password in code
  • Ensure 2.4GHz WiFi (ESP32 doesn't support 5GHz)
  • Move ESP32 closer to router
  • Check serial monitor for error messages

Sinric Pro Not Connecting

  • Verify App Key, App Secret, and Device ID in code
  • Check internet connection
  • Ensure Sinric Pro account is active
  • Check serial monitor for connection errors

Google Assistant Not Finding Device

  • Make sure Sinric Pro is linked in Google Home app
  • Try saying "Ok Google, sync my devices"
  • Check that device appears in Google Home app first
  • Restart Google Home app

Motor Doesn't Move

  • Check DRV8825 current limit (Vref = 0.6-0.7V)
  • Verify common ground between ESP32 and DRV8825
  • Check that M0, M1, M2 are connected to 3.3V
  • Ensure SLEEP and RESET are tied together or to 3.3V
  • Check motor coil connections

Motor Moves Wrong Direction

  • Swap one motor coil pair (A1/A2 or B1/B2, not both)

Position Tracking Wrong

  • Motor might be skipping steps (lower MAX_SPEED)
  • Current limit too low (increase Vref slightly)
  • Check for mechanical binding

Security Notes

  • WiFi password is stored in code (plaintext)
  • For production, consider using WiFiManager for secure credential storage
  • Sinric Pro credentials stored in code (rotate if compromised)
  • Device is accessible from internet via Sinric Pro cloud

Future Enhancements

Potential improvements:

  • Add physical override button
  • Battery voltage monitoring
  • Auto-close at sunset (RTC + light sensor)
  • Position feedback via limit switches
  • OTA (Over-The-Air) firmware updates
  • Local web interface (in addition to Google)
  • MQTT support for Home Assistant integration
  • Multi-blind control (control several windows)
  • Alexa support (Sinric Pro supports both)
  • Schedule/timer support

Technical Details

  • Board: Arduino Nano ESP32-S3 (esp32:esp32:nano_nora)
  • Flash Usage: ~400KB program storage
  • RAM Usage: ~50KB dynamic memory
  • WiFi: 2.4GHz 802.11 b/g/n
  • Cloud Service: Sinric Pro (free tier: 3 devices)
  • Communication: WebSocket over HTTPS
  • Latency: ~1-2 seconds from voice command to movement

License

This project is open source. Feel free to modify and use for your own projects.

Credits

  • Based on Neema ESP32 potentiometer-controlled blinds project
  • Uses SinricPro library for Google Assistant integration
  • AccelStepper library for smooth motor control

Author

Created for the Shed Computer Arduino projects collection.

References

About

Google Assistant voice-controlled stepper motor blinds via Sinric Pro and ESP32-S3 WiFi

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages