Arduino-Based Lathe Tachometer

Want an electronic tachometer to display the RPM of a lathe or milling machine? If so, Elektor has the project for you.

The electronics tachometer design features an Arduino micro board and  a 0.96″ OLED display from Adafruit for instantaneous readout. The compact instrument also has a clock displaying the equipment running time.

Navy Engineer’s Innovation Space

When electrical engineer Bill Porter isn’t working on unmanned systems projects for the Navy, he spends a great deal of engineering time at his workspace in Panama City Beach, FL. Bill submitted the interesting images that follow (along with several others) for an interview we plan to run an upcoming issue of Circuit Cellar magazine. Once we saw his workspace images, we knew we had to feature it on our site as soon as possible.

The workspace of a true innovator (Source: Bill Porter)

The workspace of a true innovator (Source: Bill Porter)

Check out Bill working on a project. He told us: “I am a hardware guy. I love to fire up my favorite PCB CAD software just to get an idea out of my head and on the screen.”

Bill is self-proclaimed "hardware guy"

Bill is self-proclaimed “hardware guy” (Source: Bill Porter)

Interesting the sorts of things Bill designs? Check out his wedding-related projects.

Pretty unique proposal, right? (Source: Bill Porter)

Pretty unique proposal, right? (Source: Bill Porter)

This is just one of the many electrical engineering-related items developed for his wedding (Source: Bill Porter)

This is just one of the many electrical engineering-related items developed for his wedding (Source: Bill Porter)

You’ll be able to learn more about his innovations in a future issue of Circuit Cellar magazine.

Share your space! Circuit Cellar is interested in finding as many workspaces as possible and sharing them with the world. Email our editors to submit photos and information about your workspace. Write “workspace” in the subject line of the email, and include info such as where you’re located (city, country), the projects you build in your space, your tech interests, your occupation, and more. If you have an interesting space, we might feature it on CircuitCellar.com!

One-Wire RS-232 Half Duplex (EE Tip #135)

Traditional RS-232 communication needs one transmit line (TXD or TX), one receive line (RXD or RX), and a Ground return line. The setup allows a full-duplex communication. However, many applications use only half-duplex transmissions, as protocols often rely on a transmit/acknowledge scheme. With a simple circuit like Figure 1, this is achieved using only two wires (including Ground). This circuit is designed to work with a “real” RS-232 interface (i.e., using positive voltage for logic 0s and negative voltage for logic 1s), but by reversing the diodes it also works on TTL-based serial interfaces often used in microcontroller designs (where 0 V = logic 0; 5 V = logic 1). The circuit needs no additional voltage supply, no external power, and no auxiliary voltages from other RS-232 pins (RTS/CTS or DTR/DSR).Grun1-Wire-RS232-HalfDup

Although not obvious at a first glance, the diodes and resistors form a logic AND gate equivalent to the one in Figure 2 with the output connected to both receiver inputs. The default (idle) output is logic 1 (negative voltage) so the gate’s output follows the level of the active transmitter. The idle transmitter also provides the negative auxiliary voltage –U in Figure 2. Because both receivers are connected to one line, this circuit generates a local echo of the transmitted characters into the sender’s receiver section. If this is not acceptable, a more complex circuit like the one shown in Figure 3 is needed (only one side shown). This circuit needs no additional voltage supply either. In this circuit the transmitter pulls its associated receiver to logic 1 (i.e., negative voltage) by a transistor (any standard NPN type) when actively sending a logic 0 (i.e., positive voltage) but keeps the receiver “open” for the other transmitter when idle (logic 1). Here a negative auxiliary voltage is necessary which is generated by D2 and C1. Due to the start bit of serial transmissions, the transmission line is at logic 1 for at least one bit period per character. The output impedance of most common RS-232 drivers is sufficient to keep the voltage at C1 at the necessary level.

Note: Some RS-232 converters have quite low input impedance; the values shown for the resistors should work in the majority of cases, but adjustments may be necessary. In case of extremely low input impedance, the receiving input of the sender may show large voltage variations between 1s and 0s. As long as the voltage is below –3 V at any time these variations may be ignore.— Andreas Grün, “One Wire RS-232 Half Duplex,” Elektor July/August 2009.

DIY Single-Board Computer (EE Tip #131)

In the early 1990s, nostalgic users wrote software emulators to relive the “vintage” experience of their old Commodore 64 or Apple II. Others preferred the actual hardware and began collecting classic computers. As their old machines occasionally broke down, people began cultivating the art of computer diagnosis and repair into a new form of retrocomputing.

RETROCOMPUTING
Next to software emulation and hardware maintenance, a third strain of retrocomputing has emerged: designing and building your own system from a “bag of chips” and a circuit board. It is easy to create a functional computer on a little circuit board—considering all the information now available on the Internet. These retro machines may not have much practical use, but the learning experience can be tremendously valuable (see Photo 1).

Photo 1—Here is a homebrew N8VEM system with a single-board computer (SBC) and disk/IDE card plugged into the ECB backplane. The ECB card on the far right is a bus monitor, which adds classic “blinkenlights” to the system. In front is a vintage-style hex keyboard/monitor. (Photo courtesy of Nik Brisevac, The N8VEM Home Brew Computer Project)

Photo 1—Here is a homebrew N8VEM system with a single-board computer (SBC) and disk/IDE card plugged into the ECB backplane. The ECB card on the far right is a bus monitor, which adds classic “blinkenlights” to the system. In front is a vintage-style hex keyboard/monitor. (Photo courtesy of Nik Brisevac, The N8VEM Home Brew Computer Project)

Hobbyists with no background in electronics somehow pick up the required skills, and they often share their homebrewing experiences online. Although some of their creations are stunningly exotic, most people build simple machines. They use a CPU and add RAM, ROM, a serial port, and maybe an IDE interface for mass storage. And most hobbyists run either BASIC (e.g., the 1980s home computers) or use a “vintage” OS such as CP/M.

Running CP/M, in fact, is a nice target to work toward. A lot of good software ensures your homebrew computer can do something interesting once it is built. As the predecessor of MS-DOS, CP/M also provides a familiar command-line interface. And it is simple. A few days of study are enough to port it to your circuit board.

Still, one challenge remains: If you want homebrewing to be an enduring hobby instead of a one-off project, you should have some perspective beyond putting together a minimal computer and switching it on. Working on your own, it can become progressively more difficult to take the next steps (i.e., building graphics subsystems or using exotic processors) or to add state-of-the-art microcontrollers to create “Frankenstein” systems (i.e., blends of old and new technology that can do something useful, such as automate your home).

This is where the N8VEM Google group comes in. In 2006, Andrew Lynch published his own single-board CP/M design to engage and involve others. He intended the N8VEM (named after his ham radio license) to be expandable with add-on cards. Soon after, an informal collaborative effort emerged around a Google mail group. A website was set up to share the hardware and software produced.

Builders with a range of skills became involved, from well-known systems builders to beginners. They bought Lynch’s $20 circuit board and ordered the required electronic components and a soldering iron from an online electronics distributor. After two days of wielding the soldering iron, they could create a CP/M computer that uses ROM and RAM disks for storage and has plenty of built-in vintage software.

The design can be expanded into a “powerful” (we use the term lightly here) multiprocessor system with “blinkenlights,” hard disks, graphics subsystems, and various OSes. People also started to build miniaturized variants, PC/XT clones, and 32-bit machines.

However, N8VEM is not about soldering kits. It is about joining in, trying new things, and picking up skills along the way. These skills range from reading schematics to debugging a computer card that does not operate as intended. The learning curve may be steep at times, but, because the N8VEM mail group is very active, expert help is available if or when you get stuck.

There is nothing preventing you from plugging in your own CPU board design. But if you do, you’re not forced to develop all the other expansion boards on your own.

As the novelty of designing a simple single-board computer (SBC) wears off, you may prefer to focus your energy on exploring graphics systems or ways to hook up 8-bit machines on the Internet. Or, you may want to jump into systems software development and share your experiences with a few hundred others. Retrocomputing is not always backward-facing. Making “Frankenstein” systems by adding modern Parallax Propeller chips or FPGAs to old hardware is a nice way to gain experience in modern digital electronics, too.

Photo 2—This is the N8VEM in its $20 stand-alone incarnation. Even without any other boards, this SBC provides sufficient I/O and storage options to be a full-fledged CP/M computer.

Photo 2—This is the N8VEM in its $20 stand-alone incarnation. Even without any other boards, this SBC provides sufficient I/O and storage options to be a full-fledged CP/M computer.

THE N8VEM SBC
At 10-cm × 16-cm (roughly 4” × 6”), the N8VEM computer does not look particularly impressive (see Photo 2). However, it provides all the capabilities of an early 1980s commercial microcomputer. In fact, thanks to CP/M, it is software-compatible with those microcomputers, offering a range of good programming languages (e.g., BASIC, C, Pascal, and Assembler). Excellent editors (e.g., ZDE) and word processors (e.g., WordStar) are also available. You could also run simple spreadsheets, databases and interactive games (e.g., Zork).

The small-sized N8VEM makes one concession to modern-day electronics: It uses a single, high-capacity RAM chip. All the other electronics are components that would have been used “back in the day” (e.g., simple 74LS logic chips, a Z80 microprocessor, and classic interface chips). A battery backs up the N8VEM’s memory; therefore, the RAM disk is a practical storage mechanism, especially because a ROM disk comes with most essential software installed. Use the N8VEM with a serial terminal, or (more likely) with a PC terminal program. The XMODEM protocol enables files to be transferred to and from the N8VEM.

GETTING STARTED: BOOKS AND TOOLS
Homebrewing is straightforward once you figure out how to do things. That is why homebrewing as a group is so practical. Still, two pieces of background information will prove indispensable for any builder: an understanding of basic computer hardware and Assembly language. Reading up on these topics will not only make things easier, but will also help you understand what you are putting together. (See the Resources section at the end of this article for helpful information.)

Only a few tools are necessary. Although, for many, building an electronics lab is part of the fun. A good soldering iron, an inexpensive “solder sucker” to correct mistakes, and a multi-meter are absolute requirements. A secondhand oscilloscope is a useful additional tool. A logic analyzer can also be a big help by enabling you to simultaneously inspect multiple signals and determine what is wrong. Old logic probes are expensive and cumbersome. New designs (e.g., Saleae’s Logic 8-channel USB logic analyzer) are inexpensive and better.

At some point you will need an EPROM programmer, unless you want to depend on others to burn EPROMs for you. Ensure you have a programmer that can deal with a range of (E)EPROMs, as N8VEM boards use many types. Finally, a laboratory power supply is a wise investment, mostly because it has a current limiter that cuts power when a short circuit could otherwise blow up your board.

Editor’s Note: This is an excerpt from an article written by Oscar Vermeulen and Andrew Lynch, “DIY Single-Board Computers (Part 1): Design and Expansion Options,”
Circuit Cellar 276, 2013.

Arduino-Based DIY Voltage Booster (EE Tip #117)

If your project needs a higher voltage rail than is already available in the circuit, you can use an off-the-shelf step-up device. But when you want a variable output voltage, it’s less easy to find a ready-made IC. However, it’s not complicated to build such a circuit yourself, especially if you have a microcontroller board that’s as easy to program as an Arduino. And this also lets you experiment with the circuit so you can get a better understanding of how it works.

Source: Elektor, April 2010

Source: Elektor, April 2010

No surprises in the circuit—a largely conventional boost converter. The MOSFET is driven by a pulse width modulated (PWM) signal from the microcontroller, and the output voltage is measured by one of the microcontroller’s analog inputs. The driver adjusts the PWM signal according to the difference between the output voltage measured and the voltage wanted.

We don’t have enough space here to go into details about how this circuit works, but it’s worth mentioning a few points of special interest.

The small capacitor across the diode improves the efficiency of the circuit. The load is represented by R3. The components used make it possible to supply over 1 A (current limited by the MSS1260T 683MLB inductor from Coilcraft), but maximum efficiency (89%) is at around 95 mA (at an output voltage of 10 V). To avoid damaging the controller’s analog input (≤5 V), the output voltage may not exceed 24 V. For higher voltages, the values of resistors R1 and R2 would need to be changed.

The MOSFET is driven by the microcontroller, which is nothing but a little Arduino board. The Arduino’s default PWM signal frequency is around 500 Hz—too low for this application, which needs a frequency at least 100 times higher. So we can’t use the PWM functions offered by Arduino. But that’s no problem, as the Arduino can also be programmed in assembler, allowing a maximum frequency of 62.5 kHz (the microcontroller runs at 16 MHz). To sample the output voltage, a frequency of 100 Hz is acceptable, which means we can use Arduino’s standard timers and analog functions. The Arduino serial port is very handy: we can use it for sending the output voltage set point (5–24 V) and for collecting certain information about the operation. Thanks to the Arduino environment, it only took about half an hour to program. Software is available. — Clemens Valens (Elektor, April 2010)