Progress Report – Hall Transistor based Level Measure

Below you will find a progress report video. The video shows a demonstration of my work-in-progress project that I have mentioned, at least the 3D Print portion, in previous posts. The actual product is a powder level alerting system used in reloading. While reloading, if a case’s powder level is out of Tolerance, a beeper will sound. The firmware is written in C and C++ and while I am testing on an Arduino Nano the final product will be on a surface mounted ATTiny85. In fact all but two components on the circuit board will be surface mounted.

The only output on the device is a beeper and the only input is a single push-button. Despite this limitation I can change nine different settings based on the duration of the button press. The main body of the code uses a state machine with non-blocking code with the exception of routines that decode button presses and sound button press related beeps, which do use blocking subroutines.

I now consider the firmware to be complete. Next, I must start on the printed circuit board design and then fabrication. Once the product is finalized I will post an update. The entire product, both hardware and software, will be released open source when it is final. That is probably some months away.

By the way, I almost threw in the towel on this project because I could not get the hall effect transistor to be stable. After much frustration and, ultimately, a great deal of investigation, I discovered that the problem was that, during debugging, I was powering the Arduino device using a USB cable while also sending out debug serial ASCII text messages over the same cable. Apparently using serial data over the same USB cable that provides power was introducing sufficient noise to destabilize the hall effect transistor. Once my project switched over to a standalone power supply instead of using the USB cable, the hall effect transistor became stable. The final product will run off of a 1/2-AA battery. This bug should be of interest to anyone doing embedded system design – be careful about supplying serial data over the same cable that provides power.


Posted in Uncategorized | Leave a comment

Revisiting+ WLX-652 e/w SnakeOS

NOTE: This was originally a May, 2015 post but I just revised it today, June 26, 2016.

Back in 2012 I wrote about the SnakeOS flashed WLX-652 device ( See Original Post ). As I said then, I actually purchased it back in 2010. It’s hard to believe it but that thing has been sitting on a shelf for five years.

WLX-652 Overview

WLX-652 Overview

Well, if you have read back in my blog you’ll be aware that I have in interest in IP-Cameras. I have a couple of cameras on my property that are aimed at my mountain view. I intend to add another on my chimney so that I can look for roof damage when I am away from home. This is because, during last February I was in another state for a month and during that time 77-mph winds ripped off part of my roof and then dumped snow on top of it. That is another  story for a another time and a different forum.

I share the URLs for my cameras with friends and give them the guest passwords. However, for some time I have wanted a way for them to be able to see several cameras at once, in a secure way yet without passwords. I felt that I needed a local server where the login/password process is hidden from prying eyes yet all the cameras could be simultaneously viewed in a web gallery.

It occurred to me that the venerable little WLX-652 might be sufficient for the job as my local webserver for my camera web gallery. It is! I described what I did below, but first, here is a screen capture of the web gallery that the WLX-652 serves up.

Capture of Gallery

Capture of Gallery hosted by WLX-652

SnakeOS is based on BusyBox and contains BusyBox HTTP Daemon (httpd) so it can host web pages. I knew that my web page needed to have any complexity on the client side so PHP was out. I searched for simple photo gallery software that only used HTML and JavaScript. I found what I was looking for at Dan Doicaru’s HTML-TUTS website (more later).

With SnakeOS you define the WWW folder in the admin section “Services->Webserver”:

webbase The folder /usb/snake1/www contains the gallery HTML code “index.html” and the folder “cgi-bin”.

Before I could work on the HTML, I needed to develop a CGI that would fetch snapshots from each IP-Camera and store them on the USB stick plugged into the WLX-652. I decided to write my CGI in shell script, which, on the WLX-652, is the fairly fully featured “dash” a derivative from Linux’s Debian distribution. A copy of the cgi script is at the bottom of the post, below the word ‘UPDATE’.

Here is what the current HTML “index.html” looks like:

<!DOCTYPE html>
<link rel='shortcut icon' href='favicon.ico' type='image/x-icon'/ >
<title>Connestee Falls North Carolina Cameras</title>

<style type="text/css">
body {
	background: #222;
	color: #eee;
	margin-top: 20px;
	font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
a {
	color: #FFF;
a:hover {
	color: yellow;
	text-decoration: underline;
.thumbnails img {
	height: 80px;
	border: 4px solid #555;
	padding: 1px;
	margin: 0 10px 10px 0;

.thumbnails img:hover {
	border: 4px solid #00ccff;

.preview img {
	border: 4px solid #444;
	padding: 1px;
	width: 800px;


<script type="text/javascript" src="cgi-bin/fetchimg.cgi"></script>
<script type="text/javascript"></script>

<div class="gallery" align="center">
	<h2>Camera Snapshot Gallery</h2>
	<br />

	<div class="thumbnails">
		<img onmouseover="preview.src=img1.src" name="img1" id="img1" title="Camera Undefined" src="" alt=""/>
		<img onmouseover="preview.src=img2.src" name="img2" id="img2" title="Connestee West ONVIF" src="" alt=""/>
		<img onmouseover="preview.src=img3.src" name="img3" id="img3" title="Golfcourse View" src="" alt=""/>
		<img onmouseover="preview.src=img4.src" name="img4" id="img4" title="Connestee West Neighbor"src="" alt=""/>
		<img onmouseover="preview.src=img5.src" name="img5" id="img5" title="Camera Undefined" src="" alt=""/>

	<div class="preview" align="center">
		<img name="preview" id="preview" src="" alt=""/>


var img2elem=document.getElementById("img2");
img2elem.src= "images/" + img2;
var img3elem=document.getElementById("img3");
img3elem.src= "images/" + img3;
var img4elem=document.getElementById("img4");
img4elem.src= "images/" + img4;
var previewelem=document.getElementById("preview");
previewelem.src= "images/" + img3;

To maintain the website, I keep a folder on my desktop that is a duplicate of what is on the WLX-652’s WWW folder. Mostly edit the files on my desktop and use SSH to scp files back and forth. However, SnakeOS includes vi so, using ssh it is easy to edit files right on the WLX-652’s usb drive.

By the way, SnakeOS contains a functional cron and, briefly, I considered using it to periodically download the IP-Camera images.

My admiration for the WLX-652 has grown significantly. Who would have thought – a complete local webserver fetching and hosting images of multiple IP-Cameras for the current  total cost (including postage) of $33USD! The Raspberry-Pi would be what most folks would turn to for this task but it would cost significantly more (after case and PS added) and, quite frankly, is overkill for hosting a website like this.

UPDATE: A ‘like’ from reader of this blog, kittenswithselfies, caused me to read through this post once again and realize that it needed an update.

Occasionally, the WLX-652 would have its USB file system get trashed and I would have to rebuild it. I eventually tracked down the problem when I realized it only happened when after the WLX-652 had been powered down. Apparently, it was occasionally being powered down while a write was still in queue. Adding a ‘sync‘ command to the cgi script cured that problem. Next, I realized that I did not post my current, changed, the cgi script in this post. Consequentially, it is now posted below (with login/password and URL changes, for privacy):


# Written for WLX-652 Snake-OS
# Version 2.2
# NOTE: Verify that the following path is correct!
# Changing the usb stick can change this


rm ${photodir}*.jpg
sec=`date +%s`

echo "Content-type: text/javascript"
echo "var sec = '${sec}'"

# Fetch FI8904W Outside porch Camera still image
wget -q -O ${photodir}${cname}${sec}.jpg http://${camera}:${port}/snapshot.cgi?user=${username}\&pwd=${password}
echo var img1 = "'${cname}${sec}.jpg';"

# Fetch C6F0SeZ3N0P0L0 h.264 Outside IPCAM (lil Abner)
wget -q -O ${photodir}${cname}${sec}.jpg http://${camera}:${port}/tmpfs/snap.jpg?usr=${username}\&pwd=${password}
echo var img2 = "'${cname}${sec}.jpg';"

# Fetch Community's Axis Outside camera
wget -q -O ${photodir}${cname}${sec}.jpg http://${camera}:${port}/axis-cgi/jpg/image.cgi?resolution=800x600&camera=1
echo var img3 = "'${cname}${sec}.jpg';"

# Fetch Neighbor's FI8918W Indoor Camera
wget -q -O ${photodir}${cname}${sec}.jpg http://${camera}:${port}/snapshot.cgi?user=${username}\&pwd=${password}\&count=0
echo var img4 = "'${cname}${sec}.jpg';"

Posted in ARM, Electronics, hardware, IP-Camera, Linux, Programming, software | 3 Comments

SMS from Arduino

A few weeks ago I was chatting with my mail carrier who is also a beekeeper. I mean LOTS of bees with some hives in remote locations. He has a friend that is working on a system that weighs hives and sends data over WiFi to a beekeeper’s desktop computer or server. The most important data is the hives weight although temperature and humidity are also useful. This system is good when the hives are close to structures with usable WiFi but useless in more remote sites where there is no accessible WiFi. I suggested that his friend investigate using cellular telephone SMS text messages instead where many more hives could have their data monitored.

I mentioned that I have just been reading about a small printed circuit board that could be used with an Arduino that would be perfect for remote beehive monitoring. It is an evaluation board called “SIM800L EVB”. They are available on eBay in the $6-to-$10US range. I purchased mine from Philippines seller “holi_day_sales“. I was careful to purchase a version that has on-board voltage regulation for that I could use five volts. Some versions have USA frequencies and others are for Europe of Asia. Caveat Emptor – they are NOT all alike! They were also available from Seeed Studio but they currently seem to be out of stock. In any case, Seeed’s wiki is useful. A remote solution is possible if the hive has at least one bar of AT&T cellular telephone coverage allowing communication by SMS (TEXT). Such a solution would have a reduced parts count to a single microcontroller, such as an Atmel ATtiny84 (Prototypes could use an Arduino board), sensors for weight, temperature and humidity, A solar panel with battery and charger would provide power.

I’m not sure if my mail carrier’s friend will pursue using SMS text messages for his hive monitoring system but, nonetheless, I became interested in testing the little “SIM800L EVB” board, which is exactly what I did this afternoon. I’ve only done a little testing but the SIM800L performed with flying colors. It is very easy to work with. I cheated a bit and relyed on Ayoma Wijethunga’s excellent blog article titled “QUICKSTART SIM800 (SIM800L) WITH ARDUINO“. You need little else to get started with the “SIM800L EVB”.

For my tests I used a H2O Wireless GSM SIM card. Specifically, it uses the AT&T GSM cellular network but is marketed by H2O Wireless at $10 for 90-days of service at 5 cents per text message sent or received. That allows two text messages to be sent per day. They also sell more expensive plans should more data be needed. I surmised that, by omitting extraneous characters, a single text message could easily hold a hives weight, temperature and humidity. For example, a hive weight of 125 pounds at 72 degrees Fahrenheit and 30% humidity can be represented by the nine character string “125072030” using three digit positional data of three characters each representing “Weight in pounds”,“temp in Fahrenheit”,”Humidity in percent”. Given that a single SMS message can contain 160 characters, a single message has another 151 characters available for other data, should it prove necessary. One possibility would be to have one message represent the data of 17 bluetooth networked co-located hives that share a single SIM800L board.

So, below are images of one of my tests. I am sending a simple “Hello World” type message from the SIM800L board to my Android smartphone. I sent “Hello,World from Seed” because I used the Seeed library, but the SIM800L module is NOT a Seeed module.

sim800L / Arduino Setup

sim800L / Arduino Setup

By the way, the test setup shown above has some extra components and wiring present because they are for something else that I am working on and I wanted to leave them in place for that project. Also, the little rubber-duck antenna is propped in a vertical position by the blue Ethernet cable that also has nothing to do with this project.

sim800 Arduino Program Output

sim800 Arduino Program Output

SMS Received by my phone

SMS Received by my phone

I should point out that there are commercial products that do something somewhat similar, although at a price that may exceed all but large commercial businesses. For example, see:

Posted in Arduino, cellular, Electronics, hardware, Programming, SMS, wireless | Leave a comment

EASYCAP analog to digital Video Encoder for Linux

A couple of days ago while attending a meeting of the Western North Carolina Linux Users Group (WNCLUG) someone asked if anyone knew how to get an EASYCAP analog to digital Video Encoder fob working on Linux. I’ve posted a photo of an EasyCap below. A few years ago I used an EASYCAP on Linux to transfer some old VHS tapes to my computer. While I haven’t used the EASYCAP in years, I still had the files that I used to make it work on Linux.

My EASYCAP was purchased from eBay several years ago. Its only physical marking is “EasyCap”

lsusb shows:
Bus 002 Device 003: ID 05e1:0408 Syntek Semiconductor Co., Ltd STK1160 Video Capture Device

The first step in getting an EASYCAP working on Linux is, of course, to throw the included Windows driver CDs into the trash. I performed the transfers using two very simplistic bash scripts (one line scripts). Here is the “how”:

I have a folder with a bunch of files, mostly because I needed to compile ffmpeg from source because it was missing from the repository, but the following worked for me:

#! /bin/bash
mencoder tv:// -tv channel=0:driver=v4l2:device=/dev/easycap1:normid=6:input=0:chanlist=us-cable:width=720:height=576:brightness=0:contrast=0 :hue=0:saturation=0:buffersize=16:alsa:amode=1:for cechan=2:audiorate=48000:adevice=plughw.0,0:forcea udio:immediatemode=0 -oac mp3lame -ovc lavc -quiet -lavcopts acodec=mp2:abitrate=128:vcodec=mpeg4:vbitrate=1072 -lameopts cbr:br=128 -o ./capture_vid.avi

I needed to de-interlace the output so I also used this script:

# Deinterlace eacycap recorded file
ffmpeg -i Recording -target NTSC -deinterlace -sameq DeInterlaced.avi


UPDATE: There are several version of the Chinese EasyCap devices. I discovered a great resource for dealing with each of the variants. See the link below:

Quote | Posted on by | 1 Comment

Amazing Little $9 Computer

Yesterday, the postman delivered my $9 CHIP computer that I ordered in June, 2015 as a KickStarter pledge. It cost $9 for the CHIP Computer plus $5 in shipping. My pledge read:

C.H.I.P. Get learning and making on your very own $9 computer. Includes one C.H.I.P. and a composite cable for maximum bare-bones enjoyment. – SHIPPING IN FEBRUARY –

The CHIP folks were true to their word – my CHIP arrived when promised, in February 2016 – February 16, 2016, to be exact. My CHIP board included not only the  composite cable but also the “case“, which is a translucent back for which they normally charge $2 extra.

We are talking tiny here – the photo below shows the CHIP next to a business card:

CHIP beside Business Card

CHIP beside Business Card

I wanted to test it but I had to make do with scrounged peripherals. I no longer own a portable TV monitor with a composite video (yellow RCA jack) connection. Anticipating that I would need one for the CHIP, about a month ago I ordered cheap video-to-vga converter on eBay.

Video to VGA Converter

Video to VGA Converter

Next I discovered that the CHIP has only one USB port so I realized that I would need either a USB port HUB or a keyboard with a builtin mousepad. I own a little, clunky, seldom used wireless handheld keyboard with a builtin mousepad for a little computer that I have plugged into my television. Last night, I retrieved the wireless handheld keyboard and charged it for use today.

Handheld Wireless Keyboard/Mouse

Handheld Wireless Keyboard/Mouse


Today, I tested the CHIP $9 computer. First, a caveat – CHIP documentation recommends using a powered USB hub when connecting multiple USB devices as it is easy to overload the CHIP’s USB current capability. I suspected that the wireless (2.4GHz) fob for the wireless handheld keyboard might overload the CHIP’s USB current capability and I was right – the CHIP shuts down during testing, as can be seen by the blue screen of death at the end of my video at the link below. Nonetheless, the CHIP comes pre-loaded with a minimal version of Debian Linux, referred to as the CHIP Operating System. In the video, my very slow typing is because I am having trouble finding the keys on the clunky little wireless handheld keyboard.

The CHIP is quite responsive with basic menu commands and the terminal but really bogs down when browsing the web with the iceweasel browser. I don’t know if that is due to the CHIP’s WiFI, minimal RAM or what. Frankly, I am rather impressed that it can do it at all!

My ultimate plan for this device is to use it as a tiny webserver. I’ll have to see if it can handle the load. If not, for $9 it is a fun toy.

The CHIP’s Debian-based pre-installed Linux uses Synaptic to install software. It uses the debian jessie repository. Obviously, anything in the repository can be installed, although memory size may be a problem for some applications.

Ok, it’s a cool gadget but it is NOT a desktop. I don’t believe the goal of CHIP is to use it as a desktop. The pre-installed Linux is, in my opinion, just something to play with out of the box. Most people, myself included, will probably remove the GUI and use it as a small, special purpose server OR totally replace the firmware with something useful to a project of theirs. The Raspberry Pi comes closer to a desktop solution but it too is really under powered for that. A nascent device that claims to be suitable as a desktop is the “Pine A64” SBC that will become available in March for $15. By the way, I have also ordered a Pine A64!

Here is a YouTube video of my first test – it shuts down at the end due to USB current overload:


UPDATE: I came up with a 5V 2.5 Amp power supply (Raspberry Pi) and, with this power supply the CHIP is rock solid.

Posted in ARM, computer, Electronics, hardware, Linux | Tagged , | 1 Comment

Comparison of my 3D filament print to two Commercial Services

I have an ultra cheap 3D printer. It does ok, even though it needs some adjustment as things have gotten loose with use. Anyway, I printed an object that I am going to use in a project of mine. The part is threaded 7/8X14NF and has a narrow 1.6mm slot adjacent to a 1/4-inch hole.

The part printed with my One-Up 3D printer is usable, if not pretty. Since it was usable I could have stopped there, but I wondered how it would look if it were professionally printed. So, I had two services print me units. The two services were 3dHubs and Shapeways. The commercial pricing, including shipping, was around $6 per item, from both suppliers.

Rendering of model

Rendering of model

The simplest thing to do is watch my short video (link below) – you can visually compare the results. Oh, by the way, ALL three prints were usable but one is more professional than the other two.

Visual Comparison Video


Posted in Uncategorized | 2 Comments

Is a $30 smartphone worth buying?

Is a $30 smartphone worth buying?

I recently purchased a Posh Orion mini blue Model s350a smartphone. Although Posh Mobile lists a MSRP of $80 I cannot imagine anyone paying that much. It is readily available on eBay for under $30. I paid $29.77 for mine, including shipping, and I have seen them for even a little less (see image below). The Posh Orion s350 is a dual-SIM GSM phone supporting 4G/HSPA speeds. It runs Android 4.4.2. It’s a small phone with a 3.5 inch LCD. The rear camera is pretty decent with 5MP. The front facing camera is 1.3MP but I haven’t tested it yet (I don’t do selfies or Skype). It has a 1GHz dual-core processor. It comes with one 1,200mAh battery, wall charger e/w cable, earphone/microphone cord, instruction pamphlet and screen protector. The dual SIM capability is important for my travels. One SIM will be a AT&T Prepaid SIM and the other SIM will be my global SIM. I can pick the SIM to use based upon where I am.

The biggest grievance is the phone’s memory. It is a pathetic 256Mb RAM of which only a fraction of that is available to the user. Fortunately once you add an SD card, up to 32 gigabytes, the phone resorts to the SD card for most storage. The battery also seems a bit lame. The phones specifications claim a 10-to-380 hour battery life. Although I haven’t tested its duration, indications are that ten to twelve hours of my average use may be difficult to obtain – we’ll see. Another annoyance is the open-source Android Keyboard (AOSP) that lacks the microphone icon for speech to text entry. I temporarily installed the Google Keyboard but couldn’t get its microphone icon to work. I gave up and went back to the AOSP keyboard.

I live in a rural area and Verizon is the only reliable service. AT&T has marginal coverage while T-Mobile and Sprint have no coverage. My primary smartphone is an LG running Android version 4.4.2 CDMA phone on the Verizon network. Consequentially, my new Posh Orion mini blue Model s350a won’t work well at my home.

So why, you might ask, would I purchase such an inadequate phone on such a marginal network for where I live. The answer is that I did not buy it for where I live. I purchased it for international travel. For years I have used my travel phone which was in HTC Google Nexus One. It is a 3G only GSM phone running Android version 2.3.7. It was great in its day but is growing inadequate. My motivation was stimulated by some new apps that I want to use while traveling that will not work on the old HTC Google Nexus One. I needed a more modern phone with at least Android 4 installed. Since the new phone is just for travel, I didn’t want to spend much money on it and it only needed to run a few critical apps in addition to the ever present email and browser app. Therefore the posh s350 appeared to adequately fill the bill.

When I received the s350 I discovered that the lack of memory was a great hindrance for installing the apps that I wanted. Basically I installed one app and no other apps would install, failing with a lack of memory error. After doing everything I could think of to free up memory (stopping apps, clearing data & cache, etc.), I screwed up the phone to the point that I needed to do a factory reset. Afterwards, I approached app installation in a different and far more successful way.

Memory could be freed up if I could root the phone because then I could remove unwanted apps, like the music player, and, more importantly, I could move the apps to SD residency instead of internal memory. Alas, I tried all methods that I could find and none of them worked. I tried kingroot, kingoroot, motochopper and another that I have forgotten. The ALL failed! Therefore, my phone is NOT rooted. Darn!

Installing multiple apps from Google Play was NOT a viable option. I think this was due to the Google Play app taking up some internal memory for execution, downloading the new app into internal memory consumed more, and trying to install the app consumed yet more internal memory. This exhausted internal memory. My successful method was not to install via Google Play but rather to download to SD the APK files for the apps that I wanted and install them to SD manually. This method was very successful and I installed the five apps that I was interested in. The Posh pre-installed apps (browser, email, TXT, etc.) are adequate for all of my other needs.

While the s350 seems well suited for my travel application, I feel it would be very inadequate for most smart phone users. One consumer group who may find it of interest would be economy minded users who had little need for applications beyond those that are pre-installed. Otherwise the phone is fine, adequately fast, decent camera, sharp screen, nice size.

Technical Details:

Hardware : MT6572
Model : S350A
Build number : S350A_POSH_V13.0_20150430
Build date UTC : 20150430-075517
Android v : 4.4.2
Baseband v: MOLY.WR8.W1315.MD.WG.MP.V43.P11, 2014/08/21 16:44
Kernel v : 3.4.67 (android@localhost) (gcc version 4.7 (GCC) ) #1 SMP Thu Apr 30 15:51:43 CST 2015

Posh S350a ebay ad

Posh S350a ebay ad

Posted in cellular, wireless | Tagged , , , | 1 Comment

A Revisit of the PT2262 PT2272 with Arduino and r06a Receiver

A year ago, on July 19th, reader Jeff posted that he had an inexpensive Chinese motion detectors that used the 2262 chipset. He was having some trouble getting it working with the r06a receiver as in my July 2012 post – HERE. It seems that I must look at 2262/2272 every July?

Anyway, almost a year ago I purchased a cheap Chinese PIR motion detector similar to Jeff’s. (See Figure 1 below). The purchase was just a whim to satisfy my curiosity about this type of PIR sensor. Jeff’s, however, was the now more common 9-Volt version. The one that I purchased operates on two 1.5V AA batteries. Of course mine is in 433MHz to match my existing r06a receiver.

I have uploaded a short video on YouTube where you can see a very short clip of the motion detector transmitting the event that is then received and displayed by my Arduino r06a test setup. Watch the video at

My 3V version is still for sale on eBay but you have to look for them. Use “Wireless Pet Immune Infra Red PIR Motion Detector” in eBay search and they’ll pop up. The 9V version typically sells for significantly less than the 3V version – ~$4 versus ~$13. The listed specifications also show a shorter battery live for the 9V version than for the 3V version – 6-months versus 1-year. So take your pick – long battery life or lower cost.

Wireless Pet Immune PT2262 PIR Motion Detector

Figure 1: Wireless Pet Immune PT2262 PIR Motion Detector

As is usually the case with unbranded, inexpensive Chinese electronics, documentation is minimal, critical critical circuit board legends are missing and there are indications of imperfect work. Than said, as is also usually the case with unbranded, inexpensive Chinese electronics, it works!
I was rather flummoxed by the simplest electrical issue – battery polarity. The Chinese wired the battery compartment such that the positive lead was colored BLACK and the negative was colored RED. This is in violation of all accepted norms and practices and I was concerned that I would fry the circuit if connected that way. I poked around a little bit trying to verify correct polarity but eventually chanced plugged the batteries into their pockets and flicked on the power switch. Success – the single startup LED flash occurred followed, after a minute by three blinks indicated motion was detected. This device has a one to two minute delay before it is active. By the way, the external power switch is rather incongruous – I can imagine scenarios where it could be disarmed without motion detection, depending, of course, upon where the sensor was located within a room. Even more incongruous is an internal tamper switch that is defeated by simply turning off the external power switch. Truly odd! For what it is worth, tripping the tamper switch cause an event message transmission identical to a standard motion detection.
The single sheet of instructions contained enough Chinese-style English to identify settings options. Unfortunately, the both the printed diagram and the circuit board legends were in several cases completely missing. Some experimentation was required to completely identify the correct settings. Figure 2, below, shows my settings. I set the address to match my existing r06a test setup with an address of FFLHHHLF (A0 is rightmost digit). The four data bits are used to identify the sensor – I chose bit D1 low for mine (binary 1101).

PIR Circuit Board

Figure 2: PIR Circuit Board

I have been doing all of my tests with the antenna collapsed to its shortest length of which, including its internal portion is 80mm plus a circuit board portion of an additional 65mm. This yields an antenna length of 145mm which is little short of the optimal 433MHz ¼ wavelength antenna of 173mm. However, since the antenna, including the circuit board portion, is not straight, is partially folded back upon itself and is in close proximity of metallic objects, 173mm wouldn’t correct anyway. If the antenna were fully extended it would be a 390mm antenna – about a half wavelength. In any case, it works fairly well.

Now, I’ll delve back into the 2262/2272 protocol a bit. For protocol analysis I have connected my little DSO Nano v2  Digital Storage pocket size Oscilloscope to the r06a receiver. I used the fob to transmit the observed data. Figure 3, below, is of the DSO Nano in use. In this particular measurement I am measuring the duration of a complete digit (two pulse train) – 3.6ms. Figure 4, below, is a close-up.

DSO Nano In use

Figure 3: DSO Nano In use


Figure 4: Close up of DSO Nano In-Use

The DSO Nano’s little screen cannot display the entire captured data sequence in a usable way but by adjusting the time/division displayed and sliding the screen back and forth, measurements are accomplished with the little screen.

The image below shows what an entire data sequence looks like on the DSO Nano V2:.

2262 signal entire

Figure 5: Entire 2272 data string on DSO Nano

However, the DSO Nano IS capable of saving the entire capture buffer as an XML file. Converting the saved XML to an image is a bit of a challenge. Fortunately, there is a Windows .NET program named “benfwaves” than can make the conversion. MONO failed to run it and while the .net source for Microsoft Visual Studio 2010 Professional is available, I didn’t want to take the time to see if it was possible to successfully build it using Microsoft’s  Free Visual Studio.  Since I exclusively use Linux, I  used Windows XP in a VirtualBox to run benfwaves. It is an amazing little program with all kinds of measuring capability. The screen captured waveform is shown in Figure 6, below, after mark-up using LibreOffice Draw:

2262 waveform output by r06a receiver

Figure 6: 2272 waveform output by r06a receiver

Referring to the Princeton Technology datasheet for the PT2272 I’ll compare my observations against that standard.

The measured r06a’s fundamental 2272 OSC frequency (at pin 15) is nominally 21.6kHz, yielding a cycle (represented by “α”) of 45.6μs. See Figure below. Per the Princeton Technology datasheet, for the PT2272 to decode correctly the waveform that was received, the oscillator frequency of PT2272 must be 2.5~8 times that of the transmitting PT2262. Measurements of the output of r06a’s radio receiver (pin 1 of LM358) show the pulse train transmitted by the key fob’s PT2262 – see Figure 6, above. Measurements of that waveform show that a short “high” is nominally 440μs long. The specification says that a short “high” is 4α long so this would, at first glance, seem to be incorrect since 4 * 45.6μs = 182.4μs. However, recalling that the 2272 OSC is 2.5~8 times that of the transmitting PT2262 then (2.5 * 4) * 45.6μs = 456μs. This is within my measurements – my measured nominal value of a short “high” being nominally 440μs long was derived by averaging measurements from 404μs to 476μs. Therefore, with my PT2272 chip’s α is 2.5 times its OSC frequency. This tells us that the chart in the PT2272 Princeton Technology datasheet timing chart actually reflects 2262 data, not that of the 2272. So, I modified the chart for a more correct story. See Figure 7, below.

PT2262/2272 Protocol Encoding Diagram

Figure 7: PT2262/2272 Protocol Encoding Diagram

As can be seen in Figure 7, above, a single data bit that represents a high, low or float state transmitted by the 2262 consists of two pulse cycles, the duration (short or long) of each of the two pulses representing the bit’s value:

Short/short = low (0), long/long = high (1), short/long = float (f). If you decode the waveform received from my 2262 fob transmitter you’ll see that it decodes to exactly what is encoded in the fob, as we would hope would be the case – FLHHHLFF (A0 is leftmost address digit) and D0 is the rightmost data digit.

The two pulses are 32 α long in total. Given that my PT2272’s α is 114μs the total duration of one bit’s two pulse cycles should nominally be 3.65ms. My actual measurements ranged from 3.598ms to 3.679ms so measurements are tracking the specification.

2272 OSC Waveform on DSO Nano

Figure 8: 2272 OSC Waveform on DSO Nano

That’s all for now.

Posted in Arduino, Electronics, security, wireless | Tagged , , , | 1 Comment

Auto Door Lock Actuator (electrical-mechanical, not electronic post)

I have an old (2000) Ford Ranger truck. At around 2008 the electric door lock actuators started failing. First the passenger side and later the driver’s side. The problem manifested it self in only one actuation being possible until after a few minutes rest between actuation attempts. Their failure was gradual until the passenger side was totally inoperative. I was suspicious of electrical resistance because each time I clicked the remote the actuator’s action became weaker until it would not function until given a few minutes to “cool down”. Since both locks were failing I suspected oxidation in the contacts where the wiring passes through the firewall. Upon investigation, it was very difficult to get to the pass-through so I decided that I’d replace the worst actuator, the one on the passenger side.

Yesterday I replaced the passenger side actuator with a Chinese clone purchased on eBay.  Replaces part 6L3Z25218A43AA. The job is a real pain because of the part’s inaccessible, hidden location. A mirror, flashlight and much patience are required. It took me over an hour of fumbling, squinting, cussing and groping to get it replaced.

Anyway, I always like to see how things work so I had to crack the old one open. Photos are below. Before I opened it I applied 12VDC to the external contacts but it was dead. The power is fed to the motor via silver colored contacts that slide into sockets in the motor (see photo below). Opening the unit would wipe clean the contacts as they were removed from the contacts so further electrical testing, while done, was of little diagnostic value.

The motor is functional with a 12VDC 1.5A power supply applied directly to the motor’s contacts. Since both actuators started failing near the same time, about eight years, the cause of failure appears to be a design flaw. I suspect the culprit was oxidation or dirt but given how well sealed the unit was, oxidation is more likely the cause than was dirt. The connection snaps together with a positive click so it wasn’t inadequate pressure of the contacts.

Next, I replaced the driver’s side door lock actuator and since I now what I was doing and had the most successful tools arranged, the job only took me 30 minutes.

Ford Door Lock Actuator

Ford Door Lock Actuator

Ford Door Lock Actuator - inside

Ford Door Lock Actuator – inside

Sockets in Actuator

Sockets in Actuator

Connector in Actuator

Connector in Actuator

Posted in Uncategorized | Leave a comment

Updates for the Garden Light Experiment

I have added some updates to my old 2012 Garden Light power supply post. Check out the updates and you’ll see that reader Peter/Tom has been more successful than I was. Also, you’ll find a reference to Russian author Ivan Nechayev’s successful use of the XY8018 to design a stabilized power supply.

Posted in Electronics | Tagged , | Leave a comment