Tag Archives: electronics

Conways Game of Life

Finished up the hardware to display the results of my coding exercise. My primary goal was to learn a little more about python and object oriented coding. I could never really wrap my head round objects, and I needed a project with real end goals to address that. The code is available and has documentation on github.

Basic construction is comprised of 16×16 pixel ws2812 panels in a 3×3 grid. The way the panels were laid out and wired made a sort of weird numbering scheme, which I had to compensate for in software. Next time i’d be more planful on which inputs go to which outputs.

I made a picture frame out of walnut to contain the insides. There are actually 2 panes of glass with the following layers:
(front)
Glass
Matte with display window cut
Glass
Papyrus type paper for led diffusion
The 3d-printed grid
the wooden panel with the led’s mounted
(back)
This stack keeps everything tight/contained and keeps the LED grid close agains the diffuser paper so the lines are crisp. I used the LED grid so i’d get colored squares instead of circles, to me it really looked a LOT better.

The somewhat ungainly back of the stack. I put air holes along the top as I wasn’t sure. how much heat the LED’s would generate, but they aren’t running at full brightness and the glass doesn’t even get warm to the touch. You’ll notice the 3 cross braces, which are bowed up by spacers in the middle. This presses the whole grid tightly against the glass, keeping the lines displayed bye the grid on front tight. Powered by a raspberry pi with a small level converter IC to talk 3.3v -> 5v.

The cells change from yellow to red to green then blue as they age.

Conways Game of Life Preview

Working on a new project, combining making something fun with learning some new skills. In this instance the primary goal was to learn a little more about python, Visual Studio Code + Github, and object oriented programming (my first class!).

Sneak peek below, but this will be a RGB 48*48 matrix framed in a shadow-box on the wall. Initially it’ll run the game of life, but could be updated later to display anything. Early pics of the physical project below, and link to gitHub repository.

CNC Upgrade :: Electronics

This machine is based around a smoothstepper control board driving gecko stepper motor drivers. On the pc end of things gcode is processed by mach4. It’s an interesting relationship between these three companies as the lines of support are pretty gray. I had some issues during the build and its amazing how on the back-end their engineers all seem to know each other. In particular the smoothstepper guys were super helpful on some issues that wen’t pretty deep into mach4 territory.

I also just wanted to say that you’ll pay a bit more for the gecko drivers, but their support is top notch. I blew up a board due to ignorance, and they replaced it without even an admonishment!

D-rail rookie here missed that common ground bar on his second-hand components. Shorted out all the outputs from the gecko driver. Pro tip :: that lets the magic smoke out.

I did as much of the wiring on a backer-board on my workbench as I could before mounting the panel in the back of the machine. The stepper drivers need a heatsink, and I had this one in my garage for 10+ years. Originally it was going to be for a home theater amplifier.

I 3d printed up a bracket for the smoothstepper, and even printed some cable management loops. On my last build 3d printers really weren’t a thing so maybe i went overboard, but this was pretty fun. Used a lot of ferrules which I learned about volunteering at the high school for First Robotics. Nice to cross pollinate skill sets!

We bring in 220 on the left, which goes through a big contactor, with only the 5v rail-mount power supply always being powered. The contactor is initiated through a the aircraft toggle mounted on the estop box. That basically turns whole machine on/off. The limit switches on the machine were 24v so i had to solder inline resistors so they would work with the 12v inputs on the smoothstepper.

Publishing IoT IP Addresses to MQTT

I have been playing around with using ESP8266’s as endpoints around the house for collecting temperature, turning the sprinkler pump on, texting me when the doorbell is pressed, etc.  One of the challenges when doing setup/testing is getting the IP address of them when they first come online.

I am running dnsmasq on a raspberry pi, which provides both local DNS and DHCP services.  This is in no way novel, as it is a pretty vanilla configuration.  What I wanted to share is a small script that monitors for updates to the dnsmasq log, watches for new client releases/renewals and then posts those to the MQTT service.  There are lots of things you can do with it from there, but I usually just subscribe to the topic via terminal or mqtttool on my iPhone.

#!/usr/bin/python
from pygtail import Pygtail
import sys
import re
import time
import paho.mqtt.client as mqtt

client = mqtt.Client()
client.username_pw_set("xxxxxx","xxxxxx")

while (1):
 for line in Pygtail("/var/log/dnsmasq.log"):
   isItACK = re.search(r'DHCPACK',line)                #see if its an ACK
   if isItACK:
     newInput = re.sub(r'^.*DHCPACK\(eth0\).', "", line) #strip everything before mac address
     newInput = newInput.rstrip()                        #strip newlines
     client.connect("xxxxxx.widgetninja.net",1883)       #connect to mqtt
     client.publish("/network/DHCP",newInput)            #publish to mqtt
     client.disconnect                                   #hang up
     #sys.stdout.write(newInput)                         #debugging
 time.sleep(10)

Hope this helps save you some time trying to find the ip address of that new device, be it something you made or otherwise just added to your network.

mqtt

Word Clock Build

This project was one of those long-running ones which took almost 7 months from when I saw the first one out there and wanted to make one, to when I actually got started.  One of the big catalysts was Joe’s blog post on his build – so hats off to him!  Joe did perf board wiring, and I wanted to create a circuit board for the task.  The reason for this was twofold: (1) I hate perf board and (2) I wanted to build the atmega circuit and bootstrap it myself.

So if you watch the video below, you will see I failed at getting my atmega to run.  Could not figure it out!  Next time I will surely include additional LED’s (pin 13 anyone?) to aid troubleshooting.  So, that said in the zip file attached you will find my eagle schematics.  If you use them, be aware the microcontroller portion requires some additional scrutiny.  Maybe its fine, and I just messed up the wiring.  Who knows.  If you want to take a peek at it and give me feedback I would appreciate it!

Other big change/addition from Joe’s build was I added a Real Time Clock (RTC).  In my case I used the ChronoDot.  It is much more accurate, and tracking time in code was MUCH easier.  Here is my code, eagle schematic, and .DXF file for the led array.

WP_20130217_001