Close
0%
0%

Smart Chain Puller

Yanking a fluorescent light fixture into the 21st century

Similar projects worth following
119 views
0 followers
Pulls a light chain using a servo controlled by an ESP8266 running esp-homekit-sdk. Two photoresistors are read to detect the state of the light, allowing manual pulling of the chain without the light's status getting out of sync.

The brain of the Smart Chain is an ESP8266 NodeMCU board. It uses the ESP8266_RTOS_SDK with the esp-homekit-sdk. I chose this framework because I wanted the features of FreeRTOS, and I have used Apple HomeKit before. However, at some point I would like to switch to Home Assistant to control this light. 

The mechanism that pulls the chain is very simple. It consists of an SG90 servo, a 3D printed arm, and an extension spring. 

servo arm.stl

Use an M2 screw to attach to servo

Standard Tesselated Geometry - 132.89 kB - 08/23/2022 at 16:44

Download

Standard Tesselated Geometry - 164.54 kB - 08/23/2022 at 16:44

Download

  • 1 × SG90 Servo
  • 1 × 120 ohm resistor
  • 1 × 270 ohm resistor
  • 1 × ESP8266 NodeMCU board
  • 2 × Photoresistor GM5539

View all 6 components

  • In-Depth Look at the Pulling Mechanism

    Henry York08/23/2022 at 16:00 0 comments

    The spring is necessary to balance the upward force of the fixture's internal mechanism; otherwise the servo stalls out when it tries to pull the chain down. The spring is hooked to a piece of 3mm plywood that I cut out when I was prototyping. The plywood could easily be replaced with a 3D printed part, though.

    The chain is attached to the servo arm using a bead chain connector heatset into the PLA. I also friction welded some PLA around and through it with a Dremel, and since then it has stayed put. This allows the light chain to be easily detached from the puller. 

    The puller seems to work on the first try about 70% of the time. I have added some code to move the servo part of the way before moving it the whole way, and that seems to help it. If the problem persists or the servo breaks, I may try using an MG90 servo (with metal instead of plastic gears) for higher torque and better durability. 

  • Light State Detection

    Henry York08/23/2022 at 15:12 0 comments

    In order to be truly smart, the chain puller needs to know if the light is on or off. I'm using two voltage dividers to accomplish this: one with normal resistors and the other with photoresistors. 

    With two photoresistors, the state of the fluorescent fixture can be detected regardless of the amount of external light. As a photoresistor is exposed to more light, its resistance decreases. When there is much more light on the photoresistor facing the fluorescent light than the one facing away, the voltage on pin A0 is close to +1v. When there is less or the same amount of light on the photoresistor facing the fluorescent tubes, the output voltage is under +400mv. The ESP8266 is able to read this voltage and update the HomeKit state accordingly.

    The second voltage divider with the normal resistors is needed to keep the voltage output range between 0-1v, which is what the ESP8266 is able to read on its A0 pin.

    The photoresistors face in opposite directions, and light from the fluorescent tubes is mostly blocked from reaching the second one by the wood support. 

View all 2 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates