Giter Site home page Giter Site logo

heng-dimmer's Introduction

Heng Balance Lamp Dimmer

This is a simple dimmer module that is designed for the Heng Balance Lamp that materialized on Kickstarter a while back and is available through various distributors.

Circuit

The circuit was designed with components that I had at hand at the time. Luckily, the lamp is powered via a USB power supply, so I could just pulse width modulate the supply to the lamp in line. The switching transistor is a BUZ11 N-channel MOSFET. It's driven directly by one of the output compare pins of the ATtiny13A.

The user adjusts the PWM duty cycle (i.e. brightness) via a rotary encoder that includes a push button switch. The wires are soldered directly to the underside of the circuit board. Holes allow to install cable ties as strain relief.

The PCB is shared on OSH Park.

Firmware

The program configures the timer to run in fast PWM mode with a prescaler of 8. Since I didn't change the clocking fuses, the microcontroller runs at 1.2MHz. With the prescaler and the 8 bit resolution, the PWM frequency ends up being 586Hz which is sufficient to not see flicker.

7 distinct brightness levels can be selected by turning the rotary encoder. Pushing it brings the lamp to full brightness if it wasn't already. It switches the lamp completely off otherwise. This allows toggling between off and fully on by pushing the button.

The encoder phase and button inputs are sampled every time the timer overflows, i.e. with the same frequency as the PWM frequency. The button is debounced by requiring it to be pushed for > 107ms.

Note: When the JTAGICE3 is attached to the board, the push button functionality doesn't work reliably since the programmer seems to include a pull-up resistor on the SCK line.

Housing

The housing allows the populated circuit board to be fastened by the rotary encoder nut. Unfortunately, the design doesn't allow the PCB to be taken out once the cables are installed. Neither is it possible to access the programming header once the cables are installed and the PCB is installed in the housing.

The big radius on the back side allows to fasten the entire unit to the round base of the lamp using cable ties.

Pictures

Backside of assembled module Attached to lamp

heng-dimmer's People

Contributors

svenschwermer avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.