Tuesday, November 14, 2017

Arduino

Best EEPROM practices

Monday, 12 October 2015 by

(this article is a work in progress). My own advice will be added later...

 

Having a system that regularly writes parameters to the EEPROM can wear out the EEPROM, since it is only guaranteed to endure 100 k erase/write cycles. Writing the parameters to a circular buffer in EEPROM where each of the elements in the buffer can endure 100 k erase/write cycles can circumvent this. However, if the system is exposed to RESET conditions, such as power failures, the system needs to be able to identify the correct position in the circular buffer again. This document describes how to make safe high endurance parameter storage in EEPROM/

Read more: http://www.atmel.com/images/doc2526.pdf

Tagged under:

DS18B20There are many Arduinods18b20 sketches on the Web that provide sample code how to work with MAXIM’s (formerly DALLAS) DS18B20\DS18S20 digital temperature sensors. However, most of them do not describe the process in details. In this article, I’m going to show the gears that make the whole thing work.

hh10d

HH10D is capacitive-type relative air humidity sensor. It is cheap (~$8) and relatively precise (±3%).

In this article I’ll describe how to connect and use it with your Arduino board.

You can download the datasheet from hoperf.com.

 

Tagged under:

Arduino and watchdog timer

Saturday, 16 June 2012 by

arduino-wdt Have you ever encountered situations when your Arduino-based device hangs?

There are many reasons for this - from millis() overflow in 49 days to moisture in outdoor sensors (causing them not to respond)...

But what if your device is not easily accessible and\or works for long periods without human supervision? Such situations should be prevented in this case. You don't want your plant watering system that you left to look after your plants and flowers during your vacation to hang on the second day, leaving your loved plants without water, really?

Most MCUs, including those used in Arduino, has a special feature, called Watchdog timer. Once it is configured, it checks for 'heartbeat' signals (or commands) that your MCU should issue. As soon as the time since the last pulse exceeds configured treshold, watchdog initiates reset sequence. This is really convenient, and ensures that your system will be in hanged state for no more than watchdog threshold.

I once encountered sudden hangs of my standalone arduino-based device. I run all possible tests, double-checked all circuitry, replaced MCU - with no effect. Finally I examined wires to external OneWire DS18B20 temperature sensor. The resistance between Vcc and GND was 600 Ohm! Then I looked through the window - it was foggy and raining... The insulation of the sensor was rather old and had a leak. As soon as I disconnected the wires leading from the sensor all problems were gone.
Semyon Tushev

I don't know, why there's not even a word about this in Arduino docs. Such things save a lot of trouble.

Tagged under:

Very often we encounter such situations when we need to save something in EEPROM. Arduino offers functions to save\read only byte values. But what if we need to store another data types, integer for instance? Sure, we need to create a simple function that will store two bytes of integer.

But wouldn't it be more loigical to have these functions integrated to EEPROM library? Thinking like that, I've modified it, and now I'm sharing my results.

When you want to measure frequency in your Arduino project most likely you'll choose FreqCounter Library. However, despite FreqCounter is very precise, it may be unsuitable in some cases - because it affects PWM outputs of Atmega microcontroller, rendering analogWrite() functions inoperable.

In this article I'm going to show how to cope with it. However, an approach described here is not just a copy-and-paste solution, it will require adaptation to your project and you will have to do some things on your own. So this way, unfortunately, is not for beginners.

Tagged under:

arduino megaThere are many signals that contain necessary information in frequency. For instance, SparkFun's HH100D humidity sensor outputs measurements via frequency signal (although it has i2C interface, those pins are used for reading calibration values. Actual measurements com via FOUT line).

 

There are two ways to measure a frequency with Arduino:

Tagged under:

As you may have noticed, each time you open or close COM port, your Arduino board resets. This may be good for development, but when you put something into production or just create an application that keeps the port open only while transmitting data, it's very disturbing.

There are two ways to prevent this from happening.

Tagged under:

Reading iButton with Arduino

Friday, 03 December 2010 by

iButtons  readerWe all are familiar with iButton devices - a small chip used as a key almost everywhere:Those keys use Maxim's (formerly Dallas Semiconductor) 1-Wire protocol. It's a nice thing and it is used in many other devices, like temperature sensors (DS18B20, DS18S20 for instance).

As it comes from the name, 1-Wire devices require only one wire for data transfer. Some devices are also capable of using ithis line as a power source. (However, one will still need another wire - for ground).You can attach a large number of devices to the same line. That's especially well when you are using Arduino - OneWire line takes only one digital pin, and you theoretically can plug all you OneWire sensors, keys etc to this line.

Tagged under:

Welcome!

Here I publish articles related to my areas of interest, my brief notes that may save some time to others, as well as some of my works.

This site is a work in progress. I will add more sections in the future, such as

  • More photos to photogallery
  • More Joomla!-related articles
  • ...

 

themeforest

New Posts

Using dynamic GeoIP module with nginx (CentOS)

nginx introduced dynamic module support in v. 1.9.11. This brief article provides step-by-step procedure...

13-04-2016 in Linux, BSD, Unix

READ MORE

Visual difference between pseudo and true random data

This is is "random" image generated using PHP rand() function: And this is an image...

20-11-2015 in Blog

READ MORE

Best EEPROM practices

(this article is a work in progress). My own advice will be added later...   Having...

12-10-2015 in Arduino

READ MORE
Scroll to top

We use cookies, just to track visits to our website, we store no personal details Privacy policy