Q&A: Hacker, Roboticist, and Website Host

Dean “Dino” Segovis is a self-taught hardware hacker and maker from Pinehurst, NC. In 2011, he developed the Hack A Week website, where he challenges himself to create and post weekly DIY projects. Dino and I recently talked about some of his favorite projects and products. —Nan Price, Associate Editor

 

NAN: You have been posting a weekly project on your website, Hack A Week, for almost three years. Why did you decide to create the website?

Dean "Dino" Segovis at his workbench

Dean “Dino” Segovis at his workbench

DINO: One day on the Hack A Day website I saw a post that caught my attention. It was seeking a person to fill a potential position as a weekly project builder and video blogger. It was offering a salary of $35,000 a year, which was pretty slim considering you had to live in Santa Monica, CA. I thought, “I could do that, but not for $35,000 a year.”

That day I decided I was going to challenge myself to come up with a project and video each week and see if I could do it for at least one year. I came up with a simple domain name, www.hackaweek.com, bought it, and put up a website within 24 h.

My first project was a 555 timer-based project that I posted on April 1, 2011, on my YouTube channel, “Hack A Week TV.” I made it through the first year and just kept going. I currently have more than 3.2 million video views and more than 19,000 subscribers from all over the world.

NAN: Hack A Week features quite a few robotics projects. How are the robots built? Do you have a favorite?

rumblebot head

Dino’s very first toy robot hack was the Rumble robot. The robot featured an Arduino that sent PWM to the on-board H-bridge in the toy to control the motors for tank steering. A single PING))) sensor helped with navigation.

Rumble robot

The Rumble robot

DINO: I usually use an Arduino as the robot’s controller and Roomba gear motors for locomotion. I have built a few others based on existing wheeled motorized toys and I’ve made a few with the Parallax Propeller chip.

My “go-to” sensor is usually the Parallax PING))) ultrasonic sensor. It’s easy to connect and work with and the code is straightforward. I also use bump sensors, which are just simple contact switches, because they mimic the way some insects navigate.

Nature is a great designer and much can be learned from observing it. I like to keep my engineering simple because it’s robust and easy to repair. The more you complicate a design, the more it can do. But it also becomes more likely that something will fail. Failure is not a bad thing if it leads to a better design that overcomes the failure. Good design is a balance of these things. This is why I leave my failures and mistakes in my videos to show how I arrive at the end result through some trial and error.

My favorite robot would be “Photon: The Video and Photo Robot” that I built for the 2013 North Carolina Maker Faire. It’s my masterpiece robot…so far.

NAN: Tell us a little more about Photon. Did you encounter any challenges while developing the robot?

Photon awaits with cameras rolling, ready to go forth and record images.

Photon awaits with cameras rolling, ready to go forth and record images.

DINO: The idea for Photon first came to me in February 2013. I had been playing with the Emic 2 text-to-speech module from Parallax and I thought it would be fun to use it to give a robot speech capability. From there the idea grew to include cameras that would record and stream to the Internet what the robot saw and then give the robot the ability to navigate through the crowd at Maker Faire.

I got a late start on the project and ended up burning the midnight oil to get it finished in time. One of the bigger challenges was in designing a motorized base that would reliably move Photon across a cement floor.

The problem was in dealing with elevation changes on the floor covering. What if Photon encountered a rug or an extension cord?

I wanted to drive it with two gear motors salvaged from a Roomba 4000 vacuum robot to enable tank-style steering. A large round base with a caster at the front and rear worked well, but it would only enable a small change in surface elevation. I ended up using that design and made sure that it stayed away from anything that might get it in trouble.

The next challenge was giving Photon some sensors so it could navigate and stay away from obstacles. I used one PING))) sensor mounted on its head and turned the entire torso into a four-zone bump sensor, as was a ring around the base. The ring pushed on a series of 42 momentary contact switches connected together in four zones. All these sensors were connected to an Arduino running some simple code that turned Photon away from obstacles it encountered. Power was supplied by a motorcycle battery mounted on the base inside the torso.

The head held two video cameras, two smartphones in camera mode, and one GoPro camera. One video camera and the GoPro were recording in HD; the other video camera was recording in time-lapse mode. The two smartphones streamed live video, one via 4G to a Ustream channel and the other via Wi-Fi. The Ustream worked great, but the Wi-Fi failed due to interference.

Photon’s voice came from the Emic 2 connected to another Arduino sending it lines of text to speak. The audio was amplified by a small 0.5-W LM386 amplifier driving a 4” speaker. An array of blue LEDs mounted on the head illuminated with the brightness modulated by the audio signal when Photon spoke. The speech was just a lot of lines of text running in a timed loop.

Photon’s brain includes two Arduinos and an LM386 0.5-W audio amplifier with a sound-to-voltage circuit added to drive the mouth LED array. Photon’s voice comes from a Parallax Emic 2 text-to-speech module.

Photon’s brain includes two Arduinos and an LM386 0.5-W audio amplifier with a sound-to-voltage circuit added to drive the mouth LED array. Photon’s voice comes from a Parallax Emic 2 text-to-speech module.

Connecting all of these things together was very challenging. Each component needed a regulated power supply, which I built using LM317T voltage regulators. The entire current draw with motors running was about 1.5 A. The battery lasted about 1.5 h before needing a recharge. I had an extra battery so I could just swap them out during the quick charge cycle and keep downtime to a minimum.

I finished the robot around 11:00 PM the night before the event. It was a hit! The videos Photon recorded are fascinating to watch. The look of wonder on people’s faces, the kids jumping up to see themselves in the monitors, the smiles, and the interaction are all very interesting.

NAN: Many of your Hack A Week projects include Parallax products. Why Parallax?

DINO: Parallax is a great electronics company that caters to the DIY hobbyist. It has a large knowledge base on its website as well as a great forum with lots of people willing to help and share their projects.

About a year ago Parallax approached me with an offer to supply me with a product in exchange for featuring it in my video projects on Hack A Week. Since I already used and liked the product, it was a perfect offer. I’ll be posting more Parallax-based projects throughout the year and showcasing a few of them on the ELEV-8 quadcopter as a test platform.

NAN: Let’s change topics. You built an Electronic Fuel Injector Tester, which is featured on HomemadeTools.net. Can you explain how the 555 timer chips are used in the tester?

DINO: 555 timers are great! They can be used in so many projects in so many ways. They’re easy to understand and use and require only a minimum of external components to operate and configure.

The 555 can run in two basic modes: monostable and astable.

Dino keeps this fuel injector tester in his tool box at work. He’s a European auto technician by day.

Dino keeps this fuel injector tester in his tool box at work. He’s a European auto technician by day.

An astable circuit produces a square wave. This is a digital waveform with sharp transitions between low (0 V) and high (+ V). The durations of the low and high states may be different. The circuit is called astable because it is not stable in any state: the output is continually changing between “low” and “high.”

A monostable circuit produces a single output pulse when triggered. It is called a monostable because it is stable in just one state: “output low.” The “output high” state is temporary.

The injector tester, which is a monostable circuit, is triggered by pressing the momentary contact switch. The single-output pulse turns on an astable circuit that outputs a square-wave pulse train that is routed to an N-channel MOSFET. The MOSFET turns on and off and outputs 12 V to the injector. A flyback diode protects the MOSFET from the electrical pulse that comes from the injector coil when the power is turned off and the field collapses. It’s a simple circuit that can drive any injector up to 5 A.

This is a homebrew PCB for Dino's fuel injector tester. Two 555s drive a MOSFET that switches the injector.

This is a homebrew PCB for Dino’s fuel injector tester. Two 555s drive a MOSFET that switches the injector.

NAN: You’ve been “DIYing” for quite some time. How and when did your interest begin?

DINO: It all started in 1973 when I was 13 years old. I used to watch a TV show on PBS called ZOOM, which was produced by WGBH in Boston. Each week they had a DIY project they called a “Zoom-Do,” and one week the project was a crystal radio. I ordered the Zoom-Do instruction card and set out to build one. I got everything put together but it didn’t work! I checked and rechecked everything, but it just wouldn’t work.

I later realized why. The instructions said to use a “cat’s whisker,” which I later found out was a thin piece of wire. I used a real cat’s whisker clipped from my cat! Anyway, that project sparked something inside me (pun intended). I was hooked! I started going house to house asking people if they had any broken or unwanted radios and or TVs I could have so I could learn about electronics and I got tons of free stuff to mess with.

My mom and dad were pretty cool about letting me experiment with it all. I was taking apart TV sets, radios, and tape recorders in my room and actually fixing a few of them. I was in love with electronics. I had an intuition for understanding it. I eventually found some ham radio guys who were great mentors and I learned a lot of good basic electronics from them.

NAN: Is there a particular electronics engineer, programmer, or designer who has inspired the work you do today?

DINO: Forrest Mims was a great inspiration in my early 20s. I got a big boost from his “Engineer’s Notebooks.” The simple way he explained things and his use of graph paper to draw circuit designs really made learning about electronics easy and fun. I still use graph paper to draw my schematics during the design phase and for planning when building a prototype on perf board. I’m not interested in any of the software schematic programs because most of my projects are simple and easy to draw. I like my pencil-and-paper approach.

NAN: What was the last electronics-design related product you purchased and what type of project did you use it with?

DINO: An Arduino Uno. I used two of these in the Photon robot.

NAN: What new technologies excite you and why?

DINO: Organic light-emitting diodes (OLEDs). They’ll totally change the way we manufacture and use digital displays.

I envision a day when you can go buy your big-screen TV that you’ll bring home in a cardboard tube, unroll it, and place it on the wall. The processor and power supply will reside on the floor, out of the way, and a single cable will go to the panel. The power consumption will be a fraction of today’s LCD or plasma displays and they’ll be featherweight by comparison. They’ll be used to display advertising on curved surfaces anywhere you like. Cell phone displays will be curved and flexible.

How about a panoramic set of virtual reality goggles or a curved display in a flight simulator? Once the technology gets out of the “early adopter” phase, prices will come down and you’ll own that huge TV for a fraction of what you pay now. One day we might even go to a movie and view it on a super-huge OLED panorama screen.

NAN: Final question. If you had a full year and a good budget to work on any design project you wanted, what would you build?

DINO: There’s a project I’ve wanted to build for some time now: A flight simulator based on the one used in Google Earth. I would use a PC to run the simulator and build a full-on seat-inside enclosure with all the controls you would have in a jet airplane. There are a lot of keyboard shortcuts for a Google flight simulator that could be triggered by switches connected to various controls (e.g., rudder pedals, flaps, landing gear, trim tabs, throttle, etc.). I would use the Arduino Leonardo as the controller for the peripheral switches because it can emulate a USB keyboard. Just program it, plug it into a USB port along with a joystick, build a multi-panel display (or use that OLED display I dream of), and go fly!

Google Earth’s flight simulator also lets you fly over the surface of Mars! Not only would this be fun to build and fly, it would also be a great educational tool. It’s definitely on the Hack A Week project list!

Editor’s Note: This article also appears in the Circuit Cellar’s upcoming March issue, which focuses on robotics. The March issue will soon be available for membership download or single-issue purchase.

 

An Organized Space for Programming, Writing, and Soldering

AndersonPhoto1

Photo 1—This is Anderson’s desk when he is not working on any project. “I store all my ‘gear’ in a big plastic bin with several smaller bins inside, which keeps the mess down. I have a few other smaller storage bins as well hidden here and there,” Anderson explained.

AndersonPhoto2

Photo 2—Here is Anderson’s area set up for soldering and running his oscilloscope. “I use a soldering mat to protect my desk surface,” he says. “The biggest issue I have is the power cords from different things getting in my way.”

Al Anderson’s den is the location for a variety of ongoing projects—from programming to writing to soldering. He uses several plastic bins to keep his equipment neatly organized.

Anderson is the IT Director for Salish Kootenai College, a small tribal college based in Pablo, MT. He described some of his workspace features via e-mail:

I work on many different projects. Lately I have been doing more programming. I am getting ready to write a book on the Xojo development system.

Another project I have in the works is using a Raspberry Pi to control my hot tub. The hot tub is about 20 years old, and I want to have better control over what it is doing. Plus I want it to have several features. One feature is a wireless interface that would be accessible from inside the house. The other is a web control of the hot tub so I can turn it on when we are still driving back from skiing to soak my tired old bones.

I am also working on a home yard sprinkler system. I laid some of the pipe last fall and have been working on and off with the controller. This spring I will put in the sprinkler heads and rest of the pipe. I tend to like working with small controllers (e.g., the Raspberry Pi, BeagleBoard’s BeagleBone, and Arduino) and I have a lot of those boards in various states.

Anderson’s article about a Raspberry Pi-based monitoring device will appear in Circuit Cellar’s April issue. You can follow him on Twitter at @skcalanderson.

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)

Arduino MOSFET-Based Power Switch

Circuit Cellar columnist Ed Nisley has used Arduino SBCs in many projects over the years. He has found them perfect for one-off designs and prototypes, since the board’s all-in-one layout includes a micrcontroller with USB connectivity, simple connectors, and a power regulator.

But the standard Arduino presents some design limitations.

“The on-board regulator can be either a blessing or a curse, depending on the application. Although the board will run from an unregulated supply and you can power additional circuitry from the regulator, the minute PCB heatsink drastically limits the available current,” Nisley says. “Worse, putting the microcontroller into one of its sleep modes doesn’t shut off the rest of the Arduino PCB or your added circuits, so a standard Arduino board isn’t suitable for battery-powered applications.”

In Circuit Cellar’s January issue, Nisley presents a MOSFET-based power switch that addresses such concerns. He also refers to one of his own projects where it would be helpful.

“The low-resistance Hall effect current sensor that I described in my November 2013 column should be useful in a bright bicycle taillight, but only if there’s a way to turn everything off after the ride without flipping a mechanical switch…,” Nisley says. “Of course, I could build a custom microcontroller circuit, but it’s much easier to drop an Arduino Pro Mini board atop the more interesting analog circuitry.”

Nisley’s January article describes “a simple MOSFET-based power switch that turns on with a push button and turns off under program control: the Arduino can shut itself off and reduce the battery drain to nearly zero.”

Readers should find the article’s information and circuitry design helpful in other applications requiring automatic shutoff, “even if they’re not running from battery power,” Nisley says.

Figure 1: This SPICE simulation models a power p-MOSFET with a logic-level gate controlling the current from the battery to C1 and R2, which simulate a 500-mA load that is far below Q2’s rating. S1, a voltage-controlled switch, mimics an ordinary push button. Q1 isolates the Arduino digital output pin from the raw battery voltage.

Figure 1: This SPICE simulation models a power p-MOSFET with a logic-level gate controlling the current from the battery to C1 and R2, which simulate a 500-mA load that is far below Q2’s rating. S1, a voltage-controlled switch, mimics an ordinary push button. Q1 isolates the Arduino digital output pin from the raw battery voltage.

The article takes readers from SPICE modeling of the circuitry (see Figure 1) through developing a schematic and building a hardware prototype.

“The PCB in Photo 1 combines the p-MOSFET power switch from Figure 2 with a Hall effect current sensor, a pair of PWM-controlled n-MOFSETs, and an Arduino Pro Mini into

The power switch components occupy the upper left corner of the PCB, with the Hall effect current sensor near the middle and the Arduino Pro Mini board to the upper right. The 3-D printed red frame stiffens the circuit board during construction.

Photo 1: The power switch components occupy the upper left corner of the PCB, with the Hall effect current sensor near the middle and the Arduino Pro Mini board to the upper right. The 3-D printed red frame stiffens the circuit board during construction.

a brassboard layout,” Nisley says. “It’s one step beyond the breadboard hairball I showed in my article “Low-Loss Hall Effect Current Sensing” (Circuit Cellar 280, 2013), and will help verify that all the components operate properly on a real circuit board with a good layout.”

For much more detail about the verification process, PCB design, Arduino interface, and more, download the January issue.

The actual circuit schematic includes the same parts as the SPICE schematic, plus the assortment of connectors and jumpers required to actually build the PCB shown in Photo 1.

Figure 2: The actual circuit schematic includes the same parts as the SPICE schematic, as well as the assortment of connectors and jumpers required to actually build the PCB shown in Photo 1.

Open-Source Guide for Embedded Systems Developers (EE Tip #114)

What comes to mind when you hear the term “open source”? Hopefully, it means more to you than just a software application running on a PC.

As an embedded systems developer, you should familiarize yourself with the wide range of open-source programs, programming tools, and hardware platforms currently available. In addition to saving yourself the costs of pricey user licenses, you’ll find that open-source community forums helpful, informative, and engaging.

Open-source software offers a number of advantages. The product is independent of a particular manufacturer and there aren’t license costs. Plus, the product is usually high quality because it is often supported by a large active community of users. When a program’s source code is available, you have the chance to fix errors, change its behavior, and even add new features.

The aforementioned advantages should be good enough reasons for any designer of microcontroller applications to work with open-source software. PC tools such as editors, documentation programs, toolchains (for the vast majority of microcontrollers), operating systems, and libraries are widely available with open-source code.

On the hardware side, open-source microcontroller boards are gaining popularity among serious engineers. The circuits, PCBs, and CAD files are available so you can modify them, improve them, and add more features to meet the demands of your applications. It’s an added benefit that open-source hardware is always supported by software code and libraries that enable you to get up and running fairly quickly.

Since we couldn’t include in the space provided all the open-source resources currently available, we simply list several open-source projects that Elektor and Circuit Cellar engineers and editors recommend.

Below we provide the following lists: hardware; libraries and run-time tools; PC tools, and GNU toolchains. By no means are the lists complete. Still, they’re helpful starting points.

Download your Arduino Uno poster

Click image to download a free Arduino Uno poster

Arduino—This popular platform offers a range of simple microcontroller and development boards that you can purchase from several suppliers. The Arduino website has an active forum and the wide range of software examples will ensure that you are up and running in minimum time.

Openmoko—It’s a complete software stack for a smart. The Neo FreeRunner mobile phone is the target hardware platform. Development and debug boards are also available.

GNU Radio & Universal Software Radio Peripheral—The GNU Radio project is a software toolkit to produce a software-defined radio. The open-source hardware for this project is the Universal Software Radio Peripheral (USRPBoard), which is based on an FPGA.

KiCAD—One of the best-known suites of CAD programs for hardware production, KiCAD includes tools for generating circuit diagrams and PCBs. You can view 3-D representations of the finished board.

Fab Lab—This interesting project offers 3-D laser cutters, 3-D printers, and other machines for use by the general public. It’s a handy resource for making robot parts and art objects.

uIP/lwIP—Two outstanding network stacks, the first is for 8-bit microcontrollers. lwIP is a development of the first and more suited to medium sized controllers. The uIP licence is not so strict allowing the stack to be used in commercial products.

LUFA (formally MyUSB)—A large library of applications for interfacing (both Host and Device) USB enabled AVR controllers. The demonstration applications allow an AVR controller for example to emulate a keyboard and many other devices (mass storage device, audio I/O etc.)OpenSource2

Crypto-avr-lib—It’s a library of optimized cryptographic routines for the Atmel ATmega controller. Issued under the GPL Version 3 licence. Contact the author for other types of licence.

FreeRTOS—FreeRTOS is a lightweight Real Time kernel which can run on many controller families. It can be used in commercial applications and allows the use of closed-source software.

U-Boot—Universal bootloader with a large range of routines for memory, UART interface, SD card, network and USB etc. Conceived originally as a bootloader but now through comprehensive hardware support can be used as the basis of a C code module.

Embedded Filesystems Library—A useful (FAT) file format, when you are short of memory. The GPL licence includes a clause allowing static linking to the library without public disclosure of your code.

.NET Micro Framework—Now open source this very compact, trimmed down .NET Framework running on diverse ARM platforms. Programmable using the object orientated C variant C#; lots of resources including support for I2C, Ethernet and many more. Helps reduce development time.

Eclipse—This is a good development environment. It has a modular structure which makes it very easy to configure. There are around 1,000 plug-in modules (both open source and commercial) for a range of program languages and target systems.

Kdevelop—Kdevelop is an integrated development environment which should satisfy most power-user needs. Runs in MS Windows, Mac OsX, Linux, Solaris and FreeBSD. Plug-in expandable.

Programmer’s Notepad—A lightweight but efficient editor for writing source code. Allows fast, simple and comfortable program production. Can be expanded with plug-ins.

Doxygen—An intelligent tool which can automatically generate code documentation (C, C++, Java etc.). The programmer provides tags in the source file; Doxygen generates the comprehensive documentation in PDF or HTML format. It can also extract the code structure from undocumented source files.

WinMerge—A good tool for code comparison and code synchronization. The program can also compare the contents of folders/files and display the results in a visual text format that makes it easy to understand.

Tera Term—A terminal program to access COM ports, supports Telnet communication Protocol. A debugging tool to eavesdrop on serial communications.

Note: Toolchains for GNU projects are available most processor architectures AVR, Coldfire, ARM, MIPS, PowerPC and Intel x86. The GNU-toolchain includes not only compilers for C, C++ and in most cases also Java (GCC = GNU Compiler Collection), but also Linkers, Assemblers and Debuggers together with C libraries (libc = C library). The tools are used from within other-open source projects, like WinAVR, which provides a familiar user interface to speed up program development.