If you’re into microcontrollers you know the ability to think and perform math in binary is a must. [Joe Ptiz] has been looking for a way to keep from being distract by the math when coding while still keeping the binary strings in the forefront of his mind. The solution he came up with is to use the Python interpreter as a binary math aide.
We knew that you could use Python to convert between decimal, hexadecimal, and binary. But we failed to make the leap to using it for troubleshooting bit-wise operations. We can see this being especially useful when working with sixteen-bit I/O ports like those found on STM32 chips. For us it’s easy to do 8-bit math in our head, but doubling that is another story.
The image above is one screenshot from [Joe’s] tutorial. This illustrates a few different bit-wise operators given decimal inputs but displaying binary as output. He also illustrates how you can use python to test out equations from C code by first setting the variables, pasting the equation, then printing the result to see if the output is what was expected.
This is the desktop binary clock which [Tim the Floating Wombat] recently finished building. He calls it the Obfuscating Chronoscope since it’s a bit more difficult to read than your traditional analog or digital timepieces. But the simple design looks neat and it’s a great way to learn about board layout and microcontroller code.
He started by solving a few questions about the display technique. He wanted to use as few LEDs as possible. He settled on just four, and to prevent unnecessary confusion, decided to make sure each type of display (seconds, minutes, hours) would have at least one LED on at a time. Hours are easy enough to display, but with just four bits how can minutes be shown? He uses a 5-minute resolution, always rounding up to the next division of five. This way the first bit will be illuminated on the hour.
A PIC 24F16KA102 microcontroller keeps time using its built-in RTC and a clock crystal. It puts itself into deep sleep mode after displaying the time. The black knob at the bottom is a push-button which resets the chip, waking it up just long enough show the time once again.
[Lior Elazary] designed and built this clock to simulate the function of a CPU. The problem is that if you don’t already have a good grasp of how a CPU works we think this clock will be hopelessly confusing. But lucky for us, we get it, and we love it!
Hour data is shown as a binary number on Register A. This is the center column of red parts and is organized with the MSB on the bottom, the LSB on the top, and left-pointing bits function as digital 1. The clock lacks the complexity necessary for displaying any other time data. But that’s okay, because the sound made by the ball-bearing dropping every minute might drive you a bit loony anyway. [Lior] doesn’t talk about the mechanism that transports that ball bearing, but you can see from the video after the break that a magnet on a circular path picks it up and transports it to the top of the clock where gravity is used to feed the registers. There are two tracks which allow the ball to bypass the A register and enter the B register to the right. This works in conjunction with register C (on the left) to reset the hours when the count is greater than 11.
If you need a kickstart on how these mechanical adders are put together, check out this wooden adder project.
Continue reading “Mechanical CPU clock is just as confusing as its namesake”
[Simon Inns] has put together a lesson in digital logic which shows you how to build your own gates using transistors. The image above is a full-adder that he fabricated, then combined with other full adders to create a 4-bit computer.
Don’t know what a full adder is? That’s exactly what his article is for, and will teach you about binary math and how it is calculated with hardware. There’s probably at least a week’s worth of studying in that one page which has been further distilled into the five-minute video after the break. Although building this hardware yourself is a wonderful way to learn, there’s a lot of room for error. You might consider building these circuits in a simulator program like Atanua, where you can work with logic gate symbols, using virtual buttons and LEDs as the outputs. Once you know what you’re doing with the simulator you’ll have much more confidence to start a physical build like the one [Simon] concocted.
Finding this project a little too advanced? Check out our Beginner Concepts articles to help get you up to speed.
Continue reading “Intermediate Concepts: Building discrete transistor gates”
[Osgeld] built himself a binary clock. He didn’t take the time to explain his project, but he did post beautifully hand-drawn schematics and pictures of the circuit (PDF) as he was building it. We’ve seen clock projects that use mains frequency as the clock source and that’s the route that [Osgeld] chose for his build. He started with a 9-12V AC wall wort as a power input. From there it’s just a matter of using a bridge rectifier to convert to DC, then a 7805 linear regulator to establish a steady 5V rail. A resistor and a couple of diodes allow him to pull the 60 Hz frequency off of the incoming AC, and then use a combination of 4000 and 7400 logic chips to count the pulses and keep track of the time.
This isn’t a hack. But it is a decidedly interesting piece of mechanical technology. The Whiffletree shown above is a way to turn binary data into a mechanical analog value. [Bill Hammack] explains how this assembly is used in a typewriter and how a whiffletree can convert binary data to a set of analog outputs.
These linkages are what makes an IBM Selectrix Typewriter work. You know, the one with the globe stylus instead of individual hammers for each key? [Bill] uses the typewriter as the example in his illustrations that show how each bit of data positions the output in a predictably different location. We’re familiar with other mechanical representations of binary data but converting to an analog value mechanically is a new concept for us. Lukily, the videos that [Bill] put together are fantastic at explaining the concepts. Not surprising, since he is a professor at the University of Illinois at Urbana-Champaign . See them both after the break.
Continue reading “Wiffletree: a mechanical digital to analog converter”
The Clock Clock
This digital display is made from several analog clocks with thick hands. Together they make something of a 7-segment display, which can be used to display the time. It reminds us of the “Shared Time” installation we covered previously. [Thanks Drum365 via Anonimiss Files]
Quickly desolder lots of parts
[Rhys Goodwin] is grabbing parts from junk PCBs but he’s not using a rework station. Instead it’s a hot-air gun and a brisk tap on the bench to send the parts flying. Well, at least he’s not using a blow-torch like [Ben Heck] does.
This bank of 8 toggle switches is the controller for Binary Hero, a geeky take on Guitar Hero. When you see a decimal number come down the screen set your toggle to the binary equivalent in time or the game will be over before you know it. [Thanks Fabien]
Quick fan POV
[GMG] took a small persistence of vision board and slapped onto an oscillating fan blade. Along with a couple of magnets on the safety cage this display is a persistence of vision hack you can pull off in an hour or two.
Speed up laser etching
[James] figured out a way to cut down on the time it takes to etch multiple copies of one item with a laser cutter. It doesn’t run the laser faster, but orients the pieces in a way that means less movement of the head while the laser is not on. Read through his article and see if this method can help you out when doing some CNC work.