Skip to content

A minimal demonstration of using an infrared breakbeam sensor to safely control pump operations with an ATtiny85

Notifications You must be signed in to change notification settings

tdeshazo/ir-switch-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Infrared Breakbeam Demo

A minimal demonstration of using an infrared breakbeam sensor to safely control pump operations with an ATtiny85.
When the beam is broken (or the stop button is pressed), the pump shuts off immediately.

Wokwi Simulation

Background

In August 2022, I started working with equipment that leveraged infrared breakbeams and encoders to fully automate distillations. This project aimed to model the principle of operation for a site automation and technology fair in June 2023. It was demonstrated again at our site's Take Our Kids to Work Day in April 2025.

Features

  • Demonstrates pin-change interrupts on the ATtiny85
  • Provides both manual (start/stop buttons) and automatic (infrared breakbeam) control
  • Visual feedback via status LEDs
  • Designed for a simple, low-power control unit

Bill of Materials

  • ATtiny85 microcontroller
  • Uxcell E3S-GS30E4 infrared fork sensor
  • DRV8871 H-Bridge DC motor driver board
  • 12V DC peristaltic pump
  • MPM3610 5V 1.2A buck converter
  • Latching power switch
  • Momentary pushbuttons (x2)
  • LEDs + current-limiting resistors (x3)

How It Works

  • Start button: Activates the pump and illuminates the run LED.
  • Stop button or breakbeam trigger: Immediately stops the pump and turns off the run LED.
  • All signals are active-low with internal pull-ups enabled.
  • Pin change interrupts detect button presses or breakbeam events, minimizing CPU polling.

Firmware

The firmware is written in plain AVR C using:

  • Direct register manipulation
  • Pin-change interrupts
  • Minimal main loop that responds to events

Photos

V1

This initial version had a single momentary switch with an outer LED ring that started and halted operation. The controls were housed in an ABS enclosure.

V1

V2

The controls were updated to include discrete controls and indicators. The housing was 3D printed in CF-PETG.

V2

About

A minimal demonstration of using an infrared breakbeam sensor to safely control pump operations with an ATtiny85

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages