Post

Christmas Stud Findings

Building a DIY stud finder with NodeMCU that sounds like a geiger counter.

More NodeMCU magic! A stud finder. It sounds like a geiger counter. I added an antenna to explain electromagnetic waves / interference to my wife. It was fun sticking it to my tongue and pretending it hurts.

NodeMCU Stud Finder

Read more to see code snippets and whatnot.

Well you must be a curious type. Here ya go.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
let isOn = false;
const interval = 0;
var count = 0;

function main()
{
    function toggleLights()
    {
        isOn = !isOn;
        digitalWrite(D2, isOn);
        digitalWrite(D3, isOn);
        digitalWrite(D4, isOn);
    }

    setInterval(() =>
    {
        count++;

        analogInput = Math.round(analogRead() * 10000);
        if (count > 200)
        {
            count = 0;
            console.log(analogInput);
        }

        if (analogInput > 100)
        {
            isOn = false;
        }
        else
        {
            isOn = true;
        }
        digitalWrite(D2, isOn);
        digitalWrite(D3, isOn);
        digitalWrite(D4, isOn);

    }, interval);
}

It’s not very good, but we aren’t super advanced yet.