Tag Archives: Eric Evenchick

Power line comms with an ATmega168 MCU

The average residence or business likely has a number of devices that piggyback on mains line for communication. 

Recently, Haris Andrianakis decided to design his very own power line communication system for a thesis project at the Technological Education Institute of Piraeus in Greece.

As HackADay’s Eric Evenchick explains, the basic principle of the system is to inject a signal onto the power lines at a significantly higher frequency than the 50 or 60 Hz of the AC power itself.

“Using both active and passive filters, the signal can be separated from the AC power and decoded. This system uses frequency-shift keying to encode data,” he says. 

”This part is done by a ST7540 modem that’s designed for power line applications. The modem is controlled over SPI by an ATmega168 microcontroller.”

Comms between the ST7540 modem could have also been established using UART (asynchronous), although as we noted above, Andrianakis chose SPI to establish a synchronous connection.

“After a lot of hours of SPI debugging using logic analyzer and testing different combinations I found an unusual but working method. In order to enable the Slave’s (ATmega168) SS pin to indicate SPI’s start/stop I used another pin of the same MCU and not one of the ST7540 (while it wasn’t included),” Andrianakis wrote on the project’s official page.

“So by checking the CD_PD line (carrier frequency detect line) of the ST7540 the MCU knows when there are available data for reception in ST7540. If the MCU detect available data enables the SS pin and the SPI communication starts by receiving the available data. When the data reception ends thus the CD_PD pin has changed state to indicate that there are no more available data the MCU restores the SS pin to its initial state disabling the SPI and clearing the SPI bit counter used to synchronize the communication.”

Essentially, says Andrianakis, this method is like deceiving the SPI while the same (Slave) device enables its SS pin.

Interested in learning more? You can download the source code/ schematics here and check out the project’s official page here.

Designing an Arduino-based Dahlander switch

Jean-Noel was fixing a broken Lurem woodworking machine equipped with a three-phase Dahlander motor. The trio of operation modes originally included: stop, half speed and full speed.

As HackADay’s Eric Evenchick notes, the motor uses a special mechanical switch to select the operating mode. However, the mechanical components inside the switch were broken, preventing the motor from being activated.

How to solve the problem without sourcing a new switch?

 Well, Jean-Noel decided to build his own Atmel-based, Arduino Pro Mini (ATmega328 MCU) powered Dahlander switch consisting of three relays tasked with selecting the wiring configuration for each speed mode.

Jean-Noel also added a button to toggle settings, along with two lamps to indicate what mode the motor is currently operating in.

“The Arduino runs a finite-state machine (FSM), ensuring that the device transitions through the modes in the correct order,” Evenchick explained.

“This is quite important, since the motor could be damaged if certain restrictions aren’t followed.”

Meanwhile, the state machine graph was generated using Fizzim, with the final product housed in a DIN rail case, allowing it to be securely mounted along with the rest of the wiring.

Interested in learning more about the Arduino-based Dahlander switch? You can check out the project’s official HackADay page here.

Atmel’s IoT SmartConnect is on HackADay

Atmel recently expanded its wireless product portfolio with a new family of solutions targeting the rapidly evolving Internet of Things (IoT).

Essentially, the new SmartConnect family combines Atmel’s ultra-low power MCUs with its wireless solutions and complementary software into a single package, allowing designers to easily add wireless connectivity to any embedded system. This new lineup includes Atmel’s SmartConnect Wi-Fi modules, an integration of the company’s ultra-low power Wi-Fi System-on-Chip with a Cortex M0+ ARM-based MCU, and the SmartConnect ZigBee SAM R21, a single-chip integrating Atmel’s ultra-low power ZigBee solution with a Cortex-M0+-based MCU.

Earlier this week, HackADay’s Eric Evenchick talked with Atmel reps about the new SmartConnect family. In his subsequent coverage, EvenChick wrote:

“SmartConnect moves beyond the point-to-point nature of WiFi Direct, and enables connections to standard access points. The SmartConnect series is designed for embedding in low cost devices that need to connect to a network… The first devices in the SmartConnect line will be modules based on two chips: an Atmel SAMD21 Cortex-M0+ microcontroller and an Ozmo 3000 WiFi System on Chip. There’s also an on-board antenna and RF shielding can. It’s a drop in WiFi module, which is certified by the FCC. You can hook up your microcontroller to this device over SPI, and have a fully certified design that supports WiFi.”

As Evenchick notes, there are two ways to use the module.

“The first is as an add-on, which is similar to existing modules. A host microcontroller communicates with the module over SPI and utilizes its command set. The second method uses the module as a standalone device, with application code running on the internal SAMD21 microcontroller,” he explained.

“Atmel has said that the standalone option will only be available on a case to case basis, but we’re hoping this opens up to everyone. If the Arduino toolchain could target this microcontroller, it could be a great development platform for cheap WiFi devices.”

Evenchick also pointed out that there are some notable differences between Atmel’s WiFi module and other platforms on the market.

“One major feature is the built in support for TLS and HTTPS, which makes it easier to build devices with secure connections. This is critical when deploying devices that are connected over the Internet. [Plus], Atmel [announced] improvements in power management as well,” he continued.

“The module can run straight from a battery at 1.8 V to 3.3 V without external regulation, and has a deep sleep current of 5 nA. Obviously the operating power will be much higher, but this will greatly assist devices that sporadically connect to the internet. SmartConnect is targeting a launch date of June 15, so we hope to learn more this summer.”

Interested in reading more about Atmel’s SmartConnect lineup? You can check out HackADay’s full write up here and our original Bits & Pieces SmartConnect article here.

Building a DIY hearing aid with Arduino

A Maker by the name of “Ojoshi” has designed a DIY intelligent hearing aid prototype powered by an Atmel-based Arduino Mega (ATmega1280). The project, originally posted to Instructables, was recently featured on the HackADay website.

So, just how does the DIY hearing aid prototype work?

First, the platform employs an electret to capture audio, subsequently running it through a pre-amplifier to increase the gain 100x. The next stage consists of four filters – neatly dividing the input signal by frequency into four parts, which are passed into four LTC6910 programmable gain amplifiers, allowing the Arduino to control the gain of each channel. The LTC6910 then takes three digital inputs used to set the gain value.

“To determine which gain to use for each frequency band, the Arduino needs to know how much power is in each band,” explained HackADay’s Eric Evenchick. “An envelope detector averages the signal, which can be read by an analog input on the Arduino. Using this information, the hearing aid can boost specific frequencies when it detects conversation.”

As Evenchick notes, this hearing aid won’t quite fit in your ear, although there is quite a lot of interesting signal processing/action happening on the prototype.

Interested in learning more about Ojoshi’s DIY hearing aid prototype? You can check out the project’s official Instructables page here.