Posts with «arduino hacks» label

Z80 Computer Is Both Arduino And Shield

There have been plenty of Z80 computer builds here on Hackaday, but what sets them apart is what you do with them. [Andrew] writes in with his Z80 single-board computer made from scratch, using the Arduino standard headers for its I/O. In turn, since he needed an easy way to program the flash memory which holds the software to run on the Z80, he used an Arduino Mega as a debugger, making the SBC an Arduino shield itself.

Using such a common header pinout for the Z80 computer allows it to be used with a variety of readily-available Arduino shields. This compatibility is achieved with an analog-digital converter and a 3.3 V regulator, mimicking the pins found in an Arduino Uno. The code, available on GitHub, includes an extensive explanation and walkthrough over the process in which the Mega takes over the bus from the Z80 to function as a fully-featured debugger. Programs can be loaded through embedding an assembly listing into the Mega’s sketch, or, once the debugger is up you can also upload a compiled hex file through the serial connection.

This isn’t the first time [Andrew] has been featured here, and his past projects are just as interesting. If you need to translate a Soviet-era calculator’s buttons into English, hack a metallurgical microscope or even investigate what’s that Clacking Clanking Scraping Sound, he’s the one you should call.

Giant Clock Made In the Nick of Time

When [tnjyoung] was asked to build a huge lighted clock for a high school theater’s production of Cinderella with only two weeks before opening night, he probably wished for a fairy godmother of his own to show up and do it for him. But he and his team pulled it off, and it looks amazing. That medallion in the middle? It was laid out painstakingly by hand, using electrical tape.

This thing is 12 feet wide and weighs more than 500 pounds. Even so, it isn’t a permanent set piece, so it has to move up and down throughout the show on airplane cables. Now for the minutiae: there’s an Arduino Uno with built-in Wi-Fi that receives UDP commands from a phone to raise and lower the clock at the appropriate times. The ‘duino is also controlling two stepper motors, one for the hour hand and one for the minute hand.

Time is almost a minor character in the story of Cinderella, since she has to get back by midnight. Because of this, [tnjyoung] programmed a dozen or so time cues that move the steppers at various speeds to achieve different effects, like time flying by as she dances the night away with the Prince. Hour you still just sitting there? Sweep past the break to watch the build process fly by in a matter of minutes.

Got all the time in the world? Make a clock out of clocks. Clocks all the way down.

Casual Tetris Comes In At $9

[Michael Pick] calls himself the casual engineer, though we don’t know whether he is referring to his work clothes or his laid back attitude. However, he does like to show quick and easy projects. His latest? A little portable Tetris game for $9 worth of parts. There is an Arduino Pro Mini and a tiny display along with a few switches and things on a prototyping PC board. [Michael] claims it is a one day build, and we imagine it wouldn’t even be that much.

Our only complaint is that there isn’t a clear bill of material or the code. However, we think you could figure out the parts pretty easy and there are bound to be plenty of games including Tetris that you could adapt to the hardware.

The display looks suspiciously like an SSD1306 display which is commonly cloned. so that answers one question. These are just less than an inch of screen, but if you buy them from China that eats up almost half of the $9 budget. The Arduino is probably another $3. The other parts are cheap, but it is easy to imagine you might exceed $9 by a bit if you try to duplicate this.

Just from looking at the video, the code looks a lot like Tiny Tetris by [AJRussel], though there are a few others out there if you look. The rest should be pretty easy to puzzle out. Maybe [Michael] will add a link to the code, a bill of materials, and some specific wiring instructions.

Of course, if you just want Tetris, grab your transistor tester. We’ve even seen smaller versions of Tetris given away as business cards.

Hack a Day 29 Feb 06:00

Writing Arduino Libraries, An Expert View

The Arduino IDE has a bit of a split personality. On the one hand, it is a simple environment where you can just pick and choose a few libraries, write a few lines of code, and make lots of interesting things. On the other hand, it is also an ecosystem in which many different boards and libraries can be supported. Writing a great library that everyone can easily use takes a little forethought. There is an official style guide, but a recent post by [Nate] from Sparkfun points out lessons learned from writing more libraries than most people.

Of course, as you might expect, some of this is a matter of opinion, and [Nate] admits that. For example, they always use the serial port at 115,200 baud, but they do note that 9,600 baud is also popular. They also suggest making code as readable as possible, which is usually good advice. In the old days, writing terse code might lead to higher efficiency, but with modern compilers, you ought to get a tight final result even when doing things in a pretty verbose fashion.

However, a lot of the advice is very subtle but important. For example, the use of default parameters and the order of parameters. If you add their advice to the official style guide, you should be well on your way to creating really great Arduino libraries.

Of course, you also need a great idea for a library or an improved library that doesn’t already exist. That may be your most difficult task. Sometimes it makes sense to port something over instead of starting from scratch.

MIL-SPEC Keyboard Now Salutes USB

When [easyjo] picked up this late ’80s Marconi mil-spec keyboard for cheap, he knew it wouldn’t be easy to convert it to USB — just that it would be worth it. Spoiler alert: those LEDs aren’t a mod, they’re native. They get their interesting shape from the key traces, which are in the four corners.

Despite having way-cool buttons such as WPNS HOLD, and the fact that Control is on the home row where it belongs, this keyboard does not look fun to type on at all for any length of time. Of course, the point of this keyboard is not comfort, but a reliable input device that keeps out dust, sweat, liquids, and the enemy.

This is probably why the controller is embedded into the underside of the key switch PCB instead of living on its own board.  [easyjo] tried to analyze the signals from the existing 26-pin connector, but it didn’t work out.

So once he was able to decode the matrix, he removed the controller chip and wired the rows and columns directly to an Arduino Leonardo. Fortunately, the LEDs were just a matter of powering their columns from the front side of the board.

The availability of certain kinds of military surplus can make for really interesting modernization projects, like adding POTS to a field telephone.

Via r/duino

Self-Playing Kalimba V2 Thanks to Readers Like You

Would you like to know the great thing about this community we have here? All the spitballing that goes on every day in the comments, the IO chat rooms, and in the discussion threads of thousands of projects. One of our favorite things about the Hackaday universe is that we help each other out, and because of that, our collective curiosity pushes so many designs forward.

[Gurpreet] knows what we’re talking about. He’s back with version two of his self-playing kalimba, driven as strongly as ever by the dulcet tones of the Avatar theme. Now the robo-kalimba is rocking two full octaves, and thanks to your comments and suggestions, has relocated the servos where they can’t be picked up by the soundboard.

We gasped when we saw the new mechanism — a total of 15 rack and pinion linear actuators that make the kalimba look like a tiny mechanical pipe organ. Now the servos float, fixed into a three-part frame that straddles the sound box. [Gurpreet] melted servo horns to down to their hubs rather than trying to print something that fits the servos’ sockets.

Thumb your way past the break to check out the build video. [Gurpreet] doesn’t shy away from showing what went wrong and how he fixed it, or from sharing the 3D printering sanity checks along the way that kept him going.

Plucking kalimba tines is a difficult problem to solve because they’re stiff, but with timbre sensitive to many degrees of pressure. A slightly easier alternative? Make a toy player piano.

Levitating Starship Model Comes In For a Landing

If everything goes according to plan, Elon Musk says the first generation of SpaceX’s massive Starship will make an orbital flight before the end of 2020. That’s a pretty bold claim, but when you’ve made landing rockets on their tails as in the old science fiction pulp magazines seem routine, we suppose you’ve earned the right to a bit of bravado. We’re excited to see the vehicle evolve over the next several months, but even if the real one stays grounded, we’ll gladly take this “flying” Starship model from [Chris Chimienti] as a consolation prize.

A magnetic levitation module, we’re officially in the future.

Feeling a bit let down by the 3D printable models of the Starship he found online, [Chris] set out to build his own. But it wasn’t enough to just make his bigger, stronger, and more accurate to Starship’s current design; he also wanted to make it a bit more exciting. Some RGB LEDs an Arduino embedded in the “cloud” stand the rocket sits on was a good start, and the landing pad inspired by SpaceX’s real autonomous spaceport drone ship Just Read the Instructions looks great all lit up.

But this is Starship we’re talking about, a vehicle that could literally push humanity towards being a multi-planet species. To do it justice, you’ve really got to knock it out of the park. So [Chris] found a magnetic levitation module online that could support a few hundred grams, and set to work on making his plastic Starship actually hover over the landing pad.

As you might imagine, it was a bit tricky. The first versions of the rocket looked great but came out too heavy, so he switched over to printing the model in so-called “spiral vase mode” which made it entirely hollow. Now far lighter and with a magnetic plate fit into the bottom, it was stable enough to float on its own. For the final touch, [Chris] added some red LEDs and a coin cell battery to the base of the Starship so it looks like the sleek craft is performing a last-second landing burn with its “impossible” full-flow staged combustion engines.

This isn’t the first time we’ve seen a model rocket with an electronic glowing cloud under it, but it’s certainly the first one we’ve seen that could levitate in mid-air. While this little rocket might not make it all the way to Mars, we wouldn’t be surprised to see it touching down on the desks of other hackers and makers in the near future.

Espresso Machine Now Powers Plants

This thing has what plants crave! No, not electrolytes exactly — just water, light, and moisture polling every 30 minutes. We think it’s fitting to take something that once manufactured liquid liveliness for humans and turn it into a smart garden that does the same thing for plants.

So let’s just get this out of the way: the espresso machine was abandoned because it was leaking water from a gasket. [The Plant Bot] cleaned it up, replaced the gasket, and got it brewing, and then it started leaking hot water again from the same gasket. We might have gone Office Space on this beautiful machine at that point, but not [The Plant Bot].

Down in the dirt, there’s a soil moisture sensor that’s polling every 30 minutes. If the moisture level falls below the threshold set appropriately at a life-sustaining 42%, the Arduino is triggered to water the plant through a relay board using the espresso machine’s original pump. If the plant is dry, the machine will pump water for two seconds every minute until the threshold is met. [The Plant Bot] tied it all together with a nice web interface that shows plant data and allows for changes over Bluetooth.

[The Plant Bot] started by disconnecting the heating element, because plants don’t tend to like hot steam. But if the cup warming tray along the top has a separate heating element, it might be neat to reuse it for something like growing mushrooms, or maintaining a sourdough starter if the temperature is right.

Via r/duino

Nixie Clock Claims to be Simplest Design

[Engineer2you] built a nixie tube clock and claims it is the simplest design. We felt like that was a challenge. In this design, the tubes are set up as a matrix with optoisolators on each row and column. With 60 segments, the matrix allows you to control it all with 16 bits. There are six columns, each corresponding to a digit. That means each row has 10 lines.

The Arduino code reads the clock and produces the output to the tubes fast enough that your eye perceives each digit as being always on, even though it isn’t.

It may be semantics, but part of what makes the design simple isn’t that it is simple on its own, but that it does use a small number of dense modules. For example, the clock is a DS3231, and there is a DC step up board to generate 390V for the tubes. So instead of minimizing part count, this design really minimizes how many parts you have to connect by employing modules, including the Arduino. That’s still something, though.

It looks as though the nixie tubes used are of Soviet origin. They need no more than 170V to ignite and at least 120V to stay lit. Not a problem with a simple DC to DC converter since the current is very low — on the order of 2.5 mA or so.

We suppose one day the stock of nixie tubes will be gone. But there are still people making them. Or you can do a modern version with light pipes.

Hack a Day 15 Feb 06:00

Arduino Drives a 600-Character Display

[Peterthinks] admits he’s no cabinet maker, so his projects use a lot of hot glue. He also admits he’s no video editor. However, his latest video uses some a MAX7219 to create a 600 character scrolling LED sign. You can see a video of the thing, below. Spoiler alert: not all characters are visible at once.

The heart of the project is a MAX7219 4-in-1 LED display that costs well under $10. The board has four LED arrays resulting in a display of 8×32 LEDs. The MAX7219 takes a 16-bit data word over a 10 MHz serial bus, so programming is pretty easy.

The MAX chip can decode for seven-segment displays or just allow you to light up the outputs directly, which is what the code here does. You can cascade the chips, so it is possible to string more than one of these modules together.

The code is available on Dropbox. The code is extremely simple due to the use of the Parola library and a MAX72XX library. We’ve seen a number of projects based around this chip. Some of the uses are pretty novel.