Simple but Sweet User Interface Solutions from the Maker World

By European Editors

Contributed By DigiKey's European Editors

Small computer boards like the Arduino family are more than simply a valued educational vehicle. The ecosystem has been adopted enthusiastically by professional engineers to solve numerous sense-and-control challenges. These may range from simple connected sensors to controlling motors or actuators in machinery or simple robots.  The combination of an Arduino microcontroller board and I/O or motor-drive shield could satisfy a project’s motion control needs. The open-source nature of an ecosystem like Arduino means there are many projects published online that can provide a launch pad for a customized application. There are numerous sources of pre-written code on manufacturer sites or the independent GitHub. Figure 1 is an excerpt of code for controlling an Arduino-based robot from GitHub.

Image of code for open-source projects

Figure 1: Developer communities provide a platform to find and share code for open-source projects.

User interface choices

At the other end of the connection, a user interface is needed. Equipment such as a robotic arm or a motorized probe may need little more than a set of controls for basic movements like forward/back, left/right, or clockwise/counter-clockwise rotation.

Smartphone app?

One solution is to use a smartphone as the main user interface controller. This has been widely adopted where consumers need to interact with smart “things” such as domestic heating or lighting systems, security devices or drones. The smartphone has many strengths, including its high resolution color display for presenting attractive instruments, sophisticated multi-touch capability, and versatile connectivity encompassing cellular, Wi-Fi® and Bluetooth®. They are ubiquitous, and can be easily turned into a suitable controller simply by loading an app designed to accompany the new product.

For some projects, however, developing a custom app may be costly, time consuming, and outside the core skillset of the development team.

Several Android apps are available through the Google Play store for controlling Arduino-based robots via Bluetooth using a smartphone. These give developers a selection of downloadable, ready-made user interfaces, available free of charge or at low cost. However, the apps are often conceived for radio controlled toys, and the look and feel may not be ideal for the end application. On the other hand, some (such as Arduino BT Joystick) present plain graphics that can give a professional appearance, or (like RemoteXY) give freedom to configure the knobs, buttons and sliders individually.

Developing with hardware user input modules

A wide range of modules are available to help bring up a custom control panel and simplify hardware and mechanical design challenges. These include joysticks and pushbuttons in various combinations. These are ideal for controlling movement in various directions, and can be easily connected to a microcontroller board in a variety of ways. There are also several options for adding a radio module to implement wireless remote control, offering convenience comparable to that of a smartphone.

The SparkFun COM-09032 Thumb Joystick converts forward/back and left/right movements into analog voltages, and integrates a pushbutton that can be used as a “Select” input independently of the joystick orientation. It comes with its own breakout board to simplify connection to the host using only five wires: supply, ground, X and Y output voltages, and Select button status. SparkFun has also provided sample code to read the input voltages from the joystick and present them as digital values at a serial output (Figure 2).

Image of sample Arduino code for reading values from a SparkFun joystick

Figure 2: Sample Arduino code for reading values from a SparkFun joystick.

Connecting to other hardware ecosystems

Joystick modules are available from several other manufacturers, and can be easily connected to an Arduino board using software like the sample in Figure 2. Alternatively, connecting to other hardware ecosystems can broaden developers’ options even further. The Maxim MAXREFDES72 adapter provides an example by enabling Arduino users to connect peripheral modules from the PMod™ ecosystem to their projects. This convenient interface to PMod gives developers access to a wide variety of modules, which not only includes the Digilent JSTK2 PMod™ joystick module, but also the Digilent PmodBTN pushbutton switch module, which contains four switches for user control functions, and numerous further modules including a 16-button keypad.

All-in-one control board

A joystick and pushbuttons, together, are a proven combination capable of controlling a wide variety of possible user inputs - just ask any gaming enthusiast! The layout and functions of a typical gaming controller, which position the joystick beside the pushbuttons, are intuitive and well suited to commands such as moving, positioning and actuating a mechanism like a gantry, robotic arm or gripper.

The DFRobot DFR0008 provides a joystick and four pushbuttons, which are color coded, as a fully assembled module that provides additional headers for XBee radio modules. By enabling developers to take advantage of the XBee ecosystem, the DFR008 simplifies adding wireless connectivity choosing from the wide range of XBee modules available in the market. These include the Digi XB24-API-001 IEEE 802.15.4 2.4 GHz radio board, as well as the XB8-DMUS-002 sub-GHz 868 MHz module, which is suitable for license-free use in Europe.

For developers looking to experiment using XBee wireless connectivity in Arduino projects, Digi’s XBee/Arduino Educational Pack contains Arduino microcontroller boards, a choice of XBee modules, and pushbuttons and a joystick module that are ideal for building various types of user interfaces. XBee users can also rely on development resources including software tools and sample code to help with development.

Keeping the GUI option open

Open-source ecosystems also give developers the freedom to apply their technical skills to a high level if preferred, such as by developing their own embedded graphical user interface with a module such as the 4D Systems ULCD-32PTU-AR 3.2 inch color TFT with integrated resistive touchscreen. The pack comes with an adaptor that connects to the Arduino board via the standard headers, and a cable that connects the adaptor to the display. The Arduino headers remain free to stack other Arduino shields such as a radio module. Several toolsets are available aimed to simplify development of the graphical user interface. These include an entry level environment for developing code, a graphical design tool called ViSi that assists code generation by click-and-place object placement, and the advanced ViSi-Genie environment. In ViSi-Genie, the user simply lays out the objects, sets the events that drive them, and the code is generated automatically.

Conclusion

There are multiple routes to project success in the maker world. Many examples and kits are available to help developers overcome difficult challenges and get software running on the target hardware.

A user input device to handle movement control and actuation can be set up by connecting a smartphone app via Bluetooth, or can be configured using hardware as individual modules or a fully integrated joystick/switch shield. Developers can also take advantage of input devices or wireless modules from other ecosystems such as PMod and XBee, which provide additional routes to project success. The modules are affordably priced and easy to integrate by relying on code and know-how within the open-source community.

 
DigiKey logo

Disclaimer: The opinions, beliefs, and viewpoints expressed by the various authors and/or forum participants on this website do not necessarily reflect the opinions, beliefs, and viewpoints of DigiKey or official policies of DigiKey.

About this author

European Editors

About this publisher

DigiKey's European Editors