Simple circuit indicates health of lithium-ion batteries

Fritz Weld @ proposes a simple circuit to check li-ion battery health. He writes:

Lithium-ion batteries are sensitive to bad treatment. Fire, explosions, and other hazardous condition may occur when you charge the cell below the margin that the manufacturer defines. Modern battery chargers can manage the hazardous conditions and deny operation when illegal situations occur. This fact doesn’t mean, however, that all cells are bad. In most cases, you can replace the discharged battery and increase your device’s lifetime. Figure 1 shows the circuit for testing battery packs.

Simple circuit indicates health of lithium-ion batteries – [Link]

Exploring Eagle CAD ULPs #6 – Group-aps_v4.ULP Autoplace by Group

Welcome to the 6th post of the “Exploring Eagle CAD ULPs” series. Each post will be discussing one useful ULP in Eagle CAD.

“ULP” User Language Program is a plain text file which is written in a C­-like syntax and can be used to access the EAGLE data structures and to create a wide variety of output files. You can think about it as a plug-in for Eagle.

You can reach the posts published in this series using the following link.

In the previous post we explored Place50 ULP which places all parts of the board to the position in the schematic. Place50 moves all parts of the board, but sometimes we need to do this auto-placement for just a certain group of parts. Beside that, we can’t change the position scaling factor in Place50. Group-aps_v4 ULP overcomes these two points of limitation in Place50 ULP by doing the auto-placement by group, and having user defined position scaling and offset.

To use Group-aps_v4 ULP first download it from Autodesk website. Before running it in the schematic editor, you need to define a group of parts first.

Group-aps_v4 has a simple dialog to enter scale and offset values.

Scale is used to scale the value of original position (X and Y) of the parts in the defined group in the schematic. While X,Y offset is used to offset the final position of the part in the board after scaling it. For example, if scale was 0.5 and the position (in mil) for the part is (500,100) then is will be considered as (250,50).

Group-aps_v4 ULP originally places the group in the calculated position of the the first part. So as an output, all parts will have the same X and Y and that’s not effective. So i made a simple edit to the ULP to solve this issue. You can download the updated version N_group-aps_v4.ulp.

Fast Single-Pixel Camera

Compressed sensing is an new computational technique to extract large amounts of information from a signal. Researchers from Rice University, for example, have built a camera that can generate 2D-images using only a single light sensor (‘pixel’) instead of the millions of pixels in the sensor of a conventional camera.

This compressed sensing technology is rather inefficient for forming images: such a single-pixel camera needs to take thousands of pictures to produce a single, reasonably sharp image. Researchers from the MIT Media Lab however, have developed a new technique that makes image acquisition using compressed sensing fifty times more efficient. In the example of the single-pixel camera that means that the number of exposures can be reduces to several tens.

One intriguing aspect of compressed sensing is that no lens is required – again in contrast with a conventional camera. That makes this technique also particularly interesting for applications at wavelengths outside of the visible spectrum.

In compressed sensing, use is made of the time differences between the reflected light waves from the object to be imaged. In addition, the light that strikes the sensor has a pattern – as if it passed through a checkerboard with irregular positioned transparent and opaque fields. This could be obtained with a filter or using a micro-mirror array where some mirrors are directed towards the sensor and others are not.

The sensor each time measures only the cumulative intensity of the incoming light. But when this measurement is repeated often enough, each time with a different pattern, then the software can derive the intensity of the light that is reflected from different points of the subject.

Source: Elektor

Raspberry Pi Publishing MQTT Messages to ESP8266

Rui @ tipped us with his latest tutorial. He writes:

In this project you’ll create a standalone web server with a Raspberry Pi that can toggle two LEDs from an ESP8266 using MQTT protocol. You can replace those LEDs with any output (like a relay that controls a lamp).

Raspberry Pi Publishing MQTT Messages to ESP8266 – [Link]

StromPi, The Uninterruptible Power Supply for Raspberry Pi

It seems evident that the Raspberry Pi and its clones have filled an enormous hidden need. The digital performance of such micro-computers is exceptional as long as they are used without any special dependence on power requirements, that is to say near an electrical outlet with power! Faced with the vagaries of the analog world, these tiny cards that fit in the palm of your hand are not as beefy as that. Their dependence on their power supply has highlighted a new need, well identified by the manufacturer JOY-iT. StromPi, their adaptable uninterruptible power supply (UPS) mini card lets you use a Raspberry Pi under conditions of unusual or unstable power, without taking up much space, and without risk of data loss in case of a power cut.

Two working modes are offered:

  • UPS (uninterruptible power supply), i.e. no break power
  • WIDE, which allows an extended range of input voltage

With the following characteristics

  • wide range of DC input voltage, from 6 V to 61 V in WIDE mode
  • 5 V power input on microUSB connector
  • maximum USB output current of 3 A
  • very low standby current
    • (in UPS mode): 20 to 80 μA (that’s between 175 mAh and 700 mAh per year)
    • (in WIDE mode): 3 to 7 mA

In the case of loss of power, the StromPi backup power card not only starts the process of data backup before the Pi is switched off, but it can also guarantee startup once the power is restored (this function may be deactivated with a jumper strap).

When that happens, you can even select to be informed by an email sent by the Raspberry Pi program (which you can download).

Source: Elektor

Robot Core – The Ultimate Raspberry Pi Robot Controller

The Robot Core, which is a robot control board for the Raspberry Pi and Arduino, brings many different elements into one awesome package. It allows you to efficiently control motors, servos, and read sensor data without needing 3-4 additional boards to hookup. Several Robot Core boards can be connected together in a linear series to add even more functionality.

The Robot Core board
The Robot Core board

Robot Core uses I²C (Inter-Integrated Circuit) to communicate with Raspberry Pi. I²C is a widely used serial computer bus invented by Philips Semiconductor. It is a very easy-to-use two-wire bus that your Pi has no difficulty talking with. A built-in level shifter ensures compatibility to both 3.3 volt and 5 volts I²C buses. The Robot Core supports all Raspberry Pi boards (the past and present versions) and some Arduino boards also.

Now, let’s talk about the technical details.

Software Support:

The board has software provided in the form of libraries and python example programs to get you started fast. Thanks to Second Robotics for making the software Open Source. All required resources will be available in July 2017. Currently, available links are – Drivers and LibrariesSupport Documents.

Software for The Robot Core
Software for The Robot Core
The Robot Core Python Script
The Robot Core Python Script

Motor Drive:

This board provides up to two 5 Amp continuous load DC motor outputs that can be used as a pair to drive a single stepper motor. The Robot Core’s built in safety protection prevents overheating and detects the motor failure.

Servo Control:

The Robot Core can set servos to exact position with the help of 16 bit PWM signal. It has eight ports for both analog and digital conventional servos. You can tune each servo using software-based GUI tuning method and also set their start-up positions individually.

Two ports are provided for connecting Dynamixel servos. Connecting multiple Dynamixel servos at the same time is supported. All functionalities are accessible by simple low-level commands. Many example python codes are available there to get started with Dynamixel servos.

Ultrasonic Sensors:

You can connect up to 4 ultrasonic sensors (HC-SR04) with the board. Given libraries convert measured distance into millimeter. The Robot Core board can provide filtered outputs with higher accuracy or raw outputs with greater speed, the choice is yours.

Analog Input:

Up to 8 12-bit analog inputs are supported for sensors or feedback. Each input has a range of 0-5V and the board also provides protection from exceeding the input limits. The additional analog reading for main power voltage lets you monitor supply voltage in real-time. The Robot Core has configurable warnings for low power.


The range of input voltage is 6.4v to 14v. An onboard DC-DC regulator is there for generating 5 volts, capable of providing 6 Amps current to the load. Optional separate power supply inputs for servos and for Dynamixel servos are also present.

Other Technical Information:

  • Clear on-board labeling. Each port and screw terminal has its pins labeled.
  • Prototyping space for adding more functionality. This space removable to make the board smaller.
  • Easy to access voltage rails.
  • Access to the Raspberry Pi I²C at 5V logic level.
  • Status LEDs are for main power voltage, DC motor status, and script controllable status.
RobotCore board details
Robot Core board details

Application Of The Robotcore Board:

The Robot Core is an all-in-one solution for many projects. One can do pretty much any autonomous and/or robotics projects with this board. The possibilities are endless. Below are just some example projects:

  • A smart plant monitoring system that reads ambient light, temperature, plant moisture, and even uses two water pumps to water two different plants.
  • Using a single board, you can build a 2 wheeled robot with a ring of 8 analog ultrasonic sensors and a strong Dynamixel smart servo arm.
  • With an IMU (Inertial Measurement Unit) tied into the I²C bus, you can create a two-wheeled self-balancing robot.
  • Build a biped walker robot with sensors to navigate based around the board and a Pi using powerful servos or Dynamixel smart servos.
  • Make an automated greenhouse. Have analog sensors for light, temperature, carbon dioxide, moisture, water leaks, and also control two water pumps.
The Robot Core plant watering system
The Robot Core plant watering system

Know your Tool – Optimize C Code for microcontrollers

One of the talks in the “Embedded Linux Conference 2016” was about best practices to optimize C for microcontrollers. This talk deserves to be mentioned to Electronics-lab readers.

The presenter Khem Raj worked on Comcast’s (broadcasting and cable television company) reference design kit for STB, Gateway and IoT platforms.

We will cover some important points that have been suggested by the presenter:

Optimization Levels

Optimization in compilers in general (GCC is the one in Khem’s case) has different levels (5 Levels: Os, O1, O2, O3 and Og). Os is for size optimization while O1, O2 and O3 are for performance.

Optimization Levels - From Khem’s slides
Optimization Levels – From Khem’s slides


Linker which is an important tool in microcontrollers’ software toolchain, is mentioned in Khem’s talk.

Linker script is written in the linker command language and controls the memory layout of the output file (what goes where). Moreover, Linker can output a map file which is very useful when you want to track down references to symbols in the MCU memory.

Linker Script File - From Khem’s slides
Linker Script File – From Khem’s slides


GNU GCC has a collection of binary tools; they are called (binutils); and objdump is one of them. It interleaves your assembly code with source code so you can do disassembling using it.


Talking about best practices with variables. If the concept of local, global, volatile, const and static are blurred for you, then watching this presentation will clarify them besides other important terms.

Khem also mentioned special integer types in C99; they are “fast” and “least” types. So you can allocate your variable like that:

  • Fixed width unsigned 8 bit integer uint8_t
  • Minimum width unsigned 8 bit integer uint_least8_t
  • Fastest minimum width unsigned 8 bit integer uint_fast8_t

To ensure portability of your code, Khem advised to use portable datatypes using uint{8,16,32,64}_t type declaration. This avoids effects of changing size of int type across different processors (compilers).

Using global and local variables is another concern. Khem advised to use local variable as much as possible. Global variable needs to be loaded from memory and stored back every time it is used. So if you use a global variable in a loop you will have multiple loading and storing operations.

Khem’s presentation has other tips about: array subscript Vs. pointer access, loop increments Vs. loop decrements and other stuff. Make sure to watch the presentation, all of it!

Screens become speakers, smartphones can lose micro-speakers

by Graham Prophet @

Redux (London UK) has followed earlier announcements of its surface-wave-based haptics technology with a version specifically targeted at the smartphone, with which it aspires to “kill off smartphone micro-speakers”.