Write Endurance to Write Home About

Radiation tolerance, power efficiency, and fast write performance also characterize F-RAM non-volatile storage technology.

Ferroelectric Random Access Memory (F-RAM) is a non-volatile storage technology that offers low power, fast write performance, and a greater write endurance when compared to EEPROM or flash technologies. For example, the write endurance of F-RAM from Cypress Semiconductor is 10^14 (100 trillion) write cycles. Presuming the device takes 4 ms to rewrite every cell, it would take a minimum of 126 years for a failure to occur. However, EEPROM and NOR Flash have write endurance of just 10^6 (1 million) write cycles. Additionally, F-RAM data retention is very robust, supporting a minimum of 10 years, and more than 121 years of data retention at + 85 °C, depending on the individual product.

Figure 1: Technologic Systems is now offering single board computers with an added Ferroelectric Random Access Memory (F-RAM) from Cypress Semiconductor.
Figure 1: Technologic Systems is now offering single board computers with an added Ferroelectric Random Access Memory (F-RAM) from Cypress Semiconductor.

The high-speed nature of the device combined with its non-volatility and data retention makes this memory device useful in many applications. The F-RAM used in Technologic Systems’ products is an AT25 compatible SPI device. The TS-7553-V2 board support package implements the F-RAM as an extra EEPROM-like memory and presents the whole device as a flat file.

Use Cases for F-RAM

Attached as a simple memory device, F-RAM can be used to store any data an application may need to retain in either traditional RAM or non-volatile memory. Having a secondary memory device can be useful for applications such as per-unit configuration/calibration data, non-secure storage of unique serial numbers or IDs, and boot flags. Applications that can take advantage of the high write endurance of F-RAM memory include temporary storage that needs to remain non-volatile, counters that require frequent writes, or data logging applications that need to store local data logs that will be read or transmitted later.

F-RAM has also proven to be highly tolerant to radiation effects that may be experienced in airborne and space applications. Typical memories retain state using various techniques that are susceptible to corruption from alpha particles, cosmic rays, heavy ions, and gamma- and x-rays. For instance, Dynamic Random Access Memory (DRAM) stores charge in a capacitor. Static Random Access Memory (SRAM) sets a latch. And EEPROM typically stores charge in an insulated floating gate. Each of these can experience a bit-flip, or soft error, as a result of a radiation event. Because the F-RAM cell stores the state as a lead zirconate titanate (PZT) polarization, an alpha particle or heavy ion hit is very unlikely to cause the polarization to change a given cell’s state, resulting in a robust tolerance to these events.

As the number of high altitude and low earth orbit projects continues to grow, especially for small-sat/cube-sat style projects, single board computers will rely on serial I/O boot code and data logging memories. F-RAM is the robust choice for these harsh environments.

Construction and Operation

The ferroelectric in F-RAM refers to a type of crystal material that is made of tiny electric dipoles where the positive and negative charges have a slight separation. This electric polarization is a natural spontaneous state of particular types of crystals and can be controlled via the application of an external electric field. The ferroelectric property is a phenomenon observed in a class of materials such as the PZT used in Cypress’ F-RAM (Figure 2).

Figure 2: Ferroelectric PZT Crystal
Figure 2: Ferroelectric PZT Crystal

Applying an electric field across the crystal causes the position to be aligned in the direction of the field and, conversely, when the electric field is reversed the crystal will be aligned in the opposite position. The polarization will remain in its last state until an electric field is applied, allowing reliable, non-volatile memory to be constructed from these crystals.

F-RAM Operation

FRAM is constructed of ferroelectric crystals used as a capacitor dielectric in a structure similar to DRAM. Where flash or EEPROM technologies rely on a charge being trapped on a floating gate, DRAM captures its charge in a capacitor. The capacitor in the FRAM cell uses a ferroelectric material, typically lead zirconate titanate, as the dielectric. By using a ferroelectric polarized dielectric, the cell is able to maintain its current state without the constant charge current required by DRAM, and the state is able to persist even without power.

The ferroelectric capacitor symbol (Figure 3) indicates that the capacitance is variable and is not a traditional linear capacitor. If a ferroelectric capacitor is not switched when an electric field is applied (no change in polarization state), it behaves like a linear capacitor. If it is switched, there is an additional charge induced, therefore, the capacitance must increase. The ferroelectric capacitor is combined with an access transistor, a bit line, and a plate line to form the memory cell as shown in Figure 3.

Figure 3: F-RAM Memory Cell
Figure 3: F-RAM Memory Cell

The operation of an F-RAM cell is also similar to DRAM. Writing is accomplished by applying a field across the ferroelectric layer in the capacitor by charging the plates on either side of it. The direction of the charge orients the dipoles in the ferroelectric layer one way or the other. This is how logical “0” and “1” are represented.

A read operation is destructive to both DRAM and F-RAM. This means that after a read a rewrite must occur for the data to remain in the cell. In a DRAM read, the cell is drained to a sense amplifier. Next, it is determined if the cell contained a charge or not.

F-RAM is read by setting the cell to a known logical state, for example a “0.” If the cell is already in this state, then the output from the cell shows no change, and it is known that the cell was in a “0” state. However, if the cell is in the opposite state, the output from the cell is a brief current pulse as electrons are pushed out during the ferroelectric polarity switch. The internal controller will then reset the cell to the correct value to be stored back, and the read data is transferred out of the IC.

F-RAM Benefits Over Other Non-Volatile Memory

Traditional writable non-volatile memories that use floating gate technology such as EEPROM or Flash use charge pumps to develop high voltages on-chip (10 V or more) thus forcing carriers through the gate oxide. With charge pumps there are long write delays and high power consumption for write or erase operations. Additionally, the write operation is destructive to the memory cell, which limits the operating life. F-RAM’s crystalline structure does not have this sort of wear out mechanism from forcing carriers through oxides, ensuring a longer operating life. Also, the switching speed of the F-RAM’s crystalline structure supports an “instant write,” guaranteeing that when data is presented to the device the data is stored without any internal chip delay. This eliminates “data at risk” in case of a sudden power loss. The mechanism used to apply an electric field to the F-RAM structure also requires significantly less power than the power used by the charge pumps in floating gate technologies.


By Kris Bahnsen and Eliza Schaub, Technologic Systems

Originally published on eecatalog.com:
http://eecatalog.com/storage/2018/08/29/write-endurance-to-write-home-about/

Soil Moisture Sensor Example Project

Introduction

I say, if your knees aren’t green by the end of the day, you ought to seriously re-examine your life. ~Bill Watterson, Calvin & Hobbes

Green-thumbed techno junkies rejoice!  For today, we’re going to take an introductory, prototype look at what it takes to digitally monitor the soil moisture content of a common houseplant so we know when to water it.  We’re talking about using a single board computer to read from a soil moisture sensor from an Analog to Digital Convertor (ADC) and toggle an indicator LED using Digital Input and Output (DIO). Specifically, we’re going to be using a TS-7250-V2, but this guide can apply to many different boards.

Admittedly, the TS-7250-V2 is a bit overkill for the scope of this simple project, where a simple microcontroller would work, but it does provide us with a solid foundation for full-fledged autonomous garden projects. The TS-7250-V2 has five ADC channels, so you could hook it up to five different watering zones.  It also has plenty of DIO pins for controlling and interfacing with external hardware, like turning on or off water pipes for example.  Where things get really interesting is having the ability to run a web or API server from the Linux-powered board for access from anywhere in the world.  So, there’s definitely room to grow here (pun intended). With that, let’s dig in.

Things We’ll Need

Here’s a list of the items we’ll be prototyping with today:

Setting Up The Hardware

Where the rubber meets the road, or rather, where the sun meets the photosynthesizer.  We’re going to hook up our components to the single board computer.  For the soil moisture sensor, we need power, ground, and an ADC channel for the signal wire.  

In order to prevent oxidation of the probes, we’re not going to apply constant power.  Instead, we’re going to hook it up to a 3.3 VDC DIO pin so we can turn it on only when we’re ready to read what’s on the signal wire.  We’ll call this our power enable pin.  In order to visually see when power to the moisture sensor is active, we’re going to hook up a yellow LED to the DIO pin as well.  Finally, we’re going to need some sort of indicator to let us know when the plant needs watering, so we’re going to hook up a red LED to another DIO pin.  What we’re left with is something resembling the wiring diagram below.  

Notice, we’re connected to the DIO and A/D headers.  The red LED is connected to DIO_03, or GPIO #77 in software.  The power enable wire is connected to DIO_01, or GPIO #76 in software, which powers our moisture sensor and yellow LED.  A ground pin for all of our components is conveniently located on DIO_01.  After connecting everything, we can continue to software development, but before we do, let’s talk about protecting our sensor.

As we all know, electricity and water don’t get along, so before we go sticking our sensor into a moist environment, we should protect it.  For indoor applications, simply using hot glue can provide good protection.  For outdoor applications, hot glue won’t hold up to the sunshine and other elements very well, so conformal coating would be much better.  Here, we’re working with an indoor houseplant, so hot glue was used, as seen in the image below.

Okay, let’s move onto the exciting software stuff!

Programming The Software

Tighten up your thinking cap; we’re going to unearth some C code.  Now, this could very well be done in Python or another language, but we had some example C code already provided by Technologic Systems.  Also, those coming from a microcontroller world might be more comfortable in implementing their hardware in C/C++, so we’ve shaped the ground to match that sort of landscape.

Start by taking a look at the code at the embeddedarm/soil-watcher git repository.  There are several files here including the example C code pulled directly from Technologic Systems called evgpio.cand evgpio.h.  The evgpio library takes care of all the dirty details of dealing with the somewhat unique event driven GPIO of the TS-7250-V2.  This is about the only thing specific to this example project.  For other boards, you’ll need to utilize your own GPIO library.  If your board happens to use the popular GPIO sysfs interface, you’re in luck because we have example code available here in Cand here in C++.   Otherwise, refer to your board manual. With that said, let’s take a look at the main event — soil-watcher.c.

Essentially, what we’re looking at is a program that has a few functions, but primarily main(), setup() and run().  The setup() function sets everything up initially, preparing our system by turning off LEDs and initializing the GPIO pins.  The run() function contains an infinite while loop that will continually monitor soil moisture readings and control the sensor power and red LED.  The main() function simply parses command line parameters and calls setup() and run().  The other functions are mainly just helper functions.  The code was heavily commented to make it easy to digest and understand so that we don’t have to dig into too many overwhelming details in this writeup.  

Here’s what our program outputs as I leave it sit on my desk and then touch the two prongs together with my fingers:

One of the finer points of our soil-watcher.c program is the (totally optional) ability to run as a daemon. This allows us to run the program in the background so-to-speak, although what’s actually happening is a little more complex.  What we care about is that it frees up our shell as our program goes about its own way.  We can see it running by using ps ax | grep soil-watcher.

This also redirects all output that the program would normally generate to /dev/null.  So, no logging will be available using this method.

The next thing we’ll want to do with our program is make it start automatically when the system powers on.  There are a few different ways of doing this, but the most popular is to add a init.d or systemd (example) script.  For our TS-7250-V2, we’ll use init.d, as documented in the “Starting Automatically” section of the TS-7250-V2 manual.  The file has already been created for you as soil-watcher.sh.  To get it working on startup, follow these commands:

The next thing we’ll want to do with our program is make it start automatically when the system powers on.  There are a few different ways of doing this, but the most popular is to add a init.d or systemd (example) script.  For our TS-7250-V2, we’ll use init.d, as documented in the “Starting Automatically” section of the TS-7250-V2 manual.  The file has already been created for you as soil-watcher.sh.  To get it working on startup, follow these commands:

Then, when you reboot your system, our soil-watcher program should be running.

Closing Remarks

Now, the prototyping phase is over.  If you’re satisfied with this mini-application, then you could start figuring out how to enclose the system and make it look like a finished product.  

I would start by creating a false bottom in the planter in which to house the board and wiring. Then, I’d run some sort of flexible, thin conduit in which to run the wires for the LED and moisture sensor.  A hole would be drilled in the planter and the red LED mounted in that hole, so it’s visible from the outside of the plant.  Then, whenever I was walking by and seen the red LED, I would know it’s time to water the plant.

Really, this is just the tip of the iceberg.  The principles taught in this tiny project of using DIO and ADC pins are applicable to many situations and projects.  As mentioned earlier, using the TS-7250-V2 single board computer is massively overkill for this tiny project, but you now have a powerful and sturdy foundation on which to build so much more, which I hope you’ve felt inspired to do so.  

If I were to take this further, I would want to build an automated garden with five different watering zones, hooked up to relays and solenoids to control water flow.  I’d incorporate an online dashboard into the project by utilizing the Apache webserver and MySQL database to track and display historical data. With Node.js easily installable, I’d bring some IoT flare to the table by creating a REST API which I could use to monitor my soil in real time and open water valves with the push of a button on my phone.

Sources:

https://github.com/embeddedarm/soil-watcher

https://wiki.embeddedarm.com/wiki/TS-7250-V2

ftp://ftp.embeddedarm.com/ts-arm-sbc/ts-7250-v2-linux/sources/

Adventures in Home Security Surveillance with a TS-7970

As you may have seen in my TS-7970 Home Security Systems video on YouTube, I took a TS-7970 quad core single board computer and built it into my very own home security system using the open source software Zoneminder. This product works very well for the two camera system that I have hooked up. In case you didn’t get a chance to see the video, I wanted a security system that was cost effective and still worked well with the capability to expand if I so desired. I was referred to Zoneminder by a good friend and coworker of mine. Since I work at Technologic Systems I thought it would be cool to be able to use one of our boards to build up this camera system. After getting approval to use one of our boards my journey began on making my very own security system a reality.

To start out I am NOT a software developer. However, with the available user guides, and the occasional help from my co-worker friend, I got the system working. When starting out I originally used a TS-7970 solo SBC to begin my project using a board from work that I prepared as if shipping to a customer including an 8GB micro SD card. Once I got home I got to work on the project. I have to say Zoneminder has some great install guides. They take you 80% of the way when using this SBC, the other 20% was trial and error and a little help from my friend that knows Debian much better than I. Once I got set up on my computer I connected to the board using the USB B port and TeraTerm on my computer. I booted the TS-7970 up to its main prompt and began following the Install guide on Zoneminder’s wiki for debian systems:

https://wiki.zoneminder.com/Debian_8_64-bit_with_Zoneminder_1.29.0_the_Easy_Way

First thing I had to do in the system was to create a password for the root user. Once I did that I did apt-get update  to make sure I was up to date. I then installed PHP, MySQL, and Zoneminder which also included installing apache web server onto the TS-7970. To install some of those packages I had to make sure to add the Jessie backports to my sources.list file (as mentioned in the guide). It took some time to do everything in the right order and to get it to work perfect. I believe I honestly had to do this three times to get the system working how I wanted it to. Again, I remind you I am NOT a software developer so I may have done stuff on accident that a normal more software savvy individual would not have. Once Zoneminder was installed I had to create a MySQL database that Zoneminder could use. Then I had to add Zoneminder to start automatically when the board boots. To get the apache web server to work properly I had to create a new user to the sudo group. Many fine tuning settings later my board was running Zoneminder and I could hook up my cameras that I purchased.

I was able to log into the Zoneminder web GUI and setup my cameras. This is specific to your cameras that you would use. The Zoneminder web service does well and has many options to tweak, many more than what I need in fact. Once I got the system up and running I was now able to tweak the cameras to detect motion and set the resolution. Mind you this is still on the TS-7970 solo board. I noticed that the FPS on the captured frames was around 8 frames per second, which I guess is normal for surveillance systems, but I wanted more, so I swapped out the TS-7970 solo for a quad core. By doing that I had to start all over and reinstall the security system. This time I also did some port changes for the apache server to go through the router, as well as API permissions so that only authorized users can access my system from the outside world.

After getting the TS-7970 quad core board up and going I was getting 20+ FPS on my captured video, much better! I was very happy with how this project came out, I now have a security system that is running on a single board computer that could honestly be installed almost anywhere since it is wifi capable, and is capable of running in environments that other boards are not. I could see this setup being used as a standalone server in multiple locations for a business with all of them sending the captures off to a single server over the internet. All of this is made possible by the TS-7970’s powerful hardware, it is definitely a great little system for this project.

After several months of use, the system is still working flawlessly, I have now downloaded ZM Ninja from the iOS store so I could have a nice app to check on my security system with. I also have a sweet base made by one of my coworkers at our office using our 3D printer (which also uses one of our boards as a print server), I have been very happy with this product but I still wanted to tinker because our little TS-7970 quad core board had more features available to use. One thing that would have been nice is more storage to keep events longer. My friend had an amazing idea of using the mSATA on the TS-7970, so I went on a search for a mSATA drive to use on my little security project. Two days later I received my mSATA drive and once I got home I turned off the board, installed the mSATA, and powered on the board. Immediately linux recognized the 32GB mSATA device. Using this guide: https://wiki.zoneminder.com/Using_a_dedicated_Hard_Drive I followed it step by step only to run into a few technicalities of binding and mounting folders, as well as getting the drive to mount automatically. After only about an hour worth of tinkering, my system was back up and running using this fancy new fast mSATA device with tons more storage. After adding the 32GB mSATA to the TS-7970 I noticed immediately an improved playback on the video when reviewing the stored footage. I was impressed to say the least.

 

Practical Guide to Getting Started with the TS-4100

 

This practical guide gives us an opportunity to take a relaxed approach to getting started with the TS-4100 computer. We’re going to take a look at how to make our first connections, and setup the network. These are usually the first things we do before starting development. In the grand scheme of things, this is just a friendlier extrapolation from the official TS-4100 manual, so be sure to keep it handy for more advanced topics and specific details. The only assumption being made is that you’ve purchased the TS-4100 with a development kit, including the pre-programmed microSD card and TS-8551 reference board. Right then, let’s get started!

Continue reading “Practical Guide to Getting Started with the TS-4100”

Practical Guide to Getting Started with the TS-7800-V2

This practical guide gives us an opportunity to take a relaxed approach to getting started with the TS-7800-V2 single board computer. We’re going to take a look at how to make our first connections, and setup the network. These are usually the first things we do before starting development. In the grand scheme of things, this is just a friendlier extrapolation from the official TS-7800-V2 manual, so be sure to keep it handy for more advanced topics and specific details. The only assumption being made is that you’ve purchased the TS-7800-V2 with a development kit, including the pre-programmed microSD card and necessary cables.

For you TS-7800 users upgrading to the TS-7800-V2, you’re in for a treat. There’s a migration guide specifically created to help you with some of the nuances in upgrading. For this, take a look at the “Migration Path” section of the TS-7800-V2 Manual.

When you’ve finished, be sure take a look at PWM Primer with the TS-7800-V2.  Good stuff there about working with dimming LEDs and controlling servo motors.

Right then, let’s get started! Continue reading “Practical Guide to Getting Started with the TS-7800-V2”

PWM Primer with the TS-7800-V2

In this PWM crash course, we’ll be taking a look at what PWM is and how to use it by way of example. First, we’ll control the brightness of an LED and make it breathe, then we’ll control the position of a servo motor. This will all be done using the PWM channels on a TS-7800-V2.

Continue reading “PWM Primer with the TS-7800-V2”

Real World Example in Working with I2C Sensor Device

Let’s take a look at what it takes to read sensor data from an I2C interface (aka I2C, IIC, TwoWire, TWI).  In particular, we’ll be reading data from the NXP MPL3115A2 Altimeter/Barometer/Temperature sensor.  The principles found in this guide can also be applied generically, even to your ambifacient lunar waneshaft positioning sensor of your turboencabulator.

Continue reading “Real World Example in Working with I2C Sensor Device”

Example XBee Project: Opened Door Alert via Email/SMS

Imagine this: You have a five-year-old son who has grown tall enough, and smart enough to open the door to your home office, packed with all your super fun gizmos and trinkets. It has a lock, but being the lackadaisical creature you are, you forget to lock it. You’ll only be gone for a minute or two, after all! Well, that was just enough time for your son to sneak in, rip up all the jumper wires from your breadboard, find a permanent marker, and well, you know how this ends.

In this (oddly specific) example project we’re going to be coming up with a solution to avoid such a disaster by building a wireless, internet connected, SMS door alert system using:

This way, we’ll receive a text message every time the door is opened and be able to rush to the scene of the future crime.
Continue reading “Example XBee Project: Opened Door Alert via Email/SMS”

Implementing a BACnet System Utilizing the TS-7680

BACnet is a data communication protocol for Building Automation and Control Networks. Developed by the American Society of Heating, Refrigerating and Air-Conditioning Engineers (ASHRAE), BACnet is a national standard in more than 30 countries around the world, and an ISO global standard. It was created to have a unified communication system for different devices across different manufacturers. Manufacturers of BACnet devices create a wide range of monitor and control modules, from basic IO, to analog, to specialized devices such as gas monitors.

Continue reading “Implementing a BACnet System Utilizing the TS-7680”