← Back to Projects

tinyTemp

Temperature display on ATtiny85: reads sensor via ADC and shows °F and °C on SSD1306 OLED (ECE 304, Spring 2024).

View on GitHub →

Overview

ATtiny85 firmware that reads temperature from ADC channel 2 (1.1 V ref), averages 25 samples, converts to °C and °F, and displays on a 0.96" 128×64 SSD1306 OLED. Shows °F for 3 s then °C for 3 s; displays "TOO HOT!!!" above 70 °F. ECE 304 project; no host PC—all on the MCU.

Description

ATtiny85 firmware that reads temperature from an analog sensor on ADC channel 2 (1.1 V ref), averages 25 samples, converts to °C and °F, and displays on a 0.96" 128×64 SSD1306 OLED. Display alternates °F (3 s) and °C (3 s) and shows "TOO HOT!!!" above 70 °F. ECE 304 project; all logic on the MCU, no host PC. I2C to the OLED is bit-banged (ATtiny85 has no hardware I2C). Demonstrates embedded C: ADC, timing, PROGMEM, bit-banged I2C, and display driver integration on a resource-constrained MCU.

main() and ADC main() disables the watchdog, then calls adc_init(), OLED_init(), and OLED_clear(). The ADC uses internal 1.1 V ref and channel 2; 25 samples are summed via get_adc() (start conversion, wait for ADIF, read ADCL then ADCH for 10-bit value). Temperature is computed from the averaged reading with a linear formula to °C and then °F.

display_temp and main loop display_temp(value, unit) formats the value to one decimal and prints either " Deg C " or " Deg F " from PROGMEM. The main loop shows °F, and if above 70 °F prints "TOO HOT!!!" at a fixed position; waits 3 s; clears; shows °C with the same logic; then enables the watchdog (8 s) and spins in while(1).

tinyOLED.c driver SSD1306 driver: PROGMEM init sequence (multiplex, addressing, charge pump, display on), 5×8 font, and OLED_cursor / OLED_printC / OLED_printP for positioning and text. Bit-banged I2C on GPIO. Build: make for tinyTemp.c + tinyOLED.c; make flash uses avrdude and USBtinyISP to program the ATtiny85.

Demo

No live demo available for this project. See the repo for setup and run instructions.

Tech & tools

  • Embedded
  • C
  • ATtiny85
  • SSD1306
  • I2C

Highlights

  • Embedded firmware (C) for sensor readout and I/O
  • Bit-banged I2C and SSD1306 driver on ATtiny85
  • ECE 304 project

More projects

WorldWide Rover

HackUMass XII — Best Embedded System. Autonomous, globally accessible rover: web interface for real-time control, maze navigation, obstacle avoidance. Python/Flask backend, Raspberry Pi, Arduino, React, ngrok.

Buffet

Trading AI: paper and live trading on Alpaca, strategy optimization, signal processing, and Qiskit-based quantum optimization. Python, TensorFlow, Alpaca API.

Pong on Assembly

Interactive Pong on FPGA (Duke ECE 550). Hardware VGA/PS2 implementation plus full assembly version (pong.s) for custom 32-bit processor ISA.

Custom Single-Cycle 32-Bit Processor

Custom ISA and single-cycle datapath in Verilog; synthesis-ready design used as the execution target for Pong assembly (Pong-on-Assembly repo).

Baretag iOS App

iOS app (Swift) for real-time device tracking and management; Flask/Ngrok backend and 3D localization validated in Blender.

Multilateration 3D Positioning

3D multilateration and localization algorithms with Python implementation and Blender-based simulation; feeds into Baretag device positioning.

RISC-V Encryption

Low-level encryption on RISC-V: assembly and C implementations for algorithms and analysis on a RISC-V toolchain.

PUF Tester

Hardware tooling for testing and characterizing Physically Unclonable Functions (PUFs); supports security and fingerprinting use cases.

WorldWide Rover

HackUMass XII — Best Embedded System. Autonomous, globally accessible rover: web interface for real-time control, maze navigation, obstacle avoidance. Python/Flask backend, Raspberry Pi, Arduino, React, ngrok.

Buffet

Trading AI: paper and live trading on Alpaca, strategy optimization, signal processing, and Qiskit-based quantum optimization. Python, TensorFlow, Alpaca API.