Skip to content

pantaluna/esp32_sw180_tilt_sensor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Description

This project demonstrates the basics of interfacing with the SW180 tilt sensor.

What are the HW SW requirements of the ESP32 MJD Starter Kit?

Hardware

  • A decent ESP development board. I suggest to buy a popular development board with good technical documentation and a significant user base. Examples: Adafruit HUZZAH32, Espressif ESP32-DevKitC, Pycom WiPy, Wemos D32.
  • The peripherals that are used in the project. @tip The README of each component contains a section "Shop Products". @example A Bosch BME280 meteo sensor breakout board.

Software: ESP-IDF v3.2

mkdir ~/esp
cd    ~/esp
git clone -b v3.3 --recursive https://github.com/espressif/esp-idf.git esp-idf-v3.2

Instructions

  1. GPIO-MUX: the input pin GPIO_NUM_SENSOR is looped back to the output pin GPIO_NUM_LED so this is wired by software, not by cables :)

  2. Sensor SW-180 @logic pinvalue=1 no tilt | pinvalue=0 yes tilt

@wiring ​ Connect pin 1 (left) of the sensor to DATA ​ Connect pin 2 (middle) of the sensor to GND ​ Connect pin 3 (right) of the sensor to VCC

@configure ​ Use GPIO_PULLUP_ENABLE in gpio_config() XOR Connect a 10K resistor from DATA pin to POWER pin.

Running the example

  • Run make menuconfig and modify for example the GPIO PIN# that you want to use.
  • Run make flash monitor to build and upload the example to your board and connect to its serial terminal.

Reference: the ESP32 MJD Starter Kit SDK

Do you also want to create innovative IoT projects that use the ESP32 chip, or ESP32-based modules, of the popular company Espressif? Well, I did and still do. And I hope you do too.

The objective of this well documented Starter Kit is to accelerate the development of your IoT projects for ESP32 hardware using the ESP-IDF framework from Espressif and get inspired what kind of apps you can build for ESP32 using various hardware modules.

Go to https://github.com/pantaluna/esp32-mjd-starter-kit