Sunday, July 28, 2013

Silvercrest (Lidl) EIM-804 'digital weekly timer' teardown

I purchased up a few Silvercrest brand EIM-804 'digital weekly timer'  from Lidl two years, with some sort of hackery in mind. And finally I found a use for one. So I tore one apart.



There are two PCBs: one on the bottom which deals with power related matters and one attached to the top lid which is the user interface (UI). The PCBs are connected with a 3 wire ribbon cable.

The power board comprises a fuse, mains relay, relay drive circuit and a low voltage (1.2V) power supply and backup battery (cell) for the user interface board.



The UI board comprises an application specific Chip-on-Board (COB) IC, a custom LCD mated to the PCB by a zebra strip and contact pads for rubber buttons. It's connected to the power PCB by a 3 wire ribbon cable. Two wires for power (1.2V) and one (labeled 'D' on the PCB) for relay control. I found if this was left floating the relay was on and if I drive it to 0V the relay was switched off.


There isn't much that can be done with the UI board and the application I have in mind will require a separate MCU to control the relay. So I unsoldered the ribbon cable from it.

I am hoping to use the low voltage power supply to power my application. So I took a shot at reverse engineering the schematics of the power board:



So it seems there are two DC power rails: a 24V rail set by zener diode DZ1 (a 24V 1N4749A) which together with Q1 is used to energize the relay coil. A second power rail is derived from the 24V rail and is set by DZ2 and provides 1.2V for the UI PCB and the 1.2V backup battery.

The relay is controlled by line D. It's interesting to note that the Q1 (a SS9014 NPN) is a high gain transistor, so it doesn't take much base current to cause the relay to activate.  If D is left to float then the small current that flows through R4 (about 73µA) is enough to activate the relay. If D is driven to 0V then that current is directed away from Q1 causing the relay to deactivate.

D2 is the usual fly-back diode which absorbs the voltage spike due to the sudden interruption of current through the relay coil. Diode D1 protects Q1 (and the driving logic) from excessive current if D line is high.

The purpose of D3 (I guess) is to prevent the 1.2V battery from draining through EC2 etc when the device is unplugged.

One important observation about the 1.2V low voltage rail: the 0V is not ground. It will vary between 0V and +24V relative to the ground/neutral line. Therefore you must optoisolate it if interfacing to external circuitry. The following is a scope trace from the 1.2V line on the ribbon cable. Connecting this to external (grounded) logic devices is likely to damage it.


So my plan is to use this device with the UI PCB removed and a Lite-On LTV-817S opto-isolator with the output connected to the D and 0V line of the ribbon cable. The relay will be on by default. Passing a current through the isolator's input LED will cause the relay to switch off.  More on this another time...


Friday, July 26, 2013

DIY thermal labels

My thermal label tape cartridge for my Brother P-touch 65 label printer recently ran out, and I was horrified at the cost of a replacement cartridge – almost the cost of the printer itself (which includes a label cartridge!).

So I tried a little experiment one night to see if I could make this thermal label tape myself. I have loads of rolls of thermal paper from some prototype work I was doing a few years ago which involved a thermal printer. So I took a about 1m of thermal paper and using a ruler and box-cutter cut it into (approx) 9mm wide strips. Next I opened the tape cartridge (it wasn't too difficult ... no tools needed... but be careful not to break it).



I used a bit of sticky tape to mate my new thermal tape to the spool. It's important to note which is the top surface of the thermal paper (btw: I have it the wrong way up in this photo!).

I spooled the tape, closed the cartridge case and put it into the printer.

The first try wasn't very successful.  The cheap thermal paper I used is quite thin and the capstan roller wasn't getting enough purchase on the tape to pull it out of the cartridge: [1]




By gently pulling the tape while printing I managed to get a clean print.  But the other problem was the paper was facing the wrong way, so the print was a mirror image of what it should have been:



Then I remembered I had a roll of high quality (thicker/heavier) thermal paper. So I tried that, got the orientation right and finally got a good result.


Am I going to use this hack? Probably not. A few problems: First it's rather labor intensive cutting the strips and spooling it up. Second there is no sticky surface... so you'd need to glue this on to whatever you're labeling. Also regular thermal paper doesn't age well when exposed to the elements ... it's likely to fade in less than a year, especially if exposed to direct sun light. But I thought it was still interesting enough to write up on the blog.

Foot notes

[1] The capstan roller is squeezed against the paper when the printer lid is applied. A wedge on lid squeezes the roller against the paper. It's possible that additional pressure can be applied to the paper by widening that wedge (eg by adding a few layers of duct tape).

Tuesday, July 23, 2013

Offline YouTube videos on your Android mobile device

So you going somewhere with time to kill, but with slow internet, or no internet. There are many YouTube videos you'd like to watch.... but can't.

It's a common problem while travelling or on vacation. There are many solutions. Here is my solution. This is for Linux people with an Android mobile device who are running a Linux computer somewhere (home, office, in the cloud, or a Raspberry Pi).  I'll refer to this computer as the 'server'.

So the idea is I use Bit Torrent Sync to communicate between the mobile device and the server. BTSync is handy because it's peer-to-peer and doesn't require any firewall configuration.

  1. Install Bit Torrent Sync on the server and run it (you'll probably want to configure the server to start this automatically on boot).
  2. Create a directory and generate a shared key for the directory. 
  3. Install Bit Torrent Sync for Android on the mobile device
  4. Create a directory and assign the key created in step 2. You can do this using QR codes.
  5. Install a simple text editor app on the Android device if you don't already have one. I use Jota.
  6. Download and install youtube-dl tool on the server if you don't already have it.
  7. Download the youtube_fetch_daemon.sh script. Review it and satisfy yourself it does what you expect it to (it's less than a screen of code). Then run it and let it continue to run. Or set it up to start on boot.
So let's say you're in an airport waiting to board. You have access to moderate WiFi, but would like to download a few videos to watch on the flight. This is how to do it:

  • Navigate to the video in the YouTube app.
  • From the menu chose 'Copy URL'.
  • In the Android text editor paste the URL and save the file as a .txt file in the directory created in step 4. This file will now transfer to your server and will cause that YouTube video to download.
  • After allowing a suitable amount of time (depending on the quality of the connection on the server and the size of the video), use the BTSync app to view remote files. If you see the video there, touch that video and it will start to download to your device.
  • Use your video player to play off local storage.
Edits:
28 July 2013: Link to youtube_fetch_daemon.sh script fixed.

Tuesday, July 9, 2013

The effect of temperature on the efficiency of photovoltaic panels

A few years ago while arguing about the economic viability of photovoltaic (PV) electricity in Ireland I learned that the ambient temperature can have a significant impact on the performance of the PV panels and it is an important variable in return-on-investment calculations. The lower the temperature the more efficient the panels. [1]

Today we have a rare heat wave in Ireland, so I thought it was a good time to see this effect for myself. I recorded the experiment on video. What I've got here are 2 x 15 watt peak (rated) panels charging a 40Ah sealed lead acid (SLA) battery and a Raspberry Pi [2]


Conclusion

At the start the panels were reading 55°C (read from a non-contact thermometer) and were delivering 710mA of current to the battery/Pi system. After pouring water to cool the panels the temperature dropped to 42°C and the current rose to 820mA. I'm going to use current as a measure of efficiency here [3]. So that's about 14% efficiency increase for a 13°C drop in temperature.

Footnotes


[2] It's a Raspberry Pi Model A (the one without ethernet or inbuilt USB hub). I've got an external unpowered hub connected to the model A's sole USB socket and to that a WiPi WiFi dongle and a Arduino Leonardo.  A 12/5V DC/DC car converter down converts the 12V to the 5V required by the Pi. The current draw from the Pi at the 12V end of the converter is 210mA.

[3] Measuring and extracting power from photovoltaics is not a trivial topic.