Quantcast
Channel: Embedded Lab
Viewing all 713 articles
Browse latest View live

DIY Handheld Game Console using Raspberry Pi Zero

$
0
0

A very interesting Instructables from GreatScottLab showing how to make a handheld game console for retro games using Raspberry Pi Zero, a rearview LCD, and an audio amplifier. The console runs of NiMH rechargeable batteries supported by a self-made over-discharge protection circuit. The project uses recalboxOS, a light embedded system created to run on the Raspberry Pi platform. The instructable is divided in to two videos: the first video shows the connections among the parts and the second one describes the enclosure for the game console.

Raspberry Pi Zero Game console

Raspberry Pi Zero Game console

The post DIY Handheld Game Console using Raspberry Pi Zero appeared first on Embedded Lab.


RGB matrix displays time and environmental data

$
0
0

Temperature, humidity, and ambient pressure are the key parameters for environmental monitoring. With the advent of MEMS and integrated multi-sensor technologies, it’s been feasible to miniaturize environmental sensors and embed them into portable electronics. BME280 is one such fully integrated environmental unit from Bosch that combines sensors for pressure, humidity, and temperature in a tiny 8-pin metal-lid LGA package of size 2.5 x 2.5 x 0.93 mm³. This article describes how to read the environmental data from BME280 using Arduino and display the data on a 16×32 RGB matrix panel using the RGB driver shield.

demo6

RGB matrix displaying time, date and environmental data

Things you will need

Following items are used in this project:

  1. Arduino Uno or any compatible board
  2. 16×32 RGB panel + driver shield
  3. 5V, 2.0A DC power supply
  4. BME280 sensor breakout

The 16×32 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. 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.

RGB matrix panel kit

RGB matrix panel kit

Buying Links for 16×32 RGB panel kit:
From our US Tindie Store
Buy from our Elecrow Store in China

Connection setup

The RGB LED panel kit includes all the necessary cables and the Arduino Uno connector shield for an easy connection between the RGB driver pins and the Arduino I/O pins. The following picture shows the proper way of connecting the Arduino shield and the RGB panel.

Wiring the RGB panel to Arduino shield

Wiring the RGB panel to Arduino shield

A complete hook up guide is provided here. Basically, a 8×2 IDC cable connects the input HUB75 connector on the RGB panel’s back to the 12 pins of Arduino via the connector shield. The power supply pins of the RGB panel are connected to + and – pins of the 2-pin terminal block on the Arduino shield. The 5V DC power supply required for the RGB panel is supplied via the 2.1mm barrel jack connector on the shield.

The BME280 sensor support I2C communication. The sensor module’s data and clock pin are therefore connected to A4 and A5 pins of Arduino, respectively. I simply plugged in the the data and clock pins of the sensor breakout module into the shield headers as shown below and connected the power supply pins through jumper wires.

Sensor hook up

Sensor hook up

Next, you need to plug in the shield into Arduino Uno board.

RGB connector shield plugged into Arduino Uno

RGB connector shield plugged into Arduino Uno

Software

The Arduino is programmed to read the sensor data from BME280 and displays them on the RGB panel with different colors. The time and date are also displayed. If the DS1307 is not running at the time of programming, the date and time are set to the values corresponding to the clock settings on the computer at the time of uploading the sketch.

Arduino libraries required for this project are:

RTClib for DS1307

Adafruit GFX Library

Adafruit RGB Matrix Panel library

Adafruit unified sensor library

Adafruit BME280 library

You can download the complete Arduino code from the link below.

Download RGB16x32_BME80_DS1307RTC_TestCode

Output

op1

Time and Day of Week display

op2

Temperature in both C and F scales

op3

Relative humidity data

op4

Displaying current date

The post RGB matrix displays time and environmental data appeared first on Embedded Lab.

NTP synchronized analog wall clock

$
0
0

Analog wall clocks are an old invention. Besides telling time they also serve as a wall decoration. Most of the modern days inexpensive wall clocks are not good at keeping the time accurately. Also, they usually don’t have auto-adjustment for daylight saving time. Victor-chew shares his attempt to tether a cheap IKEA analog wall clock to the ESP8266 WiFi microcontroller and make it sync with a NTP server for accurate timekeeping as well as auto adjustment to daylight savings.

Hacking a IKEA analog wall clock to make it NTP-enabled

Hacking a IKEA analog wall clock to make it NTP-enabled

In this project, I connected a cheap $2 Ikea analog clock to the ESP-12/NodeMCU dev module and synchronized the clock time with NTP time (localized with Google Maps Timezone API). On startup, simply connect to the device configuration AP and configure your Wi-Fi login credentials and physical clock time. The config web page will capture your current location automatically using HTML5 Geolocation and use that to automatically figure the local time and DST offset via the Google Maps Timezone API.

The clock will sync within a few seconds of NTP time, take care of DST automatically and only cost a few dollars more due to the low cost of ESP12/ESP8266. The only problem that remains is the practical need to run this clock from the mains. Even when connected to a 10,000mha battery pack, it will only last for about 6 to 7 days.

For seven-segment LED based NTP clock, click here.

The post NTP synchronized analog wall clock appeared first on Embedded Lab.

Bluetooth enabled portable spectrometer

$
0
0

Spectrometers are widely used in scientific studies to characterize the spectral signature of a material that represents how the matter interacts with an electromagnetic radiation at different wavelengths. The spectral data contains vital information like the chemical composition and crystal structure of the material, as well as the presence of any impurities or third element within it. A commercial spectrometer costs a huge amount of money. Akshat Wahi‘s WiSci is an open-source spectrometer tool intended to allow spectroscopy accessible to everyone.

DIY Bluetooth spectrometer

DIY Bluetooth spectrometer

With Hamamatsu’s C12666MA mini-spectrometer at the front end, WiSc collects 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 and higher. WiSc has been successfully implemented for non-destructive testing of apple ripeness. to extract the spectral data from  for non-destructive testing of fruit ripeness and the results were found consistent with that from a penetrometer.

The post Bluetooth enabled portable spectrometer appeared first on Embedded Lab.

Automatic garage door monitor and closer

$
0
0

How many times you have trouble remembering if you have closed the garage door while you are away? Or, how many times you have discovered in the morning that your garage door was open all night? Well, if you are having this issue, you might consider building Adam Oakley’s automated garage door closer that shuts the door for you automatically when you forget.

Arduino controlled automatic garage door closer

Arduino controlled automatic garage door closer

Powered by an Arduino Pro Micro board, it uses a ceiling-mounted HC-SR04 ultrasonic distance sensor to sense the status of the garage door. When the door is open, it slides up close to the ceiling, and thereby the HC-SR04 sensor can detect a reflected echo from a shorter distance. The Arduino reads the sensor output every second and when it detects the garage door is open, a count down timer of preset interval begins. If the door remains open after the timer runs out, a signal is sent out to close the garage door. The project uses a 10-segment LED bar to display the time left before the timer runs out (or before the door will be closed automatically). What if you are working in the garage and you need it to be opened for a little longer. Adam also included a push button that resets the timer every time it is pushed. His software is modular and is designed to work with single or multiple doors with minimal modifications.ent on my LED strip is worth 10 minutes. If less than 10 minutes remain, the segment will dim accordingly.

The post Automatic garage door monitor and closer appeared first on Embedded Lab.

BuzzWatch: A personal tactile reminder

$
0
0

BuzzWatch is a wearable tactile reminder device that can be programmed to vibrate at constant or random intervals notifying the wearer about the passage of time, as well as prompting them to think about what they are doing, and if they need to be somewhere else at the moment. The device uses the Atmel ATTiny13A MCU as its brain, with a thumbwheel potentiometer for setting the time interval of the reminder. A tiny vibrating motor works as a buzzer in the device. The whole electronics fit into a 3D printed ABS case with dimensions of 30x30x9mm. BuzzWatch runs off a 1225 lithium coin cell. In order to prolong the battery life, the ATTiny13A remains mostly in sleep mode. If you sit in front of the computer for hours, this device can serve as an alert telling you when it’s time to get up from your seat and stretch.

Personal tactile reminder

Personal tactile reminder

I used SMD components to keep the device thickness (and also the amount of holes to drill) to a minimum. The only two through-hole parts are the pot and the battery clip. These two also define the dimensions of the board, it could’ve been somewhat smaller otherwise. It’s a one-sided design, which makes it more convenient for home etching. I used photoresistive film as both etching mask and solder mask and a CuSO₄-based etchant. The μC footprint can accomodate both the -SU and -SSU versions of the tiny13. Due to the small size of the board, including a standard ICSP header would be impractical, so contact pads with standard 2.54mm spacing (matching the t13-P pinout so that the jig could later be used in breadboards) are provided instead. Ideally the jig/adapter would use pogo pins, but since I don’t have those I used sewing needles instead and soldered it to the board for the duration of the development.

The post BuzzWatch: A personal tactile reminder appeared first on Embedded Lab.

Dtto robot is the 2016 Hackaday Prize Winner

$
0
0

Dtto, a modular self-reconfigurable robot, is the grand prize winner of the 2016 Hackday contest. Dtto’s design is focused on all-terrain search and rescue operations using bio-inspired locomotion mechanisms.

Dtto: a modular transformable robot

Dtto: a modular transformable robo

The Dtto Modular Robot has been designed with adaptability in mind. Inspired by how fire antscolonies work, a number of modules (or small robots) find each other, connect mechanically and colaborate to act as one only robot, creating a collective inteligence. They can link together and bulid structures without any central comand. The advantatge of being all modules the same is that, if one of them breaks, it can easily get replaced by another one, creating a self-healing structure.

By changing its configuration, the Dtto robot can move like a snake through a small pipeline, then transform into a wheel-like robot to move faster, then transform to a centipede robot when there is no vertical space and finally build a bridge to get to the other side of the hanging floor.

The post Dtto robot is the 2016 Hackaday Prize Winner appeared first on Embedded Lab.

Raspberry Pi Zero powered DIY skateboard

$
0
0

TheRaspberryPiGuy on YouTube shares his design of a Pi Zero powered DIY skateboard that is controlled with a Nintendo Wiimote over Bluetooth, and is capable of going 30km/h. Visit the YouTube page for details of the parts used to construct the skateboard, and the Python code for the project is posted on a GitHub page.

Pi Zero powered DIY skateboard

Pi Zero powered DIY skateboard

In the following video, you can see TheRaspberryPiGuy racing around Cambridge with his skateboard.

The post Raspberry Pi Zero powered DIY skateboard appeared first on Embedded Lab.


Raspberry Pi Surveillance Rover

$
0
0

It is always cool to have a remote control rover with a camera so that we can see where it is going and can possibly use it for surveillance. This Instructables describes the build process for a similar surveillance rover using the Raspberry Pi computer board with a camera. The rover moves around with the help of two 9V DC motors that are driven using a L298N circuit. The motion is controlled through an Android App running on a tablet or smartphone and the commands to the rover are sent over Bluetooth. The Raspberry Pi also streams a video in real-time over WiFi.

Raspberry Pi surveillance rover

Raspberry Pi surveillance rover

Using a Raspberry Pi for the on-board logic, this compact, mobile computer, will create a local port that streams a video in real-time while simultaneously creating Bluetooth sockets to read values sent by a custom android app. The app syncs with the drone and uses user input to send instructions to the drone instantly. This project is fairly difficult to make from scratch, so hopefully the following will make life easier and provide some insight for drone enthusiasts like myself. All the software used for this project is provided. The code used was originally written by myself, but a few lines might have come from other sources. Feel free to modify and share the code to your liking. Please use the information provided responsibly and have fun!

The post Raspberry Pi Surveillance Rover appeared first on Embedded Lab.

ESP8266 powered Christmas tree lighting

$
0
0

Christmas lights are an important aspect of the winter holidays in our country. Every year, we look for new fun ways of lighting outside and decorating the Christmas tree. This ESP8266 driven RGB LED lighting for Christmas tree from Evil Genius Labs is an artistic creation and possibly a good option to try if you’re bored of using the same old lighting for your tree.

ESP8266 powered RGB lighting for Christmas tree

ESP8266 powered RGB lighting for Christmas tree

The 6.5’ tall white tree gets lighted with 250 WS2811 RGB LEDs, and controlled by an ESP8266 microcontroller using the FastLED library. The animation can be controlled with a web-based app stored in the on-board flash memory of the ESP8266 board, as well as with an infrared remote control. Other features include adjustable brightness, autoplay with adjustable interval, multiple procedural animations using a fully 3D mapped layout (X, Y, and Z axes, radius, and angle), allowing scrolling and rotating in any arbitrary direction, etc.

Video below shows a demo.

The web app is a single page app with separate files for js and css, using jQuery and Bootstrap. It has buttons for On/Off, a slider for brightness, a pattern selector, and a color picker (using jQuery MiniColors). Event handlers for the controls are wired up, so you don’t have to click a ‘Send’ button after making changes. The brightness slider and the color picker use a delayed event handler, to prevent from flooding the ESP8266 web server with too many requests too quickly.

The post ESP8266 powered Christmas tree lighting appeared first on Embedded Lab.

What-to-wear weather clock

$
0
0

Plan your day with confidence using this fancy weather forecasting clock that tells you what kind of clothes you need to wear to be comfortable outside. The clock is powered by the Particle Photon IoT development board that retrieves the current weather information from forecast.io. Based on the weather forecast, the Particle board drives a servo motor to move a clock hand to point to the correct type of clothes needed.

Weather forecasting clock

Weather forecasting clock

I split the software into 2 parts: the Photon firmware to move the pointer and a hook.io script to figure out which clothes to wear from the forecast.io weather forecast. The Particle cloud acts as a bridge between the Photon and the hook.io script. The main reason for splitting is that it will be easier to continue tweaking the clothes decision code without draining the batteries in the frame by continuously reprogramming the Particle Photon.

The firmware source code is at:

https://github.com/monkbroc/what-to-wear/tree/master/firmware

The post What-to-wear weather clock appeared first on Embedded Lab.

One-button meeting call

$
0
0

How fast and easily can you call for a video conference? This fancy arcade button can do that with a single press. The button is connected to a Mac-Mini and initiates a Zoom meeting automatically, when it is pressed. It uses the Digispark Attiny85 microcontroller board that emulates an USB keyboard that signals the MacOS about the button press.

One-button meeting call

One-button meeting call

The idea is simple, we use a really cheap micro controller and a fancy button (from an arcade mashine) and simulate an USB keyboard. This simulated Keyboard doesn’t need any special software driver because all operating systems automatically have drivers included and can use it.

When the button is pressed it will signal the operating system: “there was a button pressed”. Which button to use, can be configured inside this micro controller code.

Another software tool (e.g. Automator) is used to detect a button-press similar to a user pressing a special hot key and triggers a script which finally starts the Zoom client.

 

 

The post One-button meeting call appeared first on Embedded Lab.

Wifi controlled FPV rover

$
0
0

First Person View (FPV), also known as video piloting, provides a more exciting driver’s viewpoint for controlling a RC rover by mounting a video camera. This FPV two-wheeled robotic rover is controlled over a WiFi network via any internet browser using an HTML-based control interface. It features an Arduino Uno board that controls the movement of the rover by driving two stepper motors. Arduino gets the WiFi capability with the help of an ESP-01 module (ESP8266 board). The communication between the Arduino and ESP8266 is through a serial interface. An Android smartphone is mounted at the front of the rover for live audio/video broadcasting to the operator’s control interface.

DIY FPV rover

DIY FPV rover

When the Arduino is restarted, it will try to connect your wi-fi network automatically. Use the Serial Monitor to check if the connection was successfull, and to obtain which IP was assigned to your ESP-8266 by your router. Open the html file in an internet browser (Firefox) and inform this IP address in the textbox.

You might also user other means to find out which IP address you router assigned to your device.

Disconnect the the Arduino Uno from your computer and connect it to the power bank. Wait for it to connect again.

Launch IP Webcam app in the smartphone attached to the robot. Type the video/audio IP on your control interface and connect to the server and you’ll be ready to go. You might need to reduce the resolution of the video in the app to reduce the delay between during the transmission.

The post Wifi controlled FPV rover appeared first on Embedded Lab.

ChipKIT Project 6: BME280 Weather Station

$
0
0

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 of size 2.5 x 2.5 x 0.93 mm³. Because of its compact size, ease of use (BME280 supports standard I2C and SPI interfaces), and availability of supporting open-source Arduino libraries, BME280 is very popular among weather enthusiasts. This project describes how to read barometric pressure, relative humidity, and temperature measurements from BME280 using chipKIT Uno32 to make a standalone weather station. The sensor readings are acquired over an I2C bus and are displayed on a Nokia 5110 LCD display.

BME280 weather station

BME280 weather station

Hardware setup

Nokia 5110 LCD was used in Nokia’s popular 5110 and 3310 model cell phones. It is a 48×84 pixels matrix LCD driven by the low-power PCD8544 controller chip. It is powered by 3.3V and includes on-chip generation of LCD supply and bias voltages, thus requiring minimum external components for its operation. The PCD8544 receives display data and commands from a microcontroller through a serial bus interface.

The LCD requires 5 I/O pins for full control. The pins available in almost every Nokia 5110 LCD modules are listed below:

  1. RST: Display reset input
  2. CE: Chip enable input
  3. DC: Data or Command select signal
  4. DIN: Serial data input
  5. CLK: Clock input
  6. VCC: 3.3V power supply
  7. BL: Backlight LED anode (connect to 3.3V)
  8. GND: Power supply ground

The connections between the chipKIT Uno32 and Nokia 5110 LCD are similar to what I used before in this article. The following figure shows the pin connections between the two.

Pin connections between Nokia 5110 LCD and chipKIT Uno32

Pin connections between Nokia 5110 LCD and chipKIT Uno32

There are lots of BME280 breakout modules available in the market. You can use any of them with access to the I2C pins. The SDA and SCL pins are then connected to A4 and A5 pins of chipKIT Uno32, respectively. Note that in order to use the A4 and A5 pins for I2C operation, the JP6 and JP8 jumpers on board chipKIT Uno32 must be placed in RG3 and RG2 positions, respectively. They are placed in the RG3/RG2 position to use the pins for I2C operation. The complete hardware setup for this project is shown in the following figure.

Connections between chipKIT Uno32, BME280 and Nokia 5110 LCD

Connections between chipKIT Uno32, BME280 and Nokia 5110 LCD

The actual setup of the project. The Nokia5110 LCD and BME280 sensor modules are laid out on a breadboard.

The actual setup of the project. The Nokia5110 LCD and BME280 sensor modules are laid out on a breadboard.

Software

We will need to install the following libraries prior to develop the firmware for this project.

Adafruit unified sensor library

Adafruit BME280 library

Nokia 5110 LCD library for chipKIT from Rinky-Dink Electronics, which contains two versions of the LCD libraries: LCD5110_Basic, which supports texts, and LCD5110_Graph, which supports text, graph, and bitmaps. In this project, only the Basic library is used, which can be downloaded from the following link.

Download LCD5110_Basic

 

 

The complete chipKIT program for this project can be downloaded from the following link:

Download_BME280_Weather_Station_Firmware

The program displays ambient temperature in Centigrade, humidity in %, and atmospheric pressure in hectopascal (hPa) units.

Output

After uploading the program to Uno32 board, the weather station is ready to rock. The following pictures shows the output displayed on the LCD screen.

Weather station displaying temperature, humidity, and pressure.

Weather station displaying temperature, humidity, and pressure.

Atmospheric pressure is shown in hPa unit.

Atmospheric pressure is shown in hPa unit.

The post ChipKIT Project 6: BME280 Weather Station appeared first on Embedded Lab.

Using wrist as a joystick for controlling a smartwatch

$
0
0

A modern smartwatch is a great wearable computer that can do a lot more than just tell time. It can track user’s activities, monitor heart beat rate, synchronize with your smartphone to work as its extension, navigate you, and many more. Most of the time, operating a smartwatch requires a free hand (not the one with the watch strapped on). In certain situations, such as when you are holding something in your hand, it becomes challenging to use the smartwatch. A group of researchers from Dartmouth College and the University of Manitoba has come up with a solution called WristWhirl, exploring the potential to use the same wrist that is wearing the smartwatch as a joystick to operate the smartwatch.

Controlling a smartwatch with wrist gestures

Controlling a smartwatch with wrist gestures

In this paper, they described their prototype smartwatch that uses the wrist wearing the watch as an always-available joystick to perform common touchscreen gestures. The prototype watch is built from a 2″ TFT display and a plastic watch strap augmented with 12 infrared (940nm) proximity sensors to detect the wrist gestures. The user needs to initiate a gesture with a pinch. A piezo vibration sensor is implemented for sensing the user pinch. Once the pinch is detected, the proximity sensors are activated and ready to capture the wrist motion. The gesture must be terminated with another pinch, that will deactivate the proximity sensors to save battery power. The sensor readings are collected and processed using an Arduino DUE board.

A demo video of WristWhirl is posted below:

The post Using wrist as a joystick for controlling a smartwatch appeared first on Embedded Lab.


SiLabs BGM12x is the World’s Smallest Bluetooth Module

$
0
0

Silicon Labs introduces BGM12x, the industry’s smallest Bluetooth low-energy SiP module with an integrated antenna, offering a complete, cost-effective connectivity solution with no compromises in performance. Available in a tiny 6.5 mm x 6.5 mm package, the BGM12x Blue Gecko SiP module enables developers to miniaturize IoT designs by minimizing the PCB footprint including the antenna clearance area to 51 mm2 . Applications for this ultra-small, high-performance Bluetooth module include sports and fitness wearables, smartwatches, personal medical devices, wireless sensor nodes and other space-constrained connected devices.

BGM12x: The World's Smallest Bluetooth SiP Module

BGM12x: The World’s Smallest Bluetooth SiP Module

BGM12x Features Overview:

  • Best-in-class SiP module size: 6.5 mm x 6.5 mm x 1.5 mm
  • Integrated chip antenna with exceptional RF performance (70% antenna efficiency) and an RF pad option for connecting to an external antenna
  • Output power: +3 dBm to +8 dBm supporting ranges from 10 meters to 200 meters
  • Based on Silicon Labs’ Blue Gecko SoC combining a 2.4 GHz transceiver with a 40 MHz ARM Cortex-M4 processor core and 256 kB flash and 32 kB RAM
  • Energy-efficient Bluetooth solution consuming 9.0 mA (peak receive mode) and 8.2 mA @ 0 dBm (peak transmit mode)
  • Hardware cryptography accelerator supporting advanced AES, ECC and SHA algorithms
  • Industry-proven Silicon Labs Bluetooth 4.2 stack with frequent feature enhancements
  • Rapid time to market with global RF certifications
  • Easy-to-use development tools: Simplicity Studio, Energy Profiler, BGScript
  • Worldwide application engineering support

From Silicon Labs Blog

The post SiLabs BGM12x is the World’s Smallest Bluetooth Module appeared first on Embedded Lab.

Making a simple weather web server using ESP8266 and BME280

$
0
0

Since its launch in 2014, ESP8266 has revolutionized the IoT space by offering an extremely cost-effective and programmable WiFi-enabled microcontroller to hobbyists and professionals, thereby opening the doors to all kinds of everyday objects and sensors to the internet. In addition, with it’s built-in WiFi capability, the ESP8266 can also serve as a standalone web server on a local network, and can respond to the http GET commands received from an internet browser. This project illustrates how to construct a simple standalone weather web server utilizing NodeMCU development board for ESP8266 and Bosch’s BME280 environmental sensor chip. On receiving the web requests, the ESP8266 responds back by returning back an HTML webpage containing the ambient temperature, humidity and pressure measurements. The webpage is refreshed automatically every 15 seconds to get the latest environmental data.

Weather web server using ESP8266 and BME280 environmental sensor

Weather web server using ESP8266 and BME280 environmental sensor

Hardware

This project requires minimal hardware components. You will need an ESP8266 development board, like NodeMCU that I am using here, a BME280 sensor module, a breadboard with some jumper wires, and a USB cable for programming the NodeMCU board.

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 of size 2.5 x 2.5 x 0.93 mm³. Because of its compact size, ease of use (BME280 supports standard I2C and SPI interfaces), and availability of supporting open-source Arduino libraries, BME280 is very popular among weather enthusiasts. In this project, the I2C data (SDA) and clock (SCL) pins of the BME sensor module are connected to the NodeMCU pins D3 and D4, respectively.

setupserver

Weather web server setup on breadboard

Weather web server hardware setup on breadboard

Software

The ESP8266 firmware for this project is developed using Arduino IDE. You need to install the ESP8266 core to enable the Arduino IDE for ESP8266 programming. Instructions can be found in the ESP8266 core github page or here too. You will also need the following Adafruit libraries for reading data from the BME280 sensor.

Adafruit unified sensor library

Adafruit BME280 library

The I2C address for BME280 is hardcoded in the Adafruit_BME280.h file (look for the line #define BME280_ADDRESS  0x77) inside the Adafruit_BME280_Library folder. Adafruit’s BME sensor modules are hard-wired to use the I2C address of 0x77. But the BME280 can have a slightly different I2C address (0x76) if its external SDO pin is grounded. If you are using the sensor modules from other party, it is likely that it’s address would not match with the default value in the Adafruit library. For example, for most of the BME280 sensor modules available on eBay or Aliexpress, I have found their I2C address to be 0x76. So, if you didn’t get any response from the sensor using the default address set in the Adafruit_BME280.h file, you might need to change that to 0x76.

My complete code for this weather webserver project can be downloaded from the following link:

Download BME280_webserver_code

Note that you need to edit the SSID name and password in the program to match with your WiFi network before uploading it to the NodeMCU board.

Output

After uploading the program to NodeMCU, when the ESP8266 restarts it prints out on the serial monitor the IP address it’s allocated in the local network. In order to access the ESP8266 web server, you need to open a web browser on any computer, tablet, or smartphone connected to the same WiFi network and type in the ESP8266 IP address in the URL field and hit enter. On receiving a client request, the ESP8266 serves a webpage containing the BME sensor readings, as shown below.

Standalone weather web server using ESP8266 and BME280

Standalone weather web server using ESP8266 and BME280

The HTML page is refreshed automatically every 15 second to get the latest sensor readings. The Dew Point is computed from temperature and humidity using the following approximation:

Source: Wikipedia

Source: Wikipedia

Weather web server broadcasting BME sensor readings

Weather web server broadcasting BME sensor readings

This is a very nice and handy way of monitoring the weather around us, as it allows to watch the environmental parameters on our tablets and smartphones that we are carrying all the time.

Smartphone

Weather data on smartphone

Acknowledgement

Thanks to Rui Santos from Random Nerd Tutorials for sharing his DS1820-based temperature web server code. I modified his code to incorporate the BME280 sensor readings, and also added auto-refresh Meta tag to reload the HTML page automatically in every 15 sec.

The post Making a simple weather web server using ESP8266 and BME280 appeared first on Embedded Lab.

Making an Ultrasonic Anemometer

$
0
0

An anemometer is a common instrument at a weather station. It is used to measure the wind speed and wind direction. The most common type of anemometer uses mechanical sensors consisting of three or four hemispherical cups mounted on horizontal arms on a vertical rod. As the wind blows, the cups are pushed causing the arms to rotate at a rate proportional to the wind speed. In addition, a wind vane connected to the anemometer can give the direction measurements. While the cup and vane anemometers are very popular due to their very simple design, they can be susceptible under cold and humid conditions because of their mechanical rotating parts, possibly causing the turbine to stop operating during extreme conditions. Designed without any moving parts, the ultrasonic anemometers are more reliable, maintenance free, long-lasting, and can operate in challenging weather conditions. In this article, we will review the basic working principle of an ultrasonic anemometer, and discuss about some DIY versions of ultrasonic anemometers reported by makers on the internet.

Working principle of ultrasonic wind sensor

A typical ultrasonic anemometer consists of 2 pairs of ultrasonic transducers mounted at right angles to one another as shown in the figure below. Each sensor is capable to transmit and receive ultrasonic pulses. The physical distance between the opposite facing sensors is fixed and known. During operation, the time taken for an ultrasonic pulse of sound to travel from the North (N) transducer to the South (S) transducer is compared to the time for a pulse to travel from S to N transducer. If there were no wind blowing, the two times should exactly match. Otherwise, the sound wave traveling with the wind should arrive earlier than the sound traveling against it. For example, if there is a wind blowing to N, the N to S travel time would be more compared to the S to N travel time. The difference in the time of flight can give the relative speed of wind along NS axis. Similarly, flight times are also compared along the East-West and West-East directions to compute the wind velocity along the EW axis. The two rectangular velocity components of the wind are then combined to compute the wind vector with a resultant sum and an angle of wind velocity. The sensor arrangement shown below gives only the horizontal wind speed. Measuring a three dimensional wind speed requires sensor arrangements along the vertical direction too.

Basic layout of an ultrasonic anemometer

Basic layout of an ultrasonic anemometer (Source: http://gillinstruments.com/products/anemometer/principleofoperation2.html)

DIY Ultrasonic Wind Sensors

Among hobbyists and DIY community, the cup-based mechanical sensor is the most popular choice for homemade anemometers. There are also a few resources available online to make ultrasonic anemometers. The oldest report that I could find on the internet is from Hardy Lau (Germany). He made two different prototypes of ultrasonic anemometers. His first design consist of four ultrasonic transducers arranged to perform measurements along two orthogonal directions, just like we discussed above. The distance between the opposite transducers is approximately 21 cm. It is capable to measure the horizontal components of the wind speed (up to 45m/sec with a resolution of 0.05m/sec) and the wind direction at 1º resolution. The design implements a heating mechanism utilizing four BD743 power transistors and dummy resistive loads to heat the sensors and the enclosing metallic body during extreme winter conditions to ensure that the sensor operation is not affected by snowfall and possible ice formation. The Microchip dsPIC 30F4012 processor is used to do all the control functions and computation tasks involved in processing the transducer outputs. The wind speed and direction data are available for data logging through a serial interface.

Hardy Lau's homemade ultrasonic anemometers

Hardy Lau’s homemade ultrasonic anemometers

His second prototype is a more advanced and aerodynamically more favorable design with minimum interference with wind, thereby resulting in less turbulence. Opposite facing transducers alternately sends and receive ultrasonic pulses to each other via a top sound reflecting plate, and are processed by the dsPIC33FJ128MC802 processor. For the full detail of the project, visit Hardy Lau’s anemometer page.

Control circuit board

Hardy Lou’s control circuit board

Another successful DIY design of an ultrasonic anemometer is from Carl47. His design of the sensor is similar to Hardy Lou’s first version. Carl47 implemented the phase shift method for a precise measurement of the flight times, and uses Atmega328 for processing the sensor data. You can download the full project report from the following link.

https://mysudoku.googlecode.com/files/UltrasonicAnemometer.zip

The most recent design of a DIY ultrasonic anemometer published online is by Lukas Fassler from soldernerd. He has a series of posts about his anemometer project that can be accessed here:

https://soldernerd.com/arduino-ultrasonic-anemometer

The sensing part is pretty much similar to the earlier two designs we discussed. But Lukas has designed a couple of different varieties of control board for his setup. He has one in the form of an Arduino shield and another one as a standalone board using a PIC32 processor. He even built a tiny wind tunnel using a brushless motor fan for testing his sensor. His series of tutorials on building an ultrasonic anemometer are worth reading.

Lukas

Lukas Fassler’s ultrasonic anemometer setup

PIC32

Lukas’s PIC32 based standalone ultrasonic anemometer controller

If you know any other resources on DIY ultrasonic anemometers, please let us know. You can email us at admin (at) embedded-lab.com.

The post Making an Ultrasonic Anemometer appeared first on Embedded Lab.

A DIY mono class D amplifier

$
0
0

The PAM8610 is a 10W stereo Class-D audio amplifier chip available in a 40pin QFN 6mm*6mm package. The PAM8610 runs off a 7V to 15V supply at much higher
efficiency than competitors’ ICs and requires a very few external components for operation. You can buy a PAM8610 amplifier breakout board for less than $2 on eBay and Aliexpress. This Instructables described how to use one of those amplifier modules along with a pack of rechargeable lithium battery to drive a 4″ speaker delivering ~15W of output power. The instructable describes also describes how to connect a charging circuitry for the lithium batteries for enabling charging through a universal micro USB charger.

A DIY class D mono audio amplifier

A DIY class D mono audio amplifier

This amplifier is a PAM8610, a dual amplifier capable of 15 watts per channel in a very small form factor which runs at 12v DC. As we are only going to use one output, we dont have to care about overheating issues (Anyways, the chip has high temperature detection, so even better).

In this step we only are going to solder the aux port to the board with two wires. The middle lead of the aux port is usually GND, so connect it where it says GND on the amplifier board (should be very close to the left and right channel inputs on board). Then conect either lead of the aux input to either channel input on the board. If you feel, you can solder some wires to the power in on the board (where it says +12v and gnd).

 

The post A DIY mono class D amplifier appeared first on Embedded Lab.

Laser Sky Effect using Arduino

$
0
0

Bouncing a laser beam off a spinning mirror can create an amazing light show as illustrated in this Laser Sky video by Youtube channel Normal Universe. The spinning mirror sweeps out a laser plane, which illuminates the cross sections of smoke or fog in the room and let you visualize how the air medium is moving around you in a very cool way. The spinning mirror is built out of 8 pcs of tiny plane mirrors installed on an spinning motor assembly made of a PC fan and a 3D printed mount part. The Arduino Uno is used as the main brain in the project. It not only controls the power to the laser, but also monitors the speed of the spinning mirror with a closed loop feedback system made of an optical switch (basically made of an LDR and an LED). A 3D printed casing provides a nice look and adds safety to its operation.

Laser Sky effect using Arduino, laser pointer, and spinning mirror

Laser Sky effect using Arduino, laser pointer, and spinning mirror

Following video describes the build process in detail.

The post Laser Sky Effect using Arduino appeared first on Embedded Lab.

Viewing all 713 articles
Browse latest View live


Latest Images