Author Archives: R-B

ZeroPhone: A Pi-powered DIY mobile phone

Zerophone: A Pi-powered DIY mobile phone

We have seen Arduino-powered cellphones before. Arsenijs introduces ZeroPhone– a Raspberry Pi Zero powered DIY mobile phone that costs less than $50 in parts. It is mostly open-source and linux-powered. It supports voice calls, texting, and basic apps like alarm clock, calendar, calculator, web browser, music player, etc.

Zerophone: A Pi-powered DIY mobile phone

Zerophone: A Pi-powered DIY mobile phone

Features:

  • Calling and SMS – this is the first functionality to be implemented, and will be considered crucial in the development.
  • All the basic apps – alarm clock, calendar, calculator, phonebook, file browser, web browser and music player.
  • Your own apps – SDK will be provided and it will be developer-friendly. The laand I’ll personally expect, if not at least aid with, social media apps – for a good start, since those are the apps people spend most time in.
  • Running Linux software – since it’s a computer after all, you can run ARM compatible (thus, almost all) Linux programs on it. A Raspberry Pi can give you a desktop with a monitor, keyboard and a mouse? This phone can, too! You like to use SSH, like me? It’s going to be available!
  • Pentesting – lots of fun, a nice hobby for many and well-paying work for some, this phone can do it too.
  • Security and privacy – one of the features that isn’t typically provided but can mean anything from something simply bringing peace of mind to a matter of life and death.
  • Experimenting – there’ll be a sensor port available for connecting anything you think could add useful functions to your phone. Want to wake up when the sun rises? Add a light sensor! An additional display for notifications? Easy, connect and write code! A Geiger counter? Can have it, too!

Tutorial 2: EasyESP-1 “Hello World” Example

Connections for the “Hello World” example

After setting up the Arduino IDE to enable support for ESP8266, it’s time to write your first code for EasyESP-1 board. We will start with the classic hello world! example of electronics, a flashing LED. This is the best example to start with any new hardware platform as it gives us an opportunity to verify that the required software tools/drivers are installed properly and ready to rock.

Hardware Setup

In this example, we will connect the LD1 and D1 pins of J3 header together with a jumper wire as shown below. This will connect the LD1 LED near the bottom right corner of EasyESP-1 to the D1 I/O pin (or GPIO5) of ESP8266.

Connections for the “Hello World” example

Connections for the “Hello World” example

Software

Open a new window on Arduino IDE and select appropriate options for Boards, Serial Port, CPU frequency, and Upload speed. You need to choose NodeMCU 1.0 (ESP-12E Module) from Board menu, set CPU frequency to 80 MHz, Upload Speed to 115200, and match Serial Port to the one that your EasyESP-1 is connected to. Check out my previous tutorial “Getting started with EasyESP-1 using Arduino IDE” for more details on this. Your selected options are shown in the bottom tab of the Arduino IDE, make sure they match with the ones shown below.

IDE1

Arduino IDE option setup for EasyESP-1

As I described in the EasyESP-1 Introduction, EasyESP-1 uses the same I/O indexing as used by NodeMCU. This does not match with internal GPIO indexing. For example, pin D1 is actually mapped to internal GPIO5. In Arduino IDE, you can access this pin in both ways. For example, digitalWrite(D1, LOW) and digitalWrite(5, LOW) will both do the same thing, writes out logic ‘low’ to D1 pin. Next, copy the following code and paste it into your empty program window. The program is written to blink the LD1 LED at a rate of 1Hz. Save the code, verify it, and upload it to EasyESP-1 board in the same way as you do for Arduino.

/*
 Hello World example for EasyESP-1
 Blink the red LED (LD1) on the EasyESP-1 board at 1Hz
 */
 
#define LD1   D1  // Define LD1 as D1 I/O pin
// Alternatively, you can also define it as GPIO5
//#define LD1 5
 
void setup() {
  pinMode(LD1, OUTPUT); // Initialize LD1 as output
}
 
void loop() {
  digitalWrite(LD1, LOW);   // Turn ON LD1
  delay(500);               // Wait for 0.5 sec
  digitalWrite(LD1, HIGH);  // Turn it off
  delay(500);               // Wait for 0.5 sec
}

Output

If everything worked perfectly, you would see LD1 flashing at 1 Hz and with 50% duty cycle (i.e. on and off time are both 0.5 sec).

LD1 flashes at 1Hz rate

LD1 flashes at 1Hz rate

Buy EasyESP-1 board

Tutorial 1: Setting up the Arduino IDE for EasyESP-1

Adding ESP8266 support to Arduino IDE using Preferences window

One of the simplest way to program the ESP8266 chip on board EasyESP-1 is using the Arduino IDE. Following steps describe how to enable the ESP8266 support in the Arduino environment.

Step 1 : Install Arduino IDE
The first step toward setting up the Arduino platform for programming EasyESP-1 is to download and install the Arduino IDE. Go to the Arduino website and download Arduino IDE 1.6.11.

Step 2: Install ESP8266 core package
Next step is to install the ESP8266 core for Arduino IDE. It is an add-on that allows to write sketches for ESP8266 using the Arduino IDE  and its libraries. The easiest way to install the ESP8266 core is by typing in http://arduino.esp8266.com/stable/package_esp8266com_index.json
into Additional Board Manager URLs field in the Arduino-> Preferences window (see figure below).

Adding ESP8266 support to Arduino IDE using Preferences window

Adding ESP8266 support to Arduino IDE using Preferences window

Click OK and then go to Boards Manager and install the ESP8266 core. It appears at the end of the list as esp8266 by ESP8266 Community (see figure below). Select 2.3.0 version from the dropdown list.

Installing ESP8266 core from Boards Manager

Installing ESP8266 core from Boards Manager

Step 3: Select the right board
Next you need to select NodeMCU 1.0 (ESP-12E Module) from Board menu.

Select NodeMCU 1.0 (ESP-12E Module)

Select NodeMCU 1.0 (ESP-12E Module)

Go to Tools and make sure the CPU Frequency is set to 80 MHz and Upload Speed to 115200. If not, change them to correct options.

CPU clock should be set to 80 MHz and Upload Speed to 115200

CPU clock should be set to 80 MHz and Upload Speed to 115200

Step 4: COM Port selection
Finally, you need to select the right COM port that your EasyESP board is connected to. Obviously, you need to connect the EasyESP-1 to the computer through a USB cable. If the driver for SiLabs CP2102 USB-UART device is installed properly, it will show up in the Arduino IDE Tools->Port list as a new serial port. In Windows machines it shows up as a new COMx port. The following figure shows how it appears on a MAC computer. You should select the matching serial port for the CP2102 device on EasyESP from the Port list.

Select the right serial port (MAC computer)

Select the right serial port (MAC computer)

Now you are all set to write and upload your first ESP8266 program using the Arduino IDE.

ESP8266 experimenting made easy with EasyESp-1

ESP8266 experimenting made easy with EasyESP-1

Buy EasyESP-1 board

Managing a menu driven user interface on a Nokia 5110 LCD

User interface menu on Nokia 5110 LCD

An interactive menu driven LCD user interface (UI) is really useful in embedded applications that require setting up parameters for operation. This YouTube tutorial demonstrates how to manage a simple menu driven UI on a Nokia 5110 LCD for Arduino applications.

User interface menu on Nokia 5110 LCD

User interface menu on Nokia 5110 LCD

This is the project we are going to build. In the display a simple menu appears, and with the help of three buttons I can navigate up, or down and select a menu item. Let’s select the first option. As you can see a new a UI screen is displayed and by pressing the up and down buttons we can change the contrast of the display. If we press the middle button again, we go back to the main UI screen. If we now select the second menu item and press the middle button we can turn the backlight of the display on or off. Lastly if we navigate to the last menu item we can reset the settings for the display to the default values. Of course this is just a demonstration project, you can modify it to build your own more complex menus if you wish. Let’s now see how to build this project.

Watch the tutorial video below:

« Older Entries