Log your grid's frequency for years with an Arduino Nano, an optocoupler and a 16x2 LCD

@curator · Nov 18, 2026 · 36 views · via Hackaday.io ↗
Difficultymedium

A weekend build for anyone curious whether their grid is getting shakier. Jeroen Brinkman's monitor reads mains frequency at a wall outlet through a 230 V to 5 V optocoupler, which fires an interrupt on each zero crossing so the Arduino can time the gaps. It shows live frequency on a 16x2 display and logs how long each week spent outside a tolerance band you set.

The nice touch is the storage: four bytes per week in an EEPROM ring buffer gives about 4.6 years of trend data on a Nano R3 and decades on a Nano R4, dumped over USB serial for a spreadsheet. The sketch, a BOM PDF and schematic images are on the project page. Add a DS3231 rather than a DS1307 if you want timestamps that do not drift.

Safety note: the only thing touching mains is the optocoupler module. Keep it in an enclosure and never probe the hot side with the Arduino connected.

Materials

  • Arduino Nano R3 or R4
  • 230 V to 5 V optocoupler grid sensor
  • 16x2 I2C LCD
  • push button
  • DS3231 RTC (optional)

#arduino#mains-frequency#optocoupler#data-logging#grid

1 💬 0 comments

0 comments

Log in or sign up to join the discussion.

Report this

Tell the moderators what is wrong. Spam, stolen content, unsafe advice, scams.