2012
01.16

I’ve long wanted to construct an open source broadcast remote control.  I rescued the Moseley TRC-15 out of an AM station some years ago, but never got around to playing with it.  During a cleanup recently I looked into it and found that it was pretty obsolete and useless and I don’t have the studio end of it.  But it is a perfect enclosure to house my effort.  So begins the teardown.

TRC-15 Remote Control

As you can see it has the Hallikainen & Friends TEL 171 retrofit.  This converted the TRC-15 from analog to digital.  Essentially the TRC-15 would send its data as analog tones, Hallikainen converted this to a digital system and added a LCD digital meter.  Not bad for 1978!

TRC-15 Back Panel

This is the back panel of the TRC-15 and already we can see one of its limitations… where are the status (or logic) inputs?  It only does command (or relay closure) and metering.  Clearly some rearrangement will be in order.

TEL171 Revealed

TEL171 Bottom Revealed

Flipping up the top board reveals more interesting components, but there is no microprocessor!  Again, not bad for 1978!

TRC-15 Back Panel Opened

Removal of the top cover and flipping open the back panel reveals the command relays and a very robust power supply.

Power Supply Closeup

A closeup of the power supply reveals the regulation and the analog calibration pots.  I believe I will eliminate these and replace this with a blank panel.

Boards Removed

The boards have been removed and work begun on layout and rearranging the I/O.  Follow the category “Remote Control” for further updates.

Share
2011
08.02

“This was a triumph, I’m making a note here, huge success!  It’s hard to overstate my satisfaction”

The reason I bought the Sparkfun SI4735 Arduino Shield last week was to graph and log a certain broadcast station’s signal strength to confirm or deny the “rumor” and “opinion” that they were not reducing power or changing pattern at night, a clear violation of their license grant.

I got this working tonight!!  I am now collecting data and waiting for ‘sunrise’ to see if their power jumps up, and ‘sunset’ tomorrow, to see if there is a corresponding drop in signal strength.

So far the graph is filling nicely as shown below.

The code is far too messy to release at this time, and I still have a few bugs to work out, but these are the basic steps that happen.

  1. Arduino waits 30 seconds and then checks tuned frequency, received signal strength, signal to noise ratio and AGC value.
  2. Arduino spits a comma delimited string out of its serial port.
  3. A Processing script receives this string, parses out the data and writes it to a PHP script residing on this server.
  4. The PHP script writes this data to the mySQL database.
  5. A hapless internet viewer calls up a PHP script which reads the data out of the mySQL database and graphs it nicely using the Flot graphing package.
  6. . . .
  7. PROFIT!

It should be noted that I built an AM loop antenna for this project.  It’s only 10 turns, I was getting tired and sore from keeping constant tension on the wire and flopping the cross around, but it works nicely.  I want to add more turns, weather proof it for outdoor use and make it tunable.

AM Loop Antenna

I will post construction details and a BOM in a future update when I am happy with the design.

For now, behold the graphy goodness at http://ka1kjz.com/flot/fieldstrength1.php

Share
2011
08.01

About a month ago, Sparkfun Electronics released a SI4735 AM & FM Receiver Shield for the Arduino.  Based on the Silicon Labs SI4735 receiver on a chip, it looked to be a very promising board.  One small problem, they evidently never tested it on a 5V Arduino, or their Arduino’s inputs were tolerant of being driven from a 3V source.

si4735 Shield

The commenters on Sparkfun’s product page quickly discovered the problem and offered several solutions, however, over on the Arduino forum, another poster found the real culprit and offered an incorrect, albeit working, solution.  I decided I wanted to do this right, and reliably, so I decided on a proper level shifter.

I had a couple of Sparkfun BOB-08745 Logic Level Converter boards kicking around from an iPod interfacing project that never happened so I pressed one of them into service.  I’ll eventually replace the BOB-08745 with a single FET as soon as I find a proper one in a TO-92 case.

Once again… I have to wonder about Sparkfun’s quality control and engineering checks, there were several complaints about the efficacy of the 5V to 3V (RX) section, read the comments on the product page but I don’t need that functionality.

I added header pins to the board, so I can later use it elsewhere and on a breadboard and only soldered the pins needed to the SI4735 board.  I cut the trace to the D12 line and soldered to a convenient via in this trace.

Some commenters on the Sparkfun product page also noted there is a missing delay() in the getResponse function, so change the following in si4735.cpp from…

void Si4735::getResponse(char * response)
{
digitalWrite(SS, LOW);
delay(1);
spiTransfer(0xE0);  //Set up to read the long response
for(int i=0; i<16; i++)*response++ = spiTransfer(0×00);  //Assign the response to the string.
digitalWrite(SS, HIGH);
}

To…

void Si4735::getResponse(char * response)
{
digitalWrite(SS, LOW);
delay(1);
spiTransfer(0xE0);  //Set up to read the long response
delay(1);
for(int i=0; i<16; i++)*response++ = spiTransfer(0×00);  //Assign the response to the string.
digitalWrite(SS, HIGH);
}

After installation and the change above I was still getting responses I didn’t expect and I found yet another problem.  The source code of the Si4735_SerialExample states in the comments;

The command must be terminated with either a newline or carriage* return character. To enable this in the Arduino Serial Terminal, make sure the drop down menu located in the bottom right hand side of the * terminal window (not the baud rate one, but right next to that) reads ‘Newline,’ ‘Carriage Return,’ or ‘Both NL and CR.’

If you set the line end to CR/LF, this has the effect of sending the command, then a null command, resulting in missing the response.  Once I set that to either CR or LF, responses began to come in.

Now I am getting responses but they are still nonsensical!  After spending several hours trying this and that, I found even yet another problem, the SPI interface was running too fast, missing bits.  I found the following line in the si4735.cpp library

SPCR = (1<<SPE)|(1<<MSTR)|(1<<SPR1);

This runs the SPI interface at its fastest, 4MHz, resulting in missing bits.  I set it to its slowest, 250KHz via the following code and now responses make sense!!!

SPCR = (1<<SPE)|(1<<MSTR)|(1<<SPR1)|(1<<SPR0);

I’ll play a little further with SPI speed, but it’s not really an issue, as long as the data is transfered in a few mS, as long as it happens.  With that done, the board is 100% functional.  I can tune it and read back important parameters.  It’s quite late now, I will continue with this tomorrow as something else concerns me, I am getting two different RSSI and SNR readings depending on where I read them.

Share
2011
07.31

It has been rumored that the local AM station in my hometown was not dropping its power or changing its pattern at night, a clear violation of their license grant.  Since the neighboring co-channel stations and the FCC don’t care about rumor or my “opinion”, I wanted a way of automatically logging the field strength of a broadcast station.  This also paves the way for propagation studies and watching for band openings.

I had been eyeing the Silicon Labs line of receivers on a chip for some time but they come in a hard to work with surface mount package.  Finally SparkFun Electronics came out with a board based upon the SI4735 chip, which does everything… AM FM Shortwave and Long Wave. It does RSSI (received signal strength indicator) as well as digital audio (not HD radio unfortunately) and RDS or RDBS.  And its on an Arduino shield!!

si4735 Shield

I’ll say a few negative things about this shield…

  1. It did not come with pins to mate with the Arduino.  Fortunately I had something that would work temporarily until I can get the proper ones in.
  2. The library code is riddled with “not working yet” comments.  I have some work cut out for me getting simple things like -Get Frequency- working.
  3. The status response was coming back with all zeros.  I found a couple solutions in the SparkFun comments, I had to add a delay, but the status response was still nonsensical.  I found a thread in the Arduino forum describing a pretty serious design flaw.

So far that is all I’ve found -wrong- with the board.  I was able to tune around the FM and AM bands and surprisingly, was pulling in a station in New Haven, Connecticut, about 11 miles distant, with no antenna, just the traces on the board!  See the board in action and a map of the path below.

httpv://www.youtube.com/watch?v=zaA6CzmilAs


View larger map

So with that said, I think I’ll make a proper 3.3v to 5v converter for the D12 line and begin programming the board shortly.

Share
2011
07.31

I was chasing a problem with an Arduino / Ethernet Shield / TMP421 temperature sensor combination.  The Arduino would write to the online database with the USB hooked up but not when powered by the external supply only.  I could not tell this as, well, the USB was not connected, so I couldn’t see the failures in the serial window.

Probing around, I was assuming the Ethernet Shield was deriving some of its power from the USB chipset, or some such, but no… I found 3.6 V on the 5 volt rail.  I found a perfect 3.3 on the 3.3 rail.

I found with all the losses through the polarity protection diode, the regulator itself, and the USB vs. external supply decision circuitry, was dropping my Vcc voltage to 3.6.  I turned up the 5 volt supply feeding it to a perfect 5 and then up to 5.3-ish with no joy.

Ultimately I switched the Arduino supply to the +12V supply that is driving other circuitry in the project and the Ethernet Shield is happy again.

That is all… don’t feed an Arduino a perfect 5V supply unless you want to bypass all the regulation and USB vs. external supply decision circuitry.

Share
2011
07.27

I got tired of the mess in my garage so I’ve undertaken a cleanup!

Garage photo

Garage facing back

 

Garage Photo

Garage, facing forward

I have a great deal of work ahead of me but it’s slowly coming along.  One thing I needed in there was a workbench.  Inspired by a book I have regarding 2×4 furniture, I set out to design and build something based on that and plywood.  The following is what came out.

 

Workbench In Progress

Workbench In Progress

Workbench Complete

Workbench Complete

The bill of materials is:

6 2 x 4 x 92 framing studs $2.43 ea
2 2 x 4 x 1/2 ply wood $10.67 ea
1 box 4″ coarse exterior grade drywall screws $8.47
1 box 1 1/4″ coarse exterior grade drywall screws $8.47

 

The approximate cost of the bench is $50.  I will provide a cutting list and detailed photographs in a further update.

Share
2011
07.12

Have a building at the other end of your property not served by cable/phone?  Need to cross another’s property to get internet access to your remote building, a WiFi wireless bridge might be the answer.

I work part-time at a radio station on Cape Cod and they needed to add internet connectivity to their transmitter site.  This site is about 550 feet distant, across a road and several other properties so a direct run of Cat-5 or 6 was impossible.  Also we did not want the added expense of a second ISP subscription so enter high power routers and the dd-wrt open source software.

 


View larger map

 

It was decided early on to use panel antennas and high power routers compatible with the dd-wrt software suite.  The Luxul X-Wav Surefire flat panel antennas were already purchased by the station owners, but proved to be pretty good.  The router, as recommended by the dd-wrt organization were Buffalo WHR-HP-G54′s.  They have one detachable antenna, a built in antenna and are switchable, so that all the available power and receive sensitivity can be directed to either or both.

 

Luxul Panel Antenna

Luxul Panel Antenna at Transmitter

 

After installation of the dd-wrt software, configuration of the routers was problematic, but not for lack of capability, but rather hard to read documentation at the dd-wrt wiki. This entry is intended to alleviate some of that difficulty.

First and foremost, get as much of the network working on the bench, across the room, then across the yard, before deploying the equipment in the field. This simple action will save you alot of trips when you inevitably lose control over either end and have to visit it personally.

The originating, local end is referred to as the “Primary Router”, the remote location, the “Remote Router” or “Bridge Router”. In our particular configration the Primary Router is not the master network router, but is simply used on the network as a workgroup switch locally and as one end of the WiFi path.  As a result, many features are turned off.

After installing the dd-wrt software, there is not much configuration on the Primary router and will vary depending on your installation.  You must have the wireless security set to be WEP or WPA-aes (WPA2-Personal works as well).  In my case I had shut off the internal (left) antenna directing everything to the outside (right) panel and had shut off DHCP as the Primary router would be handling that.  Finally, I set the IP to 192.160.0.50, something outside the DHCP range but easily remembered.

On the Secondary router, perform the following steps.

  1. Perform a “30-30-30″ reset on the router.  Hold the reset button for 30 seconds, keep holding the reset button and power down the router for 30 seconds, and while continuing to hold the reset button, power up the router and continue holding it for another 30 seconds.  A watch or stopwatch will be helpful.
  2. Connect a cable from your computer to one of the LAN ports on your router (one of the group of 4).
  3. Configure your computer to have a static IP address in the same subnet (192.168.1.9 in my case).
  4. Point your browser at 192.168.1.1 and open the dd-wrt webgui.
  5. You should be asked to change your password and username. Carefully type these in. If you aren’t asked for a password and username, do a hard reset, this time doing it properly! Hit change password.
  6. Go FIRST to the wireless tab, wireless security and enter the security type and key that matches your primary router. You must use WEP or WPA2-aes to have dd-wrt work reliably.  In my case, WPA2-Personal worked fine with a simple passphrase.  Hit SAVE then APPLY Settings.
    NOTE: You may wish to do the rest of this setup with wireless security disabled.  Then enable it as your last act.  This will require access to both sides. 

    dd-wrt primary wireless security screen dd-wrt secondary wireless security screen
  7. Go to the Wireless/Basic Settings page and change the wireless mode to Client Bridge.
  8. Your wireless network mode, channel and encryption should be set to the same as the primary router.
  9. If you are using N only or Mixed with N, set your wireless channel width to match your primary.
  10. Set the wireless network name to exactly the same as your primary router. Make sure spelling and capitalization match.
  11. Hit SAVE at the bottom. Then hit APPLY.
  12. Check to make sure all the configurations, including the mode, saved and the mode is still client bridge. If any changed, fix them, and save again.
    dd-wrt primary wireless mode screen dd-wrt secondary wireless mode screen
  13. Goto Setup/Basic Setup and enter a router local IP address of something not already occupied on your network and easy to remember (I chose 192.168.0.254 The client bridge must match the subnet of the primary router) Leave subnet mask at 255.255.255.0.
  14. Set the Gateway IP to your primary router. (192.168.0.50 in my case)
  15. Leave Local DNS blank.
  16. Check Assign Wan port to a switch, if you wish to.  (this will give you one more LAN port)
  17. Change your timezone and DST to match where you are.
  18. Hit SAVE at the bottom. Then hit APPLY.
  19. dd-wrt primary router basic settings screen dd-wrt secondary router basic settings
  20. Set your browser to the router’s new IP (192.168.0.254 in my case) and login to your router.  You may need to restart your browser.
  21. Goto Security, Firewall. Under Block Wan Requests, uncheck everything but “Filter Multicast” (Leave Filter multicast checked).
  22. Hit SAVE at the bottom. Then hit APPLY.
  23. Disable SPI Firewall (I also disabled the firewall on the primary router as it is not directly connected to the internet, I let the main router handle this function).
  24. Hit SAVE at the bottom, then hit APPLY.
    dd-wrt primary firewall screen dd-wrt secondary firewall screen
  25. Go to setup/advanced routing and change the operating mode from “gateway” to router.
  26. Hit SAVE at the bottom, then hit APPLY.
    dd-wrt primary routing screen dd-wrt secondary routing screen
  27. In my case, I routed the receive and transmit antennas to the outdoor panels (‘right’ antenna is the connecterized external antenna).  To to Wireless/Advanced and set TX Antenna to Right and RX Antenna to Right.  Also at this time, I increased my TX power to 175, too high and the amplifier will eventually die.
  28. Hit SAVE at the bottom, then hit APPLY.
    dd-wrt primary advanced wireless screen dd-wrt secondary advanced wireless screen
  29. Go to Status/Wireless and hit Site Survey, and Join the appropriate wireless network. The access point table should show the MAC address of your primary router, along with signal strength. (SSID Broadcast MUST be enabled on your primary router).  Note: you cannot do this from the Primary side, your bridge is not visible, its not an AP.  All we get is a nice list of the neighbors.  The Secondary router, or the bridge, has no other neighbors.
  30. dd-wrt primary site survey dd-wrt secondary site survey
  31. You should now be able to ping various machines on either side of the bridge.
  32. After some time, you should have nice healthy packet numbers at Status/Wireless.  A few bad packets are normal, I currently have 159815 good / 0 bad receive, and 440968 good /71 bad transmit on the Primary router and 118674 good / 0 bad receive and 63801 good / 26 bad transmit on the Secondary router (different uptimes).
  33. If everything is working as expected, as a final act, on the Primary side of the bridge, log into the Secondary router (192.168.0.254 in my case), go to Administration/Backup and hit BACKUP.  Rename this file to something memorable.  Do the same (or similar if not dd-wrt) on the Primary router (192.168.0.50 in my case).

It should be noted, I have experienced some minor packet loss (missed pings) and some served pages timing out (the remote end has equipment with small webservers integrated).  I believe this is due to the Windows ARP cache becoming confused.  The wireless MAC address is not rewritable by the dd-wrt firmware, so each IP address at the Secondary end will have the same MAC address.  I have not tested this with other OSs but I believe Mac and Linux will be more forgiving.

For further reading check out the dd-wrt Wiki

Share
2011
06.14

A few days ago a friend gave me a MaxSpeed MaxTerm 8000 to play with.  This was used as a thin client in a public library system to access the card catalog.  This is essentially the tiny, low power, diskless workstations you see at points of sale, libraries, etc.  The steps I took may not necessarily work for you and your mileage will vary, but hopefully this will provide you some hints and inspiration.

Upon booting the computer, the login screen complained that it could not join its domain.  Fortunately there was no administrator password and I was easily able to log in to the computer.  I don’t fully grasp Windows domains, I have never had a need for them but this often works if there is no connectivity to the computer’s original host server.

I immediately set out to clean up the computer, uninstalling Citrix and outdated copies of RealPlayer and Quicktime, changing the computer name, setting it to join a workgroup rather than a domain and getting it to autologon so it will boot without intervention.  But, upon reboot – EVERYTHING WAS BACK WHERE IT WAS!!??!! – What was going on here?

After quite a few Google searches I finally found out that Windows XP Embedded implements something called Enhanced Write Filter to protect the disk from writes by users.  Basically, do what you like, install anything, delete the entire drive, and everything is discarded upon reboot.  This is not quite like re-imaging but close, you can commit your changes if you know how (and now I do).

I found an excellent writeup originally from HP (who bought MaxSpeed incidentally) that explains EWF pretty clearly;

The Enhanced Write Filter allows the operating system to boot from a disk volume residing on any read-only media such as flash media, CD-ROM, or a write-protected hard drive while maintaining the appearance of read/ write access to the operating system. Enhanced Write Filter protects the contents of a volume on the target media by redirecting all writes to another storage location, called an overlay.

Used in this context, an overlay is similar to a transparency overlay on an overhead projector. Any change made to the overlay affects the picture as seen in the aggregate, but if the overlay is removed, the underlying picture remains unchanged.

So, it was a simple matter to disable EWF, make my changes and commit them.  I found an interesting article on a car computer forum where the author had gotten EWF working with XP-Pro, but he provided the enough info to get me started.  I’ll be examining that article a little closer, this will solve alot of problems with mission critical appliance PCs that don’t change much over the years.  Go to a command prompt and issue the command:

ewfmgr c: -disable

This will make your volume writable as any normal drive.  Don’t forget to re enable EWF with (and REBOOT, it won’t “take” till then):

ewfmgr c: -enable

And you can get the rest of the command switches with:

ewfmgr -?

Now, with writes enabled I could get down to business.  Here are a few caveats I found with XP Embedded that you should bear in mind.

  • It does not support safemode, in any way.  It will bluescreen.
  • It does not support automatic update, in fact forget updates totally.
  • Disk space is rather limited, so is memory.

These are the steps I took to get this machine operating the way I wanted, your mileage will vary depending on what you want to do.  I’m not entirely certain where I will deploy this machine, but it will be a “headless” server or utility machine somewhere remote.

  • Disabled the BIOS password by removing the BIOS battery for a few minutes.
  • Changed the boot order in BIOS so it would not attempt to find a network image, greatly speeding boot.  It now stands at C: then USB:
  • Disabled EWF and changed the computer domain to a workgroup and changed the computer name.  This disabled the domain joining.
  • Installed TightVNC
  • Installed Python 2.72 (the last version 2 release, to maintain backward compatibility with the pyserial library)
  • . . .
  • Profit!

I plan to use this computer as a receiver for my Jeenode work, simply listening for the radio traffic and sending updates off to the mySQL database.

Below is a small gallery of images of this machine.

 

Share
2011
03.20

New Look For The Blog

I’ve been busy!  You’ve no doubt noticed the new look for the blog.  2 reasons…

  1. I wanted to make my adsense account work a little better for me.
  2. I was tired of the look, which had served me well for 2 years.

My adsense revenues were dissapointing even though I don’t expect to get rich here.

I’ve also updated my bio page, here.  Enjoy.

Share
2011
02.23

I had long toyed with the idea of using the Jeenode board for remote environmental and other sensing, among them temperature.  I have finally revisited this and had resounding success.

jee_temp_1024

I had never had any luck in getting the accompanying Jeemon software to work, it still being in its infancy, so I wrote some code in the Processing language to parse the received strings from the Jeelink and push it to my mySQL server via php.  To give you an idea of the overall concept, here is the block diagram I worked out last year…

jeelink_concept

First a very simple sketch runs on the Jeenode, sending out the temperature every so often, in this case approximately 60 seconds.  I’ve added some powersaving sleep code to conserve battery power, so the sketch looks more complex than it actually is.  The full code is available at the end of the article.

The payload from the Jeenode to the Jeelink is very simple, simply the temperature, nothing else.

The Processing script listens for the node ID from the subject Jeenode and executes code to reconstruct the temperature into a float and push it to the mySQL server.  Code for that is at the bottom of the article as well.

This code has been running now for approximately a week with little trouble.  I was able to plot the graph below of the temperature in my bedroom using the flot graphics library as usual.  I have already decided to port the Green Thermostat to a Jeenode to eliminate the computer it is tethered to.

Share