Thursday 30 January 2020

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?


I am using arduino pro mini (which contains Atmega328p AU) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I am wondering if I can use cc2541 itself for processing data in order to remove arduino from circuit, so that I can save power and money. I am quite new to electronics domain. Please suggest any ways to achieve it.




Wednesday 29 January 2020

batteries - Is it OK to reduce the charging current for a Li-ion 18650 battery?


I am using NCR18650 batteries with the tp4056 charging module.


When I connect the charger at 2.8 V (fully discharged), the tp4056 IC is getting hot at a 1 A charge current. Is it OK to reduce this charge current by changing the charge current selecting resistor? So the tp4056 IC heat would be reduced, wouldn't it?


For my application I don't need a quick charge. With a low current, charging time will be increased, but it does not matter for my application.


Will reducing the charge current affect the battery's lifetime? Or will it damage the battery?


I am trying to reduce the heat of the tp4056 IC by reducing the charging current, maybe from 1 A to 500 mA or less. The 18650 battery never heats for a 1 A charge current.



Answer



I use TP4056 charger boards a lot, both on their own and embedded in some devices. In addition to existing answers, I'd like to mention this - it's OK for TP4056 to heat up, it's a linear charger and it heating up doesn't impact its performance/reliability all that much. As long as the board has proper heatsinking, you should be fine - i.e. the popular "blue PCB with USB port" chargers from China have good enough heatsinking, as they tend to connect the ground pad of the TP4056 to copper-filled areas on both layers (sometimes only one, bottom one, with vias).


If it's a custom board that you yourself designed and it doesn't connect the ground pad to anywhere useful, only then I'd be worried - in that case, swapping the current set resistor for ~2K (that's what you need for ~500mA IIRC) should do the job. Otherwise, you should be fine as you are now, with 1A charging.


microcontroller - Help with this protocol - LCTC


I have a 640x200 monochrome display from a HP 200LX palmtop computer. On its PCB I can see two types of ICs: HD66204TFL and HD66205TFL from Hitachi.


Here is its schematic (it has 200 px not 240 as in schematic) from datasheet: enter image description here



Here is the protocol (from datasheet):


enter image description here


enter image description here


I figured it out that CL2 is the highest frequency clock. At every falling edge of this clock 4 pixels in a column are selected and they output according to D0-4. So it has 160 cycles for a full row.


CL1 falling edge selects a row so it must have 200 cycles for filling the display, one cycle (falling edge) at the end of every 160 cycles of CL2.


I can't figure out what FLM and M do. As far I understood they both mark a new frame. And it needs both signals ?


So my display needs a 4 bit data port and 4 clocks and DISPOFF connected to GND.


So far all I could find on the internet (similar displays but not this one):



  1. I read somewhere (don't know where) that this protocol is called LCD Timing Controller.


  2. http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=49684

  3. http://mikestirling.co.uk/2009/02/mono-stn-display-on-an-avr32-ap7000/

  4. http://www.mikrocontroller.net/topic/92704#new


And could this display be controlled by Arduino? I don't have one (yet) so for my experimets I will use PC parallel port (the 8 bit DATA port) on Ubuntu (I've successfully used it before for I2C with Claudio Lanconelli's EasyI2C and software implementation written by me in Qt C++ for reading an I2C EEPROM and controlling a RF Modulator).


Any help is appreciated!



Answer



Note that (unlike the LCD that you used via I2C) this is a typical controller-less LCD: it expects (needs!) a constant stream of data to work properly. 640x200 bits = 16000 bytes. Do you have that amount of RAM to spare? If so, the next problem is whether you can drive the signals at sufficient speed. Probably doable, but not easy. Might require assembly or very careful C/C++. Analyze the datasheet to find out how fast you must drive the LCD.


The M signal inverts the polarity of the drive to the LCD, to avoid a DC aspect in drive signal, which would destroy the LCD.


solar cell - Difference between indoor and outdoor PV panels


I am building an energy harvesting sensor for building installation, and I have to choose between two panels:





  • Indoor, 5V, 47uA Isc @ 200 Lx




  • Outdoor, 6V, 15.9mA Isc @ 50 kLx (note the different light level rating)




Given that they have similar dimensions (negligible difference for the application), one would say that the indoor panel would be more efficient with narrow band light such as the one generated by a lamp.


The problem is that this last detail is not included in the technical data sheet, as it's not included the I-V curve, that can however be traced from measures or taken from models.


Now, the strange thing is that the outdoor panel has shown a better performance (in terms of power given at the MPP) under the same - indoor - light conditions; this test has been done in a working environment, that should be lighted at about 500 Lux; the lamps are probably fluorescent, and probably with a quite good "white" light. Also with shading (a hand above the panel) the outdoor one gives more power.


Now we decided to use the outdoor, but can you find a reason for that? And what would be (apart from price) the advantage in using the indoor panel?




Answer



As Olin Lathrop pointed out the durability of the panels is the major difference. If the final sensor is going to be placed indoors then considering the indoor panel is realistic.


First a comparison of efficiency based on the specs you provided: The indoor panel provides about 1.18 W/lux while the outdoor panel provides about 1.91 W/lux. If there is a concern over providing enough power for the application the outdoor panel might provide the extra power needed.


Next I took the efficiency numbers and combined them with cost to obtain a metric of (W/lux)/UnitCurrency. Since purchase volume has an effect on the price I have calculated the metric for both single unit volume and maximum discount. The indoor panel is about 46% less expensive than the outdoor panel at single unit volume. At 250+ units the cost difference reduces to about 18%.


I would seriously consider the indoor panel if it would meet the power requirements. If the final sensor product will include a durable case, the argument for the indoor panel grows stronger.


Power-on Reset for CD4017 gives unexpected results


In the circuit below, a 555 timer produces approximately 1 pulse per second, and the CD4017 counts pulses. The initial state of a CD4017 is undefined, thus I need a reset pulse on power up. In the circuit, that is a 4.7uF capacitor between Vdd and the Reset pin, and a 10k resistor from the Reset pin to ground.
enter image description here As I understand it, when the power is first applied, the capacitor has no charge. Until charged, it has effectively zero resistance, causing the Reset pin to go HI. Then it charges, giving it high resistance, and the 10k resistor pulls the Reset pin LO.


That's the theory, anyway, according to various circuits I have studied around on other sites. Since it is used a lot, I assumed it was a standard technique.


But what I see in practice is:




  1. Turning on the power when the circuit and power supply has been turned off for awhile causes the Q0 LED to light briefly, then it quickly jumps to Q1.

  2. If the power has been on, then I quickly turn it off then back on, the Q0 LED lights for a full second, then Q1 lights, the way I want it to always work.


Confession: the indicator LEDs are not actually as I have drawn them above. I prototyped this circuit on a PAD-234A, which has eight buffered LEDs, and I just used those. One buffered LED circuit (from the PAD-234A schematic) is as follows: enter image description here


Any ideas on why I see this behavior? Is there a better power-on reset for a CD4017?




Buck converter worked for 1000+ start/stop cycles with power from regulated DC power supply, failed with li-ion battery



I have a project which uses a TI step down converter (LMZ14201) to buck an input voltage (up to 41V) down to a regulated 5V. Until now, I had successfully used an adjustable (regulated) DC power supply for testing. In that setup, the step down converter worked like a charm.


Today I proceeded to assembling the complete system (i.e. using a lithium-ion battery pack, 36V, as the input for the buck converter). For testing purposes, I further connected a switch between the positive rails of the buck input and the battery.


With nothing else changed, the buck converter failed (produced sparks coming from under the package; thermal/GND pad?) on the second time connecting the battery. What could be the issue here?



  • I diligently followed the recommended layout depicted in the datasheet of the DCDC converter

  • I tested voltages up to 41.6V with the power supply. The aforementioned battery pack had 36V (approx. nominal voltage), the power supply is rated up to 42V (recommended) and 43.5V (abs. max) respectively

  • The input capacitance connected to the buck converter is 3x4.7uF. Apart from that, there were no input filter elements separating the battery pack and the converter


Could possible inrush current (caused by switching/input capacitors), paired with stray/parasitic inductance be the culprit here? If yes, a viable solution would be a series NTC current limiter. What other causes could this have, apart from random part failure?


UPDATE: This problem is reproducible. Changing the soft start delay to 10ms did not help either. I managed to capture the voltage transient at the battery terminal. The battery voltage is about 37V, but it seems to swing up to 50V as soon as the DCDC is connected to the battery. The absolute maximum rating of 43.5V is therefore not satisfied anymore.



Battery Voltage Scope Capture


This does not seem to happen with just the input filter caps connected, but only when the input filter caps and the DC/DC converter IC are connected.



Answer



I understand why you see the initial fast droop, because the electrodes in the battery are quite complex electrically:


schematic


simulate this circuit – Schematic created using CircuitLab


At the application of the load, an EDLC forms at the electrodes and the capacitance can be enormous - 60μF to 100μF is not unusual (the effective plates are literally Angstroms apart) with a sub milliohm ESR and that gives you a very effective differentiator at initial transient loading of the battery into a heavy load.


Once the EDLC has formed, it stops conducting and the only resistance is the ESR of the battery electrodes themselves. As the terminals recover to being limited only by load and internal ESR, there can be an inductive effect (after all, self inductance exists anywhere current flows, to a greater or lesser degree).


Your waveform looks like a damped resonance, so an appropriate snubber may work.


You can see how EDLCs form at battery electrodes in this paper.



I have seen this effect a few times and it was quite confusing the first time it appeared (in a seawater activated circuit).


operational amplifier - Deriving the formula of oscillation frequency for the Phase Shift Oscillator


My aim is to find the oscillation frequency of a Phase Shift Oscillator.


enter image description here


I start by finding transfer function of the cascaded RC network.


$$ V_o(s) = \dfrac{\dfrac{1}{C_3s}}{R_3+\dfrac{1}{C_3s}} V_2(s) = \dfrac{1}{1+R_3C_3s} V_2(s). $$


Similarly,


$$ V_2(s) = \dfrac{1}{1+R_2C_2s} V_1(s) \quad\text{and}\quad V_1(s) = \dfrac{1}{1+R_1C_1s} V_i(s). $$



Then the transfer function is:


$$ \begin{array}{lcl} H(s) = \dfrac{V_o(s)}{V_i(s)} &=& \dfrac{1}{(1+R_1C_1s)(1+R_2C_2s)(1+R_3C_3s)} \\ &=& \dfrac{1}{R_1R_2R_3C_1C_2C_3s^3 + \dots} \cdots \\ && \dfrac{}{(R_1R_2C_1C_2 + R_2R_3C_2C_3 + R_1R_3C_1C_3)s^2 + \dots} \cdots \\ && \dfrac{}{(R_1C_1 + R_2C_2 + R_3C_3)s + 1} \end{array} $$


So the frequency response is:


$$ \begin{array}{lcl} H(j\omega) &=& \dfrac{1}{j\omega \left[ (R_1C_1 + R_2C_2 + R_3C_3) - R_1R_2R_3C_1C_2C_3\omega^2 \right] + \dots} \cdots \\ && \dfrac{}{\left[ 1 - (R_1R_2C_1C_2 + R_2R_3C_2C_3 + R_1R_3C_1C_3)\omega^2 \right]} \end{array} $$


Now, we are looking for a special \$\omega\$ value, \$\omega_0\$, for which the argument of \$H(wj)\$ will be \$\pm180^o\$. Clearly, it happens when


$$ R_1C_1 + R_2C_2 + R_3C_3 = R_1R_2R_3C_1C_2C_3\omega^2 \Big|_{\omega=\omega_0}. $$


Hence we find the oscillation frequency as


$$ \begin{array}{rcl} \omega_0 &=& \sqrt{\dfrac{R_1C_1 + R_2C_2 + R_3C_3}{R_1R_2R_3C_1C_2C_3}} \\ \text{f}_0 &=& \dfrac{1}{2\pi} \sqrt{\dfrac{R_1C_1 + R_2C_2 + R_3C_3}{R_1R_2R_3C_1C_2C_3}} \end{array}. $$


When \$\quad R_1=R_2=R_3=R\quad\$ and \$\quad C_1=C_2=C_3=C\quad\$:


$$ \text{f}_0 = \dfrac{\sqrt{3}}{2 \pi RC} $$



However, according to all online articles including Wikipedia, the formula for the oscillation frequency is


$$ \text{f}_0 = \dfrac{1}{2 \pi RC \sqrt{6}}. $$


I did an experiment with the exact circuit I attached above with \$R=1k\Omega\$, \$C=100nF\$, \$R_i=1k\Omega\$ and \$R_f=33k\Omega\$ by using TL084 opamp. I observed the oscillation period as 7.4ms.


According to the formula I derived above, it should have been


$$ \tau_0 = 2 \pi (1k\Omega) (100nF) / \sqrt{3} = 362.76 \text{ns}. $$


And according to the other's formula, it should have been


$$ \tau_0 = 2 \pi (1k\Omega) (100nF) \sqrt{6} = 1.539 \text{ms}. $$


Finally, my questions are:



  1. Why is the formula I found above is different than the other's formula? Where did I make the mistake? Did using a an extra opamp for buffer affect it?


  2. Why does the period of my oscillator differ so much from what the both formula say?




arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...