toothache

Homekit dual-channel PWM light control board

 
Overview

Introduction: A dual-channel n-mos dimmer based on ESP8266, with a GY-30 light intensity sensor interface and two human body sensor interfaces (supply voltage 12v), which can be used for two-channel sensor switches to control two-channel PWM light strips
1. Product Introduction

This project is developed using ESP8266 (ESP-12E module) for table lamp modification, smart night light DIY, etc. The light intensity detection uses the GY-30 light intensity sensor, which provides two human body sensor inputs and two MOSFET outputs. The human body sensor Pyroelectric sensors or microwave sensors can be used.


2. Application scenarios

: Intelligent transformation of desk lamps,
smart night lights
, other applications, low-voltage MOS switch dimming/speed regulation, etc.


3. Product overview

This product uses ESP8266 (ESP-12F module) as the main control
board with two-channel PWM dimming/speed regulation. The circuit can be connected to loads such as LEDs and DC motors.
It provides a GY-30 sensor module interface for light intensity measurement.
It provides two human body sensor input interfaces (two channels of 12V and 3.3V sensor power supply are reserved)
and one button interface


. 4. Product parameters
(1) Hardware selection

master: ESP8266 (ESP12-E module)
Light intensity sensor: GY-30 module
Human body sensor: RCWL-0516
N-MOS: NCE-3010S (Vds = 30V, Id=10A)
DC- DC module: 9-28V DC to 3.3V DC (non-isolated)

(2) Electrical parameters

Working voltage: 9-28V (12V recommended)
MOS tube supply voltage: Same as the input voltage (12V recommended)
MOS tube driving voltage: Same as the input voltage (12V is recommended. If the input voltage is high, the driving end voltage dividing resistor needs to be adjusted)
MOS tube working current: 10A

(3) Specifications and

parameters: 80mm x 34mm double-layer board

5. Instructions for use:

This project is used for the renovation of old desk lamps. For Homekit, you need to prepare your own power supply (preferably 12V power supply and light strip) according to the power supply requirements of the light strip. The access code is provided in the accessory.
Using this board, you can also change the night light to intelligent control, connect to homeassistant through esp-home, and provide various automation functions. You can also use esp-home's own local automation as a human body sensing night light.
The functions of each part of the board are as follows:

code compilation and burning:

refer to the "Graphic Tutorial.docx" in the attachment for

troubleshooting.

After the burning is completed, the power supply is changed to a 12v external power supply to avoid insufficient power supply and unstable module operation.
If any failure occurs, you can use the serial port assistant. Check the information. When the startup is completed, free heap xxx will be prompted. At this time, you can connect to
wifi. If you cannot connect, check whether wifi is turned on. 5G and 2.4G share one SSID. It is best to separate
them. After successful pairing, if the module is often offline, please check wif stability. If the module position signal and power supply current are sufficient,
if it needs to be re-programmed, select "ALL Flash Conetents" in the Erase Flash option

. 6. Remarks:

This project requires programming software before use. For the source code, see the attachment.
Compilation environment:
Arduino 1.8. 13.
Burning tool:
The USB to TTL module

attachment contains the following

source code.zip

single-channel PWM dimming with inching switch (one-chane-lightbulb sample code)
dual-channel PWM dimming with inching switch (two-chanel-lightbulb example Code)
Dual-channel PWM dimming with inching switch, light intensity sensor, human body sensor (two-chanel-lightbulb-sensor sample code) The video demonstrates

other accessories for this version

Homekit development specification document (HAP-Specification-Non-Commercial- Version)
module compilation and burning tutorial
video tutorial
sensor module purchase recommendations and

precautions.

This project does not reserve onboard burning chips. You need to prepare your own USB to TTL module. The power supply of modules such as CH340
and MOS power supply are the same voltage. According to the DCDC module The input voltage range is determined. I am using a 9-28V to 3.3V non-isolated DCDC module. When purchasing, you need to pay attention to the size (the attachment provides a link to the module I purchased, you can refer to the module size).
Below the DC-DC module are the analog ground and digital If the magnetic ring connected to the ground is not needed, it can be directly short-circuited with a wire.

The production cost

is about 10 yuan

. 7. Test video

The test video shows that an old desk lamp is modified and connected to HomeKit to realize functions such as voice control, light brightness adjustment, and light intensity collection. , more automated operations can be achieved through the homekit hub.

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-05-08 15:08:19

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号