About R-B

Electronics enthusiast and hardware maker.

NTP synchronized clock

The Network Time Protocol (NTP) is the most commonly used internet time protocol for synchronizing locally running clocks to a more accurate reference clock server. In United States, the official time is provided by the National Institute of Standards and Technology (NIST). The NIST servers listen to a NTP request, and respond by sending a 64-bit UDP/IP data packet containing the time in UTC seconds since January 1, 1900, with a very high time resolution of 200 picoseconds. Raj from Embedded Lab illustrates in his new tutorial how to make an ESP8266 based internet clock that is synchronized with the NIST time server for accurate timekeeping. An ILI9341-driven colorful TFT LCD is used to display time in both analog clock dial and digital formats. Raj used EasyESP-1 board for this tutorial and developed the firmware for his internet clock using Arduino IDE.

ESP8266-based internet clock

EasyESP-1: A beginner’s prototyping board for ESP8266

ESP8266 has made it possible for makers to develop IoT applications in much simpler and more inexpensive ways. EasyESP-1 is a new ESP8266 prototyping board, specially designed for beginners by Raj from Embedded Lab. With an onboard USB-to-Serial converter pre-installed, EasyESP-1 does not require any additional hardware to download your application firmware to the ESP8266 chip. The ESP module used in this development board is ESP-12E. All the I/O pins are broken out to 0.1” female headers for easy access, as well as to standard Grove connectors for connecting Grove sensors and other compatible modules. The 180-point breadboard further facilitates experimenting and testing of external circuits. You can buy EasyESP-1 from their Tindie Store.

EasyESP-1 makes ESP8266 prototyping easy

Features

  • Easy access to all GPIO pin through female headers and Grove connectors
  • On-board USB-UART chip for easy programming and debugging
  • 180-point breadboard for experimenting with test circuits
  • On-board 3.3V (800 mA) regulated power supply
  • Two tact switches for user inputs, and one output LED
  • Slide switch to enable/disable auto Wake Up feature during Sleep mode

For more details about EasyESP-1, visit Raj’s Page.

ESP8266 sending data to Google spreadsheets

Although there are so many cloud IoT platforms (ThingSpeak, thinger.io, TESPA.io, Xively, … ) available in the market, each offering APIs and tools to allow the Arduino and ESP8266 users to directly upload their sensor readings online for real-time visualization and global access, Google Drive is still my favorite choice for posting sensor data online as it is more approachable. If you are a regular user of Google Drive, you would find this tutorial from Anir very useful too. It describes a method of connecting the ESP8266 device directly to a Google sheet for storing the sensor data without using any third party service, like pushingbox that most other Arduino users have used for fulfilling Google’s http requirements and handling the URL redirection. This tutorial explains how you can make the task much simpler by using a recently published HTTPSRedirect Arduino library by Sujay Phadke that allows the ESP8266 to self-handle the redirect and https GET requests. The tutorial uses a NodeMCU board and a soil moisture sensor as input for demonstration. The sensor data are directly posted to a spreadsheet on Google Drive.

ESP8266 connecting to Google spreadsheets for data logging
ESP8266 connecting to Google spreadsheets for data logging

The way it works is you need to setup a Google Apps Script to access a spreadsheet in your Google Drive. The script have access to the spreadsheet via its document sharing key, which is unique and can be found on the URL of the sheet. In order to remotely run the Google Script without exposing your Google credentials, you need to publish it as a Web App URL. The ESP8266 can then send data to the spreadsheet using the same Web App URL with actual sensor data appended to it. Because Google requires you to send any GET request over an Web App URL using https (more secured than http), and then redirect your request to another URL location, the HTTPSRedirect Arduino library by Sujay Phadke is the key to handle this smoothly. Otherwise, you would need to use a third party online service to accomplish the same. The tutorial also describes how to configure the Google spreadsheet for receiving the soil moisture data in correct cells and uses some built-in chart features to display the time series in real time.

For more info, visit the article page.

Environmental data display on an RGB matrix panel

In this tutorial, I have described how to use a 16×32 RGB matrix panel with Arduino Uno for colorful display of environmental data captured locally using Bosch BME280 sensor. BME280 is a fully integrated environmental unit from Bosch that combines sensors for pressure, humidity, and temperature in a tiny 8-pin metal-lid LGA package. The RGB LED matrix panel consists of 512 bright RGB LEDs arranged in 16 rows and 32 columns. The row and column driver circuits are built on the back side of the matrix panel. The data and control signal pins are accessible through a HUB75 (8×2 IDC) connector. It requires 12 digital I/O pins of Arduino Uno for full color control. The display panel also comes with a RGB connector shield for Arduino Uno and necessary cables for easy wiring between the RGB panel and the Arduino board.

demo6
16×32 RGB LED matrix panel

The connector shield also features the DS1307 RTC chip on board along with a CR1220 coin-cell battery holder. The I2C pins of the DS1307 chip are pre-wired to A4 and A5 pins of the shield. The BME280 is also I2C compatible and uses the same pins for data and clock. I have written a firmware for Arduino to read temperature, humidity, and pressure data from BME280, and time and date from DS1307 chip, and display all these data on the RGB panel with different color and some animation. You can find rest of the details here.

setup5
RGB connector shield consists of DS1307 RTC on board

 

Smart home monitoring system using Raspberry Pi

The advent of Internet of Things in recent years has made everyday objects smart and easily connectable to the internet. It has allowed us to automate our home by monitoring and controlling home appliances such as lights, sprinklers, thermostat, door locks, security systems, and many more from anywhere. , an IoT hobbyist from Sydney, Australia has posted two Instructables on making a smart gas valve for home safety and a smart still camera for home security using the Raspberry Pi platform.

For sensing the position of gas valve, a magnetic sensor is used. It is the same sensor that is used in door and window alarms. It has one reed switch and a magnet that create a closed circuit when placed close to each other. Here, it is arranged in such a way that when the gas valve is open, the magnet is pulled away from the switch, thereby breaking the circuit, which is sensed by Raspberry Pi, as shown in figure below. The status of the valve is then sent to the remote user through a text message on his/her cellphone.

Magnetic sensor arrangement for sensing the gas valve position
Magnetic sensor arrangement for sensing the gas valve position

Similarly, for smart home monitoring, a PIR motion sensor and a Pi camera board are hooked to the Raspberry Pi and are all enclosed inside a minion toy. When the PIR sensor detects any motion in its surveillance zone, the Raspberry Pi captures a still photography and sent it to the remote user along with a text message.

Camera and PIR sensor setup
Camera and PIR sensor setup

The two Instructables also cover the basics of getting started with Node-RED, MQTT v3.1, and Watson NodeRED for IBM Bluemix, and write programs for the Node-RED on Raspberry Pi2 as a MQTT client that would connect to the home wireless network and read the sensor data.

Dual set point programmable thermostat

Programmable thermostats are cool things. They let you set the room temperature according to your schedule and will automatically make those adjustments for you. If you use them the way they’re intended to, they could be a great way to save on home energy costs. They work perfectly for people with fixed daily schedules. You can set one temperature during the time you are at home and to another when you are away. But what if your everyday routine is not the same? Then you have to manually adjust the temperature every time you are in and out. Ed Van Every was facing the same issue and he came up with a nice DIY solution for this. He wanted his place to be heated to 70ºF when it is occupied, and to 55ºF when it is not. So he made his own dual set point thermostat which allows him to implement his “working temp” with a single hit of a push button and his “away temp” with another push button.

DIY dual setpoint thermostat
DIY dual setpoint thermostat

Like most other DIY thermostats, Ed also used an Arduino board as the main brain of the thermostat and DHT22 for sensing ambient temperature and humidity. For controlling the heater, an electromechanical relay breakout board was used. A 16×2 character LCD displays the temperature setting that is currently active, its set-point value, the actual room temperature and humidity. In the event when the heater is turned on, an asterisk symbol * is displayed in the lower middle of the display indicating that the relay circuit is closed. The room temperature and humidity are refreshed every 2½ seconds and the LCD backlight automatically turns on for 60 seconds when a button is pressed on the thermostat. Ed also 3D printed a nice enclosure for his thermostat to give it a more professional look.

PiOSCBOX: A Raspberry Pi based audio processor and synthesizer

Raspberry Pi carries a lot of horsepower inside to handle the realtime audio and add some effects to it. The only limitation is it does not have a built-in sound card, but it is manageable using an external USB soundcard. PiOSCBOX is an attempt to make a low-cost, stand-alone audio effects processor and synthesizer using Raspberry Pi 3. It provides a very nice and interactive user interface using a 128×64 graphic LCD and six rotary encoders. As with all other audio processors based on Raspberry Pi, PiOSCBOX also requires an external USB audio adapter.

Raspberry Pi based audio processor
Raspberry Pi based audio processor

The audio processing and synthesizing involves heavy Fast-Fourier transform computations and other DSP capabilities. PiOSCBox utilizes Pure Data for all of the DSP implementations. If you are unfamiliar with Pure Data, it is an open source visual programming language that allows musicians and artists to develop a software graphically (without writing a single line of code) to process and generate audio, video, and 2D/3D graphics along with interface external sensors and other input devices.

The software required for the PiOSCBox can be downloaded from the following location: https://github.com/star-fs/PiOSCBox

Once it is cloned to the /home/pi/PiOSCBox/ location on your Raspberry Pi, you need to run the build script, which will compile the rotary encoder components. The project also requires some external dependencies like WiringPI and Liblo, which are both embedded into NOOBS operating system for Pi.

Raspberry Pi action camera

Action cameras are light and portable camcorders that are great for filming outdoor sports and activities. While there are varieties of commercial action cameras available in the market, makers and tinkerers prefer an alternative route of making their own version of any piece of hardware. Connor Yamada‘s Raspberry Pi based DIY action camera can shoot both video and still photos using a Pi camera board and also features integrated bluetooth and wifi modules for file transfers. A 3D-printed durable enclosure is used to house everything including a high-capacity (2000mA-hour) rechargeable battery that would give multi hours of recording the outdoor fun. The camera also includes a LiPO charger and voltage booster module for easy charging of the battery through a micro USB port.

Raspberry Pi action camera
Raspberry Pi action camera

In order to obtain the compact form factor of an action camera, all the peripherals must be fit as tightly as possible inside the enclosure. Connor tried to keep the size of the enclosure not to exceed that of the Raspberry Pi A+. Because the USB WiFi module can easily stuck out quite a bit when inserted in to the USB port, he managed to remove the USB jack with some side cutters and solder a ribbon cable to the exposed USB lines to connect the WiFi adapter directly to the board. He also hot glued the Bluetooth module on the top of the Raspberry Pi board and ran another ribbon cable to connect it to the serial port pins. Two pushbuttons with slightly longer pieces of cable provide basic control functions for the camera. Following video shows some test recordings of this action camera.

Making a Geiger counter with 555 timer IC

Radioactive particles are found abundantly in nature. Whether they come from space or generated on Earth (radioactive waste, medical X-rays, etc), they are high-energy particles resulting from radioactive decays. The three major types of radioactive particles are named after the first three letters of the Greek alphabet: α (alpha are helium nuclei), β (beta are high-speed electrons), and γ (gamma are high-energy photons). Exposing to any of these radiation for a long time can be dangerous as they can kill DNA and cause cancer. The presence of beta particles and gamma rays in your surrounding can be detected using a Geiger-Muller (GM) tube in conjunction with some basic electronics.

The GM tube is essentially a tube filled with an inert gas (at low pressure) and two electrodes at its opposite ends. A high voltage (~400-700V) is applied between the two electrodes but no current flows between them under normal condition. When radioactive particles passes through the tube, some of the gas molecules get ionized, which results in a short intense pulse of current between the electrodes.

Geiger-Muller tube operation (Source: Wikipedia)
Geiger-Muller tube operation (Source: Wikipedia)

The following circuit (originally published on Elektor July 2006 magazine) illustrates how a GM tube can be used with some basic electronics to make a radiation detector, often known as Geiger counter. The circuit uses two 555 timer ICs. The first 555 timer is setup as an astable multivibrator and drives a step up (6V-to-250V) transformer through a transistor to generate 250V alternating voltage. The high voltage output from the transformer is further amplified using a voltage multiplier circuit made of diodes and capacitors to derive a ~700V source required for the GM tube. When a radiation is detected, the current flow through the tube triggers the second 555 timer circuit, which is configured to produce a tick sound on a speaker when triggered. The output from the second 555 timer can be further fed to a counter circuit for counting the detected pulses.

Geiger counter using 555 timer ICs
Geiger counter using 555 timer ICs

More recently, tanner_tech published an Instructable on building a similar Geiger counter using a single 555 timer and a piezo buzzer. His GM tube operates at a much lower voltage (~400V).

Geiger counter made by [tanner_tech]
Geiger counter made by [tanner_tech]

DIY portable spectrometer

Spectral signature is a characteristic property of a material that represent how the matter interacts with an electromagnetic radiation at different wavelengths. By looking at the reflectance spectra of a material, scientists can not only retrieve vital information like the chemical composition and crystal structure of the material, but also the presence of any impurities or third element within it. The instrument used to derive such spectra is called Spectrometer. While a commercial spectrometer could cost a huge amount of money, Akshat Wahi‘s work is intended to make an open-source tool called WiSci to allow spectroscopy accessible to everyone.

DIY spectrometer
DIY spectrometer

WiSc is a portable spectrometer that communicates to an Android device over Bluetooth to store and visualize the spectral data. It uses Hamamatsu’s C12666MA mini-spectrometer at the front end to collect spectral signature from a target in wavelengths ranging from 340 to 780 nm. The hardware setup includes an Arduino board to read measurements from C12666MA and a HC-05 Bluetooth module for sending the data to the Android device. The android application was developed using Android Studio IDE and is compatible with Android 2.3.3 or higher.

Chlorophyll fluorescence from apples
Chlorophyll fluorescence from apples

Akshat’s team tested WiSc for non-destructive testing of fruit ripeness. They collected Ultra-Violet (UV) fluorescence from Chlorophyll present in the skin of Red Delicious, McIntosh and Empire apples. Their observations were found consistent with what is measured by a penetrometer.