A Semaphore for your Office Desk

Contents hide

Story

This is a small semaphore you can put on your desk. You can use it to tell whatever you want to the people around it. For example, because you need some concentration and you’d like your colleagues not to disturb you. Or to tell the status of the system you’re managing. Or say which mood are you today. The possibilities are endless!A Semaphore for your Office Desk

I wanted the thing to be dead-simple to use. It’s not connected to Internet, it only has a button to cycle between red, yellow, green and off. But it was a nice combination of different skills I wanted to improve.

The Electronics

The electronics revolve around the three 10mm diffused LEDs, the ATtiny13A and a pushbutton to choose the color. I could have chosen an even simpler circuit based on some mechanical four-way switch, but because this circuit is battery-powered, I wanted the semaphore to turn off automatically after some time in case I forget it on. And this requires counting time and controlling the LEDs digitally.

To keep the size small, I decided to use two AAA batteries. They provide a voltage around 2.4V; this is enough for the ATtiny, whose minimum operating voltage is 1.8V, and the LEDs whose forward voltage is 2.1V. But when the LEDs are controlled by the microcontroller, one must take into account the maximum voltage (VOH) provided by the digital I/O port when driving a load with 20mA. By looking at the datasheet, seems like VOH is 0.7 to 1.0 volts below the operating voltage. That would mean, in the best case, that the leds will get 1.7 volts across their ends, i.e. below their forward voltage, which is not recommended. So to increase brightness, I added a small DC-DC boost converter that provides 5V from a variable voltage from 1 to 5V. By operating at 5V, there are no voltage problems. This will add some small leakage current though, and the efficiency won’t be 100%.A Semaphore for your Office-Desk

The Firmware

The software of this little semaphore has to do three tasks:

  • detect the press of the pushbutton and go red, yellow, green, off at each press;
  • count 8 hours from the last press, turn off the lights if the time elapses, and reset the count every time the switch is pressed;
  • keep the power consumption low, by going in sleep mode.

This is my first attempt to program an ATTiny13, so I had to learn how to program a device so different than the usual Atmega328 of Arduino.

For more detail: A Semaphore for your Office Desk


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top