Posts

How to Fade an LED

Image
In this tutorial we're going to talk about fading an LED from On to Off and back again but I think it would be really useful to have two LED's to fade. This means a short detour into setting up LED's and most importantly current limiting resistors. Most modern microcontrollers are capable of supplying enough power to directly drive an LED, meaning you can connect an LED to an IO pin and directly turn it On/Off. There is a limit to how much power the pin can supply and also how much power the LED can take before one or the other will burn out. You should never connect an LED directly to a power source, you should always have a resistor in line with it to limit the maximum amount of current that can flow through it. To calculate the exact amount of current flowing through a circuit you need to know Ohms law .  Voltage = Current x Resistance .  We're using a 100 Ohm resistors in this circuit, so if it were connected to 3.3V output on the GPIO pin the current would be 3.3/1...

Radiator Key Inserts

Image
I use radiator bleed screws with a square end and radiator keys to secure one of the compartments on the side of the NikolAI box. The screws themselves have a tendency of disappearing all the way inside the keys which can make it really hard to close the compartment again. The simple solution is to pack the inside of the key to prevent the screws from moving too far inside them. The small pieces of packing material had a tendency to fall through the honeycomb on the laser cutter so it was easier to affix them all to a sprue and snap them off as required. This allows me to lift the whole thing out of the laser cutter in a single piece and not lose any of the tiny squares.

Cobra Paw Replacement Box

Image
  We picked up a super cheap copy of Cobra Paw from an outlet store a few weeks ago. I'm honestly not sure how they managed to acquire a dozen water damaged German copies of the game but having played the game before I realised it was totally worth the 50 pence I spent on it. The default box has always felt oversized to me but I guess that's something about perceived value. It prompted me to make this much smaller wooden box for the game which sits much nicer on our game shelf. The rules are simple enough to not actually need a physical copy of them. ( svg here )

Multiple Buttons and LEDs

Image
Yesterday's post showed the making of this little two button remote control  so it seems only right to to include it in this post about reading multiple buttons. It's just two simple buttons that pull the data line down to ground when pressed and could easily be recreated on the breadboard if required. We're also going to talk about multiple LED's and set up the framework for using multiples even though the we're only going to using the one built in LED again. The main difference between this program and the previous one is that the inputs and outputs are going to be defined as arrays of values instead of just single values. Right at the top of the program it's important to define how many inputs and LED's there around going to be and then create an array of values to declare which data lines these things are going to be on, in this instance D1 and D2 and the same LED as before. even though there is only one LED we can still define it in an array. Now when...

Two Button Remote Control

Image
Next on the list of achievable items was this little two button remote control. This hides inside the puzzle box until it is released by the player and is used to navigate a mouse around a maze on the top of the box. There are two tactile switches hidden under the brass chicago screws so that it makes a very satisfying and positive click when pressed. There are actually seven layers of 1.5mm material that go into these controls and that allows me to build up a compartment that is a perfect height for the buttons and also a captive area for the screws so that they don't fall out. The general size was a bit of a trade off, it had to be quite small to fit inside the compartment but still a sensible size to click. The arrows were engraved onto the top layer of material but they weren't very visible so I added some smaller brass labels which show the button function much more clearly. Inside the remote are two surface mount, low profile, tactile switches. The connections are first h...

Leather handles Jig

Image
  I made the first two handles with a lot of brute force and effort but after finishing them I didn't like the stitching, I should have used a backstitch rather than a running stitch so I had to go back and fill in the gaps. This meant that the actual stitching was taking around three and a half hours per handle. I realised the stitching went faster around the wooden handle area so I quickly cut out a wooden section that runs the whole length of the handle. This holds the leather more firmly and allows me to use the vice to hold the work, it now takes just over two hours to finish a handle, so just ten more hours of sewing to go. The handles are mounted to the very top of the box and can be used to lift the whole thing. These handles are still waiting on some longer screws to affix the wooden section to the middle.

How to Read a Switch

Image
So far we've covered how to blink an LED on and off and how to flicker an LED using an analogue output value, it's time to start reading and reacting to inputs to the controller. This means adding some additional hardware to read from, but today that can be a simple as a single wire on a prototyping breadboard. One end of the wire is connected to the D1 input and the other end is swapped between the 3V3 pin and the GND pin to create High/Low input signals. The initial code to read this is impressively simple, we're also going to leave some LED code in the demo so that we can easily see what value is being read by the controller. When you load this example you should see that the LED turns on when the wire is connected to GND (remember the LED_BUILTIN is active low) and the LED turns off when the wire is connected to 3V3. This system works but has a downside, the input pin only changes state when the wire is connected to the new pin. When the wire is disconnected and l...