Sunday, November 6, 2016

Converting Serial Cable for UNI-T UT61E to USB

A while ago, I bought a UNI-T UT61E  to replace my 20 year old DMM, so I was very pleased about the new features compared to my old meter. The cable supplied with the multimeter is only RS232C and because neither my desktop nor laptop have such a port, no further investigation was done.

While cleaning up my desk, I found the software CD of the UT61E and it reminded my of the lacking USB connection for my DMM. So I checked to see if this could be upgraded to USB.

Sure enough I found this article and it looked simple enough to make the conversion myself.
Well, after tinkering around and trying to implement the same schematic, I couldn't make it work.
Not with a CH340 nor with 2 other models of PL2303 USB-serial converters. No matter what I did, the serial monitor would produce only garbage.

So, I decided to give it another go and go back to basics. I checked around what I had lying around in my stock and found a couple of DIL and SMD packages of 74HC02 and 74HC04.
Schematic using logic gates
I first mounted everything on a breadbord using the DIL package and experimented with the correct resistance R1. It turned out to work just fine with 1kΩ. The header CON1 is connected to the corresponding pins of the USB-Serial converter (CH340 or equivalent). It works both on 3.3v and 5v.

Next step was to depopulate the original pcb inside of the IR-receivr. I only kept the IR-diode.
 
I then put some kapton tape on the backside of the board and soldered everything as tested on the breadboard. I replaced the standard through hole components by SMD components. I reused some solder pads on the PCB as mount points for my cable. This also fixated the floating HC04 chip.
I kept 3 of the 5 wires. Brown = GND, White = VCC, Yellow = RX (actually TX, but it connects on the RX pin of the USB-serial converter).

After careful mounting and sealing of the IR-receiver, I was able to slide it back into place. As you can see, the setup with logic gates only takes minimal space inside the enclosure.

Because the UNI-T UT61E software only recognizes comports 1-4, I installed my CH340 USB-Serial converter on COM3. It works like a charm 

Saturday, November 5, 2016

Converting my Arduino Mini Pro NRF24L01+ datalogger for low-power use

 I have been running a datalogger on my Raspberry Pi for a couple of years. It receives measurements from other devices in my home using a NRF24L01+ transceiver. Reasons to use this technology are mainly :
  • cost 
  • isolation from internet/intranet
There are 2 types of clients sending data to the Datalogger :
  • Other Raspberry clients
  • Arduino Mini-Pro  
I did some experiments when I first tested the NRF24L01+ transceivers but I never managed to make the clients really low-power such as to make them independant from mains power.
I did some experiments with the Watchdog timer in order to put the Arduino in to PowerDown mode, but I never got satisfied with the battery life of the setup. I could cut down power to a level where my 3v NiMH (2200 mAh) could last approx 3 weeks.I use 8 WDT cycles of 8s in order to send ambient data approx. every minute to the central gateway.

This weekend I jumped back in to the power optimisations and here are the results :
  • Mode 1 : Running unmodified Mini-Pro (with powerled, LDO)
  • Mode 2 : Running Mini-Pro with powerled removed (1-1,5 mA saved)
  • Mode 3 : Running Mini-Pro with powerled and LDO regulator removed (-50%)
  • Mode 4 : Optimizing software in order to put NRF24 module in Power Down


VoltageMode 1Mode 2Mode 3Mode 4
3.3v1700 uA123 uA71 uA6,94 uA
3.2v1601 uA105 uA60 uA6,50 uA
3.1v1492 uA93 uA50 uA6,17 uA
3.0v1400 uA66 uA41 uA5,90 uA
2.9v1295 uAN/A33 uA5,67 uA
2.8v1188 uAN/A27 uA5,42 uA
2.7v1086 uA46 uA22 uA5,32 uA
2.6v985 uA41 uA17 uA5,16 uA
2.5vUnstableUnstableUnstableUnstable
The sequential gains were enormous.

The Power LED

The Power indicator LED on the mini-pro was eating away quite a substantial part of the energy budget, so this was easy to remove. Removing the series resistance was easy.

The LDO Regulator

The second surprise was the LDO sitting between VIN and VCC. As I power the Arduino directly from the VCC pin, I wasn't aware that the output of the LDO was somehow sinking 40-50% of the remaining energy budget. Since there wasn't a jumper on my board, I decided to unsolder the LDO.

NRF24 issues
When comparing the energy use of the arduino without the nRF and with the nRF, I noticed a substantial power use by the nRF24 (71µA total current= 5,5µA Arduino + 65,5µA nRF24).
2 observations :
  • No use of radio.powerup or radio.powerdown in my code 
  • Excessive power consumption (60µA instead of 22µA in Standby Mode)
After adding the necessary radio.powerUp() and radio.powerDown() commands in my code, I couldn't see any difference in my measurements.
On the website of Nordic Semiconductor I found a forum post talking about excessive power consumption and it seemed to be related either to faulty soldering or ESD damage.
So I decided to throw out the module in use and replace it by a brand new one from my stock.
And guess what. Power consumption dropped dramatically. The nRF module went finally into PowerDown mode and only consumed approx. 1µA in this state.
The final result was a staggering 7µA @3,3V downto 5,4µA @2,8V. Below this voltage, the reading of the 1-wire temperature sensor becomes unstable and at 2,5V the reading is impossible.

I'm currently testing my module  on a Li-ion battery (3.6v - 2400mAh) and logging the battery voltage in my ambient sensor data.

I'm curious to see how the battery behaves.

Tuesday, August 16, 2016

TIM and Vodafone Customer Service experience - some ramblings

I have been using the Telecom Italia mobile network for years. The connectivity was more or less ok, until I discovered last year that the 3G was very saturated and the 4G not really present with sufficient bandwidth.
As you could read in my post about using a 3G key on my Openwrt router, the performance of TIM absolutely bad whereas Vodafone would give me descent speeds, even in 3G. So I switched to Vodafone.
This year my experience was a bit different.
First I had to deal with a Vodafone sales point in Lecco, that tricked me into buying a new SIM-card in order to activate my 10GB 4G deal. I lost 15 € in the process, 10 € for the new SIM plus I couldn't reuse the 5€ pre-existing credit on my old SIM. When trying to speak to the helpdesk, the operators were quite knowledgeable about procedures but the procedures are a rip-off. You can move credit from one SIM to another, but it costs 5€. If you deactivate a SIM, you can claim the residual credit and transfert it to another SIM. This can only be done in a Vodafone sales point, so I kept this for some other time.
In the meantime I had my Galaxy S5 act as a Wifi hotspot and it worked like a charm. Except 1 little detail : the 3 mobile phones, 1 tablet and 2 laptops were consuming close to 1GB a day. I had to find a solution to extend my 10GB allowance for data. I could activate a voice SIM with a contract and double my volume or I could buy another 10GB at Vodafone.
After my bad experience in the sales point I decided to have a look at other mobile operators. I was underwhelmed by the mobile coverage of Tre and Wind in my region, so I was stuck with either TIM or Vodafone.
I decided to give it a go with TIM and went to one of their resellers in Lecco. Oh boy, was this a mistake !
Here's what I planned to do : buy a Mifi (Huawei 4G LTE) and get 20GB of LTE data traffic for 1 month for free. I needed a Mifi anyway in order to free up my S5 and the prices where very competitive (79,90€ for the Huawei, SIM included, 1 € credit after activation, 20 GB of free data volume for 1 month).
First 1 had to battle the shop, because they were pissed because I was better informed than they were. They tried to trick me into buying an additional data plan, on top of my free 1 month promo.
The following week, was a week of misery :
- after 48h there still was no data plan active and the 119 was still sending me back to the shop ;
- the shop would send me back to the 119 ;
- I finally gave on the 119 and began to tweet on the Customerservice of TIM (day 4) ;
- Customer service on Twitter seems to behave like a robot service redirecting dialogs to private tweets. But I would never get replies on my private tweets, so I had to send a couple of angry public tweets with hashtags pointing to terms like 'fake', 'rip-off' before I eventually got a real human answer on day 5 (they opened a ticket at the technical customer service).
- On day 7 I received a phone call from an operator confirming the activation of Data plan, the reimbursement of 4€ incorrectly charged when I inserted the sim-card in my Huawey on day 5.
In the meantime, I survived by putting my Vodafone SIM into my Huawey (and changing the APN accordingly).
How could I survive that long without a proper dataplan ? Well, luckily Vodafone didn't get their act together and when my data volume exceeded my allowed 10GB, my Huawey remained happily connected to the tower station. And it remained until the end of day 7, consuming 17GB on a 10GB dataplan. And it only stopped because the kids disconnected the Huawey from the charger and the device ran out of juice.

In the meantime, I'm on TIM again and I was actually surprised by the good 4G coverage in the area. Being in a pre-alpine region, it's not obvious to get a good 4G LTE coverage. Any way, I wasn't expecting any descent coverage, but to my big surprise the signal is quite strong.

Big thumbs up for Telecom Italia. Their sales points are a catastrophy and their 119-operators seem to lack a working brain, but at least the second level helpdesk performed well and their network is solid.