Archive | Embedded RSS feed for this section

Embedded System Development Environment

There are various tools in use that are necessary to develop hardware and software solutions involving micro-controller systems. In a practical sense, they are tools that allow a developer to design and develop the code necessary to operate and achieve a specific purpose or function. Either as a free-standing application on a single board computer or as a simple programmable logic controller solution. Application code is normally put together within a developer’s tool chest also sometimes loosely understood as a toolchain.

Wikipedia provides a write up of what a toolchain is from a software development perspective. Outlined as a sequence of utilities that include compilers, libraries, debuggers, and so on to produce an application. While completely accurate, a respective toolchain for embedded systems usually turns out different because associated hardware requirements can vary based on the platform in use. Moreover, a toolchain can look quite a bit different due to separately unique operating systems, programming languages, and development requirements at a device, component, or circuit level. A toolchain set up for an ST Microcontroller could look entirely different from a Texas Instruments or Broadcom architecture.

Embedded System Development Environment

Outlined here are typical tools that are common at an embedded system project or workstation. For professionals, makers, or hobbyists, these are common setups. Generally, from a system level, there are generally four categories and specific developer tools separated out when bringing together embedded projects of various types.

Integrated Development Environment (IDE)

This is an application that provides the framework by which code is written in a designated language for a specific purpose. Generally for embedded systems, Eclipse is commonly in use because of its support for languages generally more favorable to embedded systems. Visual Studio is also a viable choice, but there is a larger code and configuration and use overhead that accompanies VS IDE.

  • Eclipse | Site | Download (Oxygen 64-bit)
    An open-source development community with resources and tools to develop a project with a very large support base.
  • Visual Studio | Download
    Microsoft’s developer community provides open-source support through its free Community developer IDE.

Languages

These are merely a few languages that are possible to implement for an embedded project. They are outlined here because they are highly common as tools among thousands of developers.

  • Python | Download  (Windows) | Download (Mac) | Download (Linux)
    “Python is an interpreted, interactive, object-oriented programming language. It incorporates modules, exceptions, dynamic typing, very high-level dynamic data types, and classes. Python combines remarkable power with very clear syntax. It has interfaces to many system calls and libraries, as well as to various window systems, and is extensible in C or C++. It is also usable as an extension language for applications that need a programmable interface. Finally, Python is portable: it runs on many Unix variants, on the Mac, and on Windows 2000 and later.” Source: General Python FAQ.
  • C/C++
    Compiler language normally installed during IDE set up. For example, when a developer installs Eclipse, or Visual Studio, C/C++ and Python extension support is selected to immediately start programming, test, and debug in the desired syntax or language.
  • Java
    A general-purpose object-oriented programming language. Also normally an extension to an IDE installation. An often popular choice of developers of embedded systems.

Utilities

Single-board computers with firmware code embedded within a micro-controller, flash or memory, are typically supported by a Linux O/S. A Linux distribution is commonly specific for embedded systems such as Debian.

  • Linux | Download (Debian)
    A free version of Linux that supports application software to accomplish various tasks at a user-level. It comes with about 51,000 packages of free pre-compiled software to run on top of Linux to support what programs a developer might produce within a chosen programming language. The distribution is relatively light with a total size of about 2GB.
  • Notepad | Download (Notepad++)
    A free source code editor and note pad application as a straight-forward text editor. Very useful as a scratchpad, or an easy-to-use program editor that doesn’t operate as an IDE.
  • PuTTY | Download
    An SSH and telnet client developed for Windows. PuTTY is open-source software. A free and open-source terminal emulator, serial console, and network file transfer application. It supports several network protocols, including SCP, SSH, Telnet, rlogin, and raw socket connection to gain access to an SBC or controller device over a network.

Support

  • GitHub | Site
    Another software development platform, but largely used for source control and code sharing among teams, privately or publicly. Very useful to commit to a repository as code advances and development continues. Multiple concurrent code instances and versions are supported across projects for more organized and effective development.
Continue Reading ·

Arduino Uno Set-Up

As previously posted with the RPi set up, the same is illustrated here but for Arduino Uno. A very common single board computer that is entry level and simple to set up and operate

As before, three areas of interest are given.

Block Diagram
Pin Out Diagram
Tool Chain

The purpose of each work together to build hardware and software controller applications that operate with a host or in a freestanding manner.

While Arduino is widely understood as an entry-level SBC, it can be found among enthusiasts, makers, and project minded people who wish to build projects and code them for unique applications. Centered on the ATMega microcontroller, the software support is deep in a large community of developers. The development environment is an IDE appropriately named Sketch.

Arduino Uno Hook-up Diagram
Continue Reading →
Continue Reading ·

Beaglebone Black Set-Up

This is the third set up posting for an SBC system. This time it is for the Beagle Bone Black with a wireless cape. The attached PDF and diagrams posted here provide a suitable reference for a project in terms of hardware and software development. While there are a number of illustrations and diagrams of interest here, there is also an excellent text by Derek Molloy that offers a more comprehensive look at the setups to support projects of numerous types (ISBN 978-1118935125).

As previously posted with the RPi and Arduino Uno setups, the same is illustrated here but for BeagleBone Black. A very common single-board computer that is entry-level and simple to set up and operate. Widely known among makers, academics, and students for control automation, robotics, and sensor/actuator processing applications.

Beaglebone Black Hook-up Diagram
Beaglebone Black Pinout Diagram
Beaglebone Black Functional Diagram
Beaglebone Black Cape Functional Diagram
Continue Reading ·

ST Micro Nucleo Set-Up

The ST Micro Nucleo single-board computer (SBC) provides for both analog and digital ports that offer more flexibility toward projects developed. In terms of its physical hardware set up, it is probably the easiest to bring together as compared to other more common SBC solutions.

The Nucleo board is supported by the mbed development system. An online code editor to produce applications for a wide range or project types. The SBC largely provides for a USB interface, power, clock and general purpose I/O in a small form factor.

It can operate with a host or as a freestanding board for set and forget applications. Largely to compete with Arduino, but also for development support of STMicro controller ICs which involve evaluation, qualification for suitability, etc.

ST Micro Nucleo Hook-up Diagram
ST Micro Nucleo Pinout Diagram 1
ST Micro Nucleo Pinout Diagram 2
ST Micro Nucleo Pinout Diagram 3
ST Micro Nucleo Pinout Diagram 4
Continue Reading ·

Raspberry Pi Set-Up

As a way to set a reference about how Raspberry Pi gets set up for repeated and continued use, it makes sense to identify system components in one place. Altogether for ease of use and assembly. This diagram is a way to identify hardware and possible software elements for development and exploration.

More specifically, a block diagram is illustrated to indicate where various interfaces apply. Display ports, power, general-purpose I/O, USB, and so on. Since peripheral connectivity is quite large with the 40-pin dual inline connector, a pin-out diagram is also illustrated here. Each pin having its reference number and name to describe its purpose.

Continue Reading →
Continue Reading ·

Photoresistor Sensor Control of Buzzer Alarm

Using the point-slope formula between the on-time and off-time of a passive buzzer, we can control the high frequency and low-frequency tone sound as a function of light. As a light source is drawn near to the photoresistor, the buzzer will increase in frequency. Conversely, as the light source is moved away from the photoresistor sensor, the buzzer sound will correspond to a low-frequency tone. Removal of the light source fully separated from the photoresistor permits an ambient light reading until the buzzer is fully settled to a maximally lower frequency of sound.

By experimenting with the point-slope formula in the code, you are able to change the tonality. However, to get a precise range and audible quality of the buzzer, it is best to calculate the on-time from a sample source reading at the sensor and an off-time (delay time) to complete each frequency cycle. The more cycles of on and off time, the higher the frequency.

Simple component placement and wiring hook up.

5K Resistor in series with the photoresistor sensor. The Arduino UNO pin connected between the 5K resistor and the light sensor is reading a change in voltage present at this connection. The voltage divider changes value as the resistance of the light sensor increases or decreases. As the sensor’s resistance value decreases with increasing light levels, it conducts more and drops less voltage. The analogRead code instruction detects the change of voltage at this node and in turn produces change in tonality via the digitalWrite command at the output pin connected to the buzzer.

5K-ohm resistor in series with the photoresistor sensor and passive buzzer.

This is a passive buzzer that is driven by a voltage and light level separated by a delay between each digitalWrite event. Causing the buzzer to produce a tone of lower or greater frequency as new voltages are presented to it. Each new voltage level from the voltage divider produces its sound frequency by continuously turning the buzzer on and off again as it recognizes new levels as light intensity changes.

Light Sensor and resistor voltage divider input source. With separate buzzer output termination, the Arduino UNO module serves as the processing device for control via code instructions. ( Negative polarity terminal disconnected to interrupt operation).

Program & Functional Operation

This video demonstrates a change in buzzer tone as the light source distance from the light sensor is changed. The closer to the light sensor is exposed to a higher intensity of illumination, the higher the frequency in sound. The lower the light intensity, the lower the sound pitch or frequency.


Light & Delay Value Selection

To come up with a delay value for the integer variable declared in the code, it is necessary to the light sensor’s voltage value into memory via pin A0 on the Arduino. This means it is necessary to perform a calculation on the changes of input voltage levels as they change as light illumination intensity changes. The formula derivation is as follows:

-Paul McWhorter

Code Setup:

Copy & paste this code to your Arduino Sketch as desired to edit or experiment with your program.

int lightPin=A0;
int buzzPin=8;
int lightVal;
int delayT;

void setup()

{
pinMode(A0,INPUT);
pinMode(buzzPin,OUTPUT);
Serial.begin(9600);
}

void loop()
{
lightVal=analogRead(lightPin);

//This sets the tone for the buzzer
delayT=(9./550.)lightVal-(9.200./550.)+1.;

Serial.println(delayT);
digitalWrite(buzzPin,HIGH);
delay(delayT);
digitalWrite(buzzPin,LOW);
delay(delayT);

}

Arduino IDE:


Continue Reading ·

MatPltLib, OpenCV, Numpy, Visual Studio IDE, & Python

There are numerous configuration requirements involved in the setup and operation of the Jetson unit to produce relevant AI related projects. To support meaningful project activity, these are the steps to go through. Much of this effort

  • Install and update Linux
  • Install Visual Studio Code IDE
  • Install Python 3 using VS Code IDE
  • Install Code Interpreter
  • Install and update openCV library for AI applications
  • Install Numpy library for numerical function support
  • Install MatPltLib to plot mathematical operations and arrays

Upon completion of the setup walk-through, the short initialization program is necessary to get the camera operating. This initialization code adds libraries and configures the camera with settings unique to its resolution limits or parameters.

Rear port view of Jetson Nano prepared for updates.
Front view of Jetson with RPi camera module. It is also possible to run a USB webcam as well.
Visual Studio Code Integrated Development Environment (IDE). A host environment to support code languages such as Python.
Python 3 installation, confirmation to indicate version and readiness. After installation it is necessary to install the interpreter that runs beneath Python.
Once MatPltLib and Numpy is installed, sine and cosine functions are run as separate plots graphed. Or linear data is run as x and y array variables from memory. Simply to test and observe the numerical operation support along with the plotting utility.
Once openCV is installed and updated from the Linux terminal, set up and configuration is required to begin operating the Jetson unit and camera to support tracking and overlay for objection detection and computation.
Installation command and activity to install openCV. To update openCV it is necessary to remove the latest installed package version using the sudo apt-get remove python3-openCV.
Continue Reading ·

Python Function Review for Jetson Nano Projects Pt.2

A separate walk through of how the prior session involved arrays and conditional loops is completed here only this time in headless mode. The objective of this session was to extend the function by assembling the logic and method by which grades are collected by user input and averaged for display as an output to a user. The screen captures below indicate the specific code and Python executable. The video provides for a more complete view of the session.

Python 3 code written in the Linux nano utility. A common old-school text editor to produce the code for Python to run the program.
Operating results of the Average Grades program written to collect, average, and display grades.
Video walk through to indicate both the code and executable.

Continue Reading ·