WeasLED Magical Muggle Locator
by Meatlove in Circuits > Electronics
1065 Views, 16 Favorites, 0 Comments
WeasLED Magical Muggle Locator
A while ago, my wife challenged me to make a 'Molly-clock'.
She is a great fan of Harry Potter and ever since she saw the Weasley's magical clock at The Burrow, she dreamt of her own family locator.
I've seen a few beautiful projects here and elsewhere and I was amazed by the creativity of the creators! The clocks with 3d printed mechanisms are especially wonderful.
Since I'm better at digital circuits, electronics and light programming, I made my own version of the Weasley-clock.
Supplies
- ESP 8266
- Breadboard
- 4pcs 74HC595N shift-registers
- Resistors. I used 270 Ohm resistors, but different colours may ask for a different value
- LED's, in my case 160 pcs spread over 4 colours
- A 5V power scource (USB phone charger)
- Prototype PCB
- Ribbon cable i.e. an old floppy drive cable
- A (cheap) clock
- A piece of plexiglass/acrilic,
- Home assistant with the companion-app for tracking
- Knowledge of Node Red
- ESP home with just a few lines of code
- Basic tools
- Soldering iron
- Jigsaw
- Preferrably a drill-stand
Breadboarding
The goal of this project is to display the wearabouts of our 4 family members based on their phone GPS data. I chose to make a digital circuit with LED's as output. So we came up with the idea of 8 locations for the four of us. So, we need 32 outputs to make this work.
While searching if this is even possible, I found that you can expand your outputs with shift-registers. There are some good and clear examples on Youtube about how to control them that gave me the courage to try this out.
I did a lot of research over the summer. I did order some of the parts like the ESP8266 microcontroller and the 74HC595N shift-registers, but I still had to figure out how to control them. It's a good thing there is something like the ESP home project making coding really simple! I also found some code online to control the shift-registers which I only had to do some minor adjustments to.
That's when the experimenting began.
Code
This is the code I use.
It creates 33 switches in Home Assistant which control the outputs of the shift registers. Need even more outputs? Just copy/paste the code and adjust accordingly.
captive_portal:
sn74hc595:
- id: 'sn74hc595_hub'
data_pin: GPIO4
clock_pin: GPIO14
latch_pin: GPIO12
sr_count: 4
switch:
- platform: gpio
name: "Output Disable"
pin: GPIO5
- platform: gpio
name: "16 home"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 0
number: 0
inverted: false
- platform: gpio
name: "23 school"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 1
number: 1
inverted: false
- platform: gpio
name: "22 peril"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 2
number: 2
inverted: false
- platform: gpio
name: "21 shopping"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 3
number: 3
inverted: false
- platform: gpio
name: "20 forest"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 4
number: 4
inverted: false
- platform: gpio
name: "19 lost"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 5
number: 5
inverted: false
- platform: gpio
name: "18 work"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 6
number: 6
inverted: false
- platform: gpio
name: "17 travelling"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 7
number: 7
inverted: false
- platform: gpio
name: "00 home"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 8
number: 8
inverted: false
- platform: gpio
name: "07 school"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 9
number: 9
inverted: false
- platform: gpio
name: "06 peril"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 10
number: 10
inverted: false
- platform: gpio
name: "05 shopping"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 11
number: 11
inverted: false
- platform: gpio
name: "04 forest"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 12
number: 12
inverted: false
- platform: gpio
name: "03 lost"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 13
number: 13
inverted: false
- platform: gpio
name: "02 work"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 14
number: 14
inverted: false
- platform: gpio
name: "01 travelling"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 15
number: 15
inverted: false
- platform: gpio
name: "24 home"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 16
number: 16
inverted: false
- platform: gpio
name: "31 school"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 17
number: 17
inverted: false
- platform: gpio
name: "30 peril"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 18
number: 18
inverted: false
- platform: gpio
name: "29 shopping"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 19
number: 19
inverted: false
- platform: gpio
name: "28 forest"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 20
number: 20
inverted: false
- platform: gpio
name: "27 lost"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 21
number: 21
inverted: false
- platform: gpio
name: "26 work"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 22
number: 22
inverted: false
- platform: gpio
name: "25 travelling"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 23
number: 23
inverted: false
- platform: gpio
name: "08 home"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 24
number: 24
inverted: false
- platform: gpio
name: "15 school"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 25
number: 25
inverted: false
- platform: gpio
name: "14 peril"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 26
number: 26
inverted: false
- platform: gpio
name: "13 shopping"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 27
number: 27
inverted: false
- platform: gpio
name: "12 forest"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 28
number: 28
inverted: false
- platform: gpio
name: "11 lost"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 29
number: 29
inverted: false
- platform: gpio
name: "10 work"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 30
number: 30
inverted: false
- platform: gpio
name: "09 travelling"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 31
number: 31
inverted: false
Prototyping the Electronics
I started soldering the electronics to a proto PCB and made the connections.
I used pin-headers for the microcontroller to be able to swap it out in case of a problem. I also helps with connecting the wires to the PCB and make the connections between the shift-registers.
I came up with the idea to put the current limiting resistor on the ground side of the circuit. That way I only had to use 4 resistors instead of 32.
The scematics are attatched.
Downloads
To the Drawing Board!
I bought a cheap clock (€2,50) at the local discounter to use as a frame. This particular model has some space between the dial and the glass, so it is ideal for this project.
I removed the timepiece and started measuring and planning. I've cut a piece of plexiglass to size and wrapped it in painters tape. I drew circles and divided the gaps evenly.
I chose to go for groups of 5 LED's, so to prevent breaking the acrylic I alternated each line so they are offset to each other.
In the meantime, the Mrs. drew a dial.
Keep on Drilling
With 5 LED's representing a clock hand for every 32 possible options, a total of 160 holes had to be drilled.
It didn't came out perfect, but in the end this wasn't problematic.
I chose to paint the Plexiglass black for more depth and to hide what's behind. In hindsight, this wasn't nessecery.
LED's for Hands
I found some frosted 5mm LED's online and every family member got to choose their favorite colour representing themselfs.
So I soldered 32 rows of 5 LED's and attached the ribbon cable to them. And for each colour the ground wires combined, making it 36 wires in total.
After soldering each row and soldering the wires, I checked for shorts using a 2032 coin cell.
The heat of soldering affected the paint, so I marked the acrylic, took out the LED's and put on another coat of paint.
Wiring and Testing
I connected the wires to the respective outputs on the PCB and started testing in Home Assistant.
At first, we thought it was a good idea to only have the dial as a banner on the outside part of the clock, but we didn't like the end result.
The Dial
At the start of the project, I thought it was a good idea to have the LED's (partly) exposed. That's why I ordered frosted LED's.
I decided to place the hand drawn artwork under the scanner and print it on a white paper. We were a bit amazed of the positive effect this had on the looks of the project.
After that, I've edited the dial even further so it would get some sort of parchment look and I added the title/descirption in the center.
The dial is in between the front glass of the clockframe and the rear construction with the LED's like in a picture frame. So I could alter the dial very easily, should we crave for a more modern look.
End Result
I'm quite pleased with the end result and it really is helpfull to know where everybody is at a glance.
Sure, you can display your family whereabouts on a wall mounted tablet with Home Assistant together with 1001 other things, but I think this resulted in a more stylish device and a creation that I'm really proud of! It really is an eye-catcher.
The circuit uses just short of 0.5W of power.
Tweaks
After the first days I decided to make some adjustments.
The green and pink LED's are a bit dominant, so I lowered the resistance of the reds and blues by soldering another 270 Ohm resistor in parallel.
I altered the flow in node-red so that the LED's are switched off when no one is home. (remember the output enable pin?)
I think it would be silly if uninvited persons would know if we're still at work or are already travelling home.
I'm curious for your opinion. Will you concider making a clock like mine? Do you see room for improvement?