LazyMax 1000: Arduino Phototransistor and Haptics Project

The idea for this Arduino phototransistor project came to me based on an idea that was shared by one of my friends at the FabLab. He talked about how his lab only has stools for people to sit on. Being very uncomfortable, the person succumbs to the discomfort and stands up to move around. In our case, we had very comfortable rolling chairs for sitting and reclining, which can get you lazy and even sleepy real quick.

Arduino Phototransistor and Haptics Project

In this project, I wanted to solve that problem by creating a sleek gadget which when plugged into our chairs, will prompt the user to get up if they are sitting continuously for more than 10 mins. It does this by using a haptic feedback motor, and it will only notify the person sitting on the chair, instead of disturbing others around him (if I were to use other means like sounds/lights).

This Arduino phototransistor project consists of three stages:

  • Preparing the electronics with the help of Modella
  • Programming
  • Designing and printing it using the Ultimaker

How Does it Work?

How Does it Work

The NPN phototransistor signals the ATtiny44 when there is no light (this is the case when a person is sitting on the chair). After which the controller starts a timer. If the timer exceeds 10 minutes, then it immediately activates the haptic motor, which prompts the user to get up.

Required Materials

  1. NPN plcc 2 phototransistor
  2. ATtiny44 controller (Arduino works too)
  3. 20MHz crystal
  4. 10K resistor
  5. 6 pin (3×2) header 2nos
  6. 1uF SMD capacitor
  7. 9V battery and clip
  8. Haptic motor

Electronics and Programming

I used this tutorial to learn about phototransistors. The NPN phototransistor will be used with a floating base and the emitter connected to ground. The collector needs to be pulled up to Vcc through a resistor (I am doing this with the internal pull-up resistor). When the phototransistor detects light (the collector and emitter are shorted) it outputs a logic LOW voltage and a logic HIGH voltage when there is no light. The configuration:

trans

I started off by using my HelloWorld board milled from the Modella and de soldering the button from it. I then attached the phototransistor to ATtiny pin no: 7. I found out that the notch in the package of the phototransistor represents the collector terminal. I learned this from the VEMT3700F NPN Transistor datasheet (PDF). Another resource worth checking out is the TT Electronics Optek Technology resource guide. You can also just use an Arduino board and connect the phototransistor to the Arduino’s digital pin 7 and use the same code shown below.

Read More:  Arduino Phototransistor and Haptics Project


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