Project tutorial
A Semaphore for your Office Desk

A Semaphore for your Office Desk © MIT

Free to talk, kind-of busy or "in the zone"? Tell your friends and colleagues with this cute, battery-powered semaphore.

  • 5,028 views
  • 1 comment
  • 12 respects

Components and supplies

Attiny85
Microchip ATtiny85
I actually used an ATTiny13 but I guess an ATTiny85 is fine
×1
10968 01
SparkFun Step-Up Voltage Regulator - 5V
The actual regulator I used is at http://www.electrodragon.com/product/tiny-dc-step-boost-module-3v-5v-1a/
×1
10mm yellow LED (diffused)
×1
A000066 iso both
Arduino UNO & Genuino UNO
×1
10mm green LED (diffused)
×1
10mm red LED (diffused)
×1
Mfr 25fbf52 221r sml
Resistor 221 ohm
×3

Necessary tools and machines

3drag
3D Printer (generic)
09507 01
Soldering iron (generic)
ATtiny 13/85 Programming Shield

About this project

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!

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%.


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. Two parts were very important: an Attiny13|85 programmer shield (link in the tools list), and the hardware definition of the ATTiny13a for the Arduino IDE. Before writing the program, I made sure that I've set up everything correctly by running a "blink" program. It took a little while to get that little LED blinking!

The source code is in the attachment; apologies for the lack of comments. It works in a different way than the usual Arduino sketch: here, the loop() function only tells to go to sleep; the device can be woken up by the watchdog interrupt or the external interrupt (INT0) triggered by the push of the button; after finishing what to do, the device goes back to sleep.

Physical Layout

I probably wouldn't even start this project if I also had to design the semaphore enclosure myself; it would take too much time and I don't have great 3D design skills. But I was very lucky to find, on Thingiverse, a 3D-printable model of a semaphore with just the right size and features I was looking for.

(By the way, the author also published here on Hackster his project! I wasn't aware he went further from his 3D model, and it's very interesting to see how the "guts" differ from a similar enclosure)

The "head" contains only the three LEDs and the wires. They run through the long neck and go to the base. The top part is filled by the main board (with the button sticking out) and the DC boost converter; the remaining volume is filled by the AAA holder and batteries. The bottom side of the base is removable and allows you to replace the batteries.

In this project, nothing in the base is glued or attached to anything: if you place the parts the right way, they'll remain firm and also the switch is stable enough to let you push. But there's room for improvement, e.g. using hot glue or other kinds of joint.

I had to modify the Thingiverse models; in particular, I made the base a little bigger, enough to accommodate the two AAA batteries, and put a hole on the top side for the push-button.

The AAA batteries are held thanks to another clever 3D-printable object I found on Thingiverse, that doesn't need metal springs to keep the contact. I also modified it to make the "springs" a little less tall to reduce the friction against the surrounding parts. Both modified models are in the attachments, the original models are linked in the "team" section.

Code

TrafficLight_ATTiny13.zipArduino
Firmware for ATTiny13
No preview (download only).

Custom parts and enclosures

Battery holder STL
Bottom cover STL
Body and neck STL
Head STL
Original from carr3r model.
Print it laying horizontally, use support structure then remove it after printing.
If the head doesn't fit in the neck, file it slightly.
Head lid STL
Original from carr3r model
Flexible battery holder
OpenSCAD file to generate the STL file for the 2xAAA battery holder. Slightly modified to make springs less tall.
uploads-68-57-32-89-55-flexbatter.scad
Design model and assembly
Layer 1 contains the electrical boards
Layer 2 contains the battery holder (must be 3d-printed)
Layer 3 contains the bottom cover (must be 3d-printed)
Layer 4 contains the base (must be 3d-printed)

Schematics

Made on a perfboard. The DC step-up is soldered on one of its sides.
board.fzz

Comments

Similar projects you might like

RFID Desk Lamp

Project tutorial by Kutluhan Aktar

  • 1,231 views
  • 0 comments
  • 3 respects

Hacking Qualcomm (Quick Charge) QC 2.0/3.0 With ATtiny85

Project tutorial by Shahariar

  • 5,896 views
  • 11 comments
  • 40 respects

DHT Tiny Breakout for the Raspberry Pi

Project tutorial by Daniel Porrey

  • 6,002 views
  • 5 comments
  • 15 respects

Binary Wristwatch

Project showcase by thallia

  • 977 views
  • 0 comments
  • 9 respects

Arduino Audio Reactive Desk Light

Project tutorial by Haziq Azri

  • 12,578 views
  • 5 comments
  • 30 respects

2WD Voice Controlled Robot with Arduino and BitVoicer Server

Project tutorial by Marcio Tamagushi

  • 10,204 views
  • 11 comments
  • 32 respects
Add projectSign up / Login