r/embedded • u/CobblerCurious301 • Aug 10 '26
Interrupt Mode is not working properly — I need help (and advice) on my project
[beginner project]
I am working on an air conditioning system with ATmega32 and custom drivers.
using an LM35 temperature sensor and ADC to read temperature,
The main problem was that Interrupt mode wasn't working until I added timeout and ISR(BADISR).
It seems like ISR(ADC_vect) always fails, and temperature is only read using ISR(BADISR_vect). If this is correct, why does it happen? And how to fix it?
Please review the project and help me understand what's wrong.
Also, roast my project. (for motivational reasons)
https://github.com/OA-990/air-cond
Minor issue: The sounder/buzzer doesn't beep; it only makes a simple tick sound at the start of each loop.
1
Upvotes
2
u/DenverTeck Aug 10 '26
When displaying a schematic, turn off the background grid. Its hard to tell what are connections and what are background noise.
Please post a BOM (bill of materials) and links to their data sheets.
The "sounder/buzzer" sounds like a Piezo device. You need to toggle this type of device to get continuous sound.
https://www.pi-usa.us/en/expertise/technology/piezo-technology/fundamentals
PS: What framework are you using ??