Well, a little nit I have to pick with chip manufacturers. On this occasion, it’s with ST, but they all do it, Freescale, TI, Atmel…
I’m talking about the assumptions they make about who uses their site.
Yes, I work as a “systems engineer” (really, programmer and network administrator, my role is more IT than Engineering). However, when I’m looking at chip designs and application notes, that is usually in my recreation.
This morning, I had occasion to ask ST a question about one of their application notes. Specifically AN3969, which deals with emulating an EEPROM using the in-built flash on a STM32F4 microcontroller. Their “license” states:
The enclosed firmware and all the related documentation are not covered
by a License Agreement, if you need such License you can contact your
local STMicroelectronics office.
THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING
CUSTOMERS WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR
THEM TO SAVE TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD
LIABLE FOR ANY DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT
TO ANY CLAIMS ARISING FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE
MADE BY CUSTOMERS OF THE CODING INFORMATION CONTAINED HEREIN IN
CONNECTION WITH THEIR PRODUCTS.
Hmm, not licensed, but under a heading called “license”. Does that mean it’s public domain? Probably not. Do I treat this like MIT/BSD license? I’m looking to embed this into LGPLed firmware that will be publicly distributed: I really need an answer to this. So over to the ST website I trundle.
I did have an account, but couldn’t think of the password. They’ve revamped their site and I also have a new email address, so I figure, time for a new account. I click their register link, and get this form:
ST Website registration
Now, here’s where I have a gripe. Why do they always assume I am doing this for work purposes? This is something pretty much all the manufacturers do. The assumption is WRONG. My account on their website has absolutely nothing to do with my employer. I am doing this for recreation! Therefore, should not, mention them in any way.
Yet, they’re mandatory fields. I guess ST get a lot of employees of the “individual – not a company” company.
I filled out the form, got an email with a confirmation link which I click, and now this is something a lot of companies, not just chip makers, get wrong. Apart from the “wish it was” two factor (you can tell my answer was bogus), they dictate some minimum requirements, but then enforce undisclosed maximum requirements on the password.
ST Website password
WTF? “Special” characters? You mean like printable-ASCII characters? Or did a vertical tab slip in there somehow? Password security, done properly, should not care how long, or how complex you choose to make your password: so long as it meets a minimum standard. A maximum length in the order of 64 bytes or more might be reasonable, as might be a restriction to what can be typed on a “standard” US-style keyboard layout may be understandable.
In this case, the password had some punctuation characters. Apparently these are “special”. If they restrict them because of possible SQL injection, then I’m afraid ST, you are doing it wrong! A base64 or hex encoded hash from something like bcrypt, PKCS12 or the like, should make such things impossible.
Obviously preventing abuse by preventing someone from using the dd-dump of a full-length Blu-ray movie as a password is perfectly acceptable, but once hashed, all passwords will be the same size and will contain no “special” characters that could upset middleware.
Sure, enforce a large maximum length (not 20 characters like eBay, but closer to 100) so that any reasonably long password won’t overflow a buffer. Sure, enforce that some mixed character classes be used. But don’t go telling people off for using a properly secure password!
I’ve been running a station from the bicycle for some time now and I suppose I’ve tried a few different battery types on the station.
Originally I ran 9Ah 12V gel cells, which work fine for about 6 months, then the load of the radio gets a bit much and I find myself taking two with me on a journey to work because one no longer lasts the day. I replaced this with a 40Ah Thundersky LiFePO4 pack which I bought from EVWorks, which while good, weighed 8kg! This is a lot lighter than an equivalent lead acid, gel cell or AGM battery, but it’s still a hefty load for a bicycle.
At the time that was the smallest I could get. Eventually I found a mob that sold 10Ah packs. These particular cells were made by LiFeBatt, and while pricey, I’ve pretty much recouped my costs. (I’d have bought and disposed of about 16 gel cell batteries in this time at $50 each, versus $400 for one of these.) These are what I’ve been running now since about mid 2011, and they’ve been pretty good for my needs. They handle the load of the FT-857 okay on 2m FM which is what I use most of the time.
A week or two back though, I was using one of these packs outside with the home base in a “portable” set-up with my FT-897D. Tuned up on the 40m WICEN net on 7075kHz, a few stations reported that I had scratchy audio. Odd, the radio was known to be good, I’ve operated from the back deck before and not had problems, what changed?
The one and only thing different is I was using one of these 10Ah packs. I’ve had fun with RF problems on the bicycle too. On transmit, the battery was hovering around the 10.2V mark, perhaps a bit low. Could it be the radio is distorting on voice peaks due to input current starvation? I tried after the net swapping it for my 40Ah pack, which improved things. Not totally cleared up, but it was better, and the pack hadn’t been charged in a while so it was probably a little low too.
I thought about the problem for a bit. SSB requires full power on voice peaks. For a 100W radio, that’s a 20A load right now. Batteries don’t like this. Perhaps there was a bit of internal resistance from age and the nature of the cells? Could I do something to give it a little hand?
Supercapacitors are basically very high capacity electrolytic capacitors with a low breakdown voltage, normally in the order of a few volts and capacitances of over a farad. They are good for temporarily storing charge that needs to be dumped into a load in a hurry. Could this help?
My cells are in a series bank of 4: ~3.3V/cell with 4 cells gives me 13.2V. There’s a battery balancer already present. If a cell gets above 4V, that cell is toast, so the balancer is present to try to prevent that from happening. I could buy these 1F 5.5V capacitors for only a few dollars each, so I thought, “what the hell, give it a try”. I don’t have much information on them other that Elna Japan made them. The plan was to make some capacitor “modules” that would hook in parallel to each cell.
My 13.2V battery pack, out of its case
For my modules, the construction was simple, two reasonably heavy gauge wires tacked onto the terminals, the whole capacitor then encased in heatshrink tubing and ring lugs crimped to the leads. I was wondering whether I should solder a resistor and diode in parallel and put that in series with the supercap to prevent high in-rush current, but so far that hasn’t been necessary.
The re-assembled pack
I’ve put the pack back together and so far, it has charged up and is ready to face its first post-retrofit challenge. I guess I’ll be trying out the HF station tomorrow to see how it goes.
Not a complete solution to the RF feedback, it seems to help in other ways. I did a quick test on the drive way first with the standard Yaesu handmic and with the headset. Headset still faces interference problems on HF, but I can wind it up to about 30W~40W now instead of 20.
More pondering to come but we’ll see what the other impacts are.
Tropical Cyclone Nathan, Forecast map as of 2:50PM
This cyclone has harassed the far north once already, wobbled out in the Pacific like a drunken cyclist as a tropical low, has gained strength again and is now making a bee-line for Cape Flattery.
As seen, it also looks like doing the same stunt headed for Gove once it’s finished touching up far north Queensland. Whoever up there is doing this rain dancing, you can stop now, it’s seriously pissing off the weather gods.
National and IARU REGION III Emergency Frequencies (Please keep clear and listen for emergency traffic)
3.600MHz LSB (IARU III+WICEN)
7.075MHz LSB (WICEN)
7.110MHz LSB (IARU III)
14.125MHz USB (WICEN)
14.300MHz USB (IARU III)
14.183MHz USB: NOT an emergency frequency, but Queensland State WICEN hold a net on this frequency every Sunday morning at around 08:00+10:00 (22:00Z Saturday).
21.190MHz USB (WICEN)
21.360MHz USB (IARU III)
28.450MHz USB (WICEN)
I’ll be keeping an ear out on 14.125MHz in the mornings.
Update 20 March 4:31am: It has made landfall between Cape Melville and Cape Flattery as a category 4 cyclone.
Well, it’s been a year and a half since I last posted details about the bicycle mobile station. Shortly after getting the Talon on the road, setting it up with the top box and lighting, and having gotten the bugs worked out of that set-up, I decided to get a second mounting plate and set my daily commuter up the same way, doing away with the flimsy rear basket in place of a mounting plate for the top box.
VK4MSL/BM today after the trip home from work.
That particular bike people might recognise from earlier posts, it’s my first real serious commuter bike. Now in her 5th year, has done over 10200km since 2012. (The Talon has done 5643km in that time.) You can add to that probably another 5000km or so done between 2010 and 2012. It’s had a new rear wheel (a custom one, after having a spate of spoke breakages) and the drive chain has been upgraded to 9-speed. The latter upgrade alone gave it a new lease on life.
Both upgrades being money well spent, as was the upgrade to hydraulic brakes early in the bike’s lifetime. I suppose I’ve spent in those upgrades alone close to $1400, but worth it as it has given me quite good service so far.
As for my time with the top box. Some look at it and quiz me about how much weight it adds. The box itself isn’t that heavy, it just looks it. I can carry a fair bit of luggage, and at present, with my gear and tools in it it weighs 12kg. Heavy, but not too heavy for me to manage.
Initially when I first got it, it was great, but then as things flexed over time, I found I was intermittently getting problems with the top box coming off. This cost me one HF antenna and today, the top box sports a number of battle-scars as a result.
The fix to this? Pick a spot inside the top box that’s clear of the pannier rack rails and the rear tyre, and drill a 5mm hole through. Then, when you mount the top box, insert an M5 bolt through the mounting plate and into the bottom of the top box and tighten with a 5mm wing nut. The box now will not come loose.
Still lit up like a Christmas tree from this morning’s ride.
The lights still work, and now there’s a small rear-view camera. On the TODO list is to rig up a 5V USB socket to power that camera with so that it isn’t draining the rather small internal battery (good for 4 hours apparently).
The station has had an upgrade, I bought a new LDG Z-100Plus automatic tuner which I’m yet to fully try out. This replaces the aging Yaesu FC-700 manual tuner which, although very good, is fiddly to use in a mobile set-up and doesn’t tune 6m easily.
One on-going problem now not so much on the Boulder but on the Talon is an issue with pannier racks failing. This started happening when I bought the pannier bags, essentially on the side I carry my battery pack (2kg), I repeatedly get the pannier rack failing. The racks I use are made by Topeak and have a built-in spacer to accomodate disc brake calipers. This seems to be a weak spot, I’ve now had two racks fail at about the same point.
Interestingly on the Boulder which also has disc brakes, I use the standard version of the same rack, and do not get the same failures. Both are supposedly rated to 25kg, and my total load would be under 16kg. Something is amiss.
A recurring flaw with the Topeak racks
I’m on the look-out for a more rugged rack that will tolerate this kind of usage, although having seen this, I am inspired to try a DIY solution. Then if a part fails, I can probably get replacement parts in any typical hardware store. A hack saw and small drill are not heavy items to carry, and I can therefore get myself out of trouble if problems arise.
I’ve been riding on the road now for some years, and while I normally try to avoid it, I do sometimes find myself riding on the road itself rather than on the footpath or bicycle path.
Most of the time, the traffic is fine. I’m mindful of where everyone is, and there aren’t any problems, but I have had a couple of close calls from time to time. Close calls that have me saying “ode for a horn”.
By law we’re required to have a bell on our bikes. No problem there, I have a mechanical one which is there purely for legal purposes. If I get pulled over by police, and they ask, I can point it out and demonstrate it. Requirement met? Tick to that.
It’s of minimal use with pedestrians, and utterly useless in traffic.
Early on with my riding I developed a lighting system which included indicators. Initially this was silent, I figured I’d see the lights flashing, but after a few occasions forgetting to turn indicators off, I fitted a piezo buzzer. This was an idea inspired by the motorcycles ridden by Australia Post contractors, which have a very audible buzzer. Jaycar sell a 85dB buzzer that’s waterproof, overkill in the audio department but fit for purpose. It lets me know I have indicators on and alerts people to my presence.
That is, if they equate the loud beep to a bicycle. Some do not. And of course, it’s still utterly useless on the road.
I figured a louder alert system was in order. Something that I could adjust the volume on, but loud enough to give a pedestrian a good 30 seconds warning. That way they’ve got plenty of time to take evasive action while I also start reducing speed. It’s not that I’m impatient, I’ll happily give way, but I don’t want to surprise people either. Drivers on the other hand, if they do something stupid it’d be nice to let them know you’re there!
My workplace looks after a number of defence bases in South-East Queensland, one of which has a railway crossing for driver training. This particular boom gate assembly copped a whack from a lightning strike, which damaged several items of equipment, including the electronic “bells” on the boom gate itself. These “bells” consisted of a horn speaker with a small potted PCB mounted to the back which contained an amplifier and bell sound generator. Apply +12V and the units would make a very loud dinging noise. That’s in theory; in practise, all that happened was a TO-220 transistor got hot. Either the board or the speaker (or both) was faulty.
It was decided these were a write-off, and after disassembly I soon discovered why: the voice coils in the horn speakers had been burnt out. A little investigation, and I figured I could replace the blown out compression drivers and get the speakers themselves working again, building my own horn.
A concept formed: the horn would have two modes, a “bell” mode with a sound similar to a bicycle bell, and a “horn” mode for use in traffic. I’d build the circuit in parts, the first being the power amplifier then interface to it the sound effect generator.
To make life easier testing, I also decided to add a line-in/microphone-in feature which would serve to debug construction issues in the power amplifier and add a megaphone function. (Who knows, might be handy with WICEN events.)
Replacing the compression drivers
Obviously it’d be ideal to replace it with the correct part, but looking around, I couldn’t see anything that would fit the housing. That, and what I did see, was more expensive than buying a whole new horn speaker.
There was a small aperture in the back about 40mm in diameter. The original drivers were 8ohms, and probably rated at 30W and had a convex diaphragm which matched the concave geometry in the back of the horn assembly.
Looking around, I saw these 2W mylar cone speakers. Not as good as a compression driver, but maybe good enough? It was cheap enough to experiment. I bought two to try it out.
I got them home, tacked some wires onto one of them and plugged it into a radio. On its own, not very loud, but when I held it against the back of a horn assembly, the amplification was quite apparent. Good enough to go further. I did some experiments with how to mount the speakers to the assembly, which required some modifications to be made.
I soon settled on mounting the assembly to an aluminium case with some tapped holes for clamping the speaker in place. There was ample room for a small amplifier which would be housed inside the new case, which would also serve as a means of mounting the whole lot to the bike.
I wasn’t sure what to use for this, I had two options: build an analogue circuit to make the effect, or program a microcontroller. I did some experiments with an ATMega8L, did manage to get some sound out of it using the PWM output, but 8kB of flash just wasn’t enough for decent audio.
A Freetronics LeoStick proved to be the ticket. 32kB flash, USB device support, small form factor, what’s not to like? I ignored the Arduino-compatible aspect and programmed the device directly. Behind the novice-friendly pin names, they’re an ATMega32U4 with a 16MHz crystal. I knocked up a quick prototype that just played a sound repeatedly. It sounded a bit like a crowbar being dropped, but who cares, it was sufficient.
Experimenting with low-pass filters I soon discovered that a buffer-amp would be needed, as any significant load on the filter would render it useless.
A 2W power amplifier
Initially I was thinking along the lines of a LM386, but after reading the datasheet I soon learned that this would not cut it. They are okay for 500mW, but not 2W. I didn’t have any transistors on hand that would do it and still fit in the case, then I stumbled on the TDA 1905. These ICs are actually capable of 5W into 4 ohms if you feed them with a 14V supply. With 9V they produce 2.5W, which is about what I’m after.
I bought a couple then set to work with the breadboard. A little tinkering and I soon had one of the horn speakers working with this new amplifier. Plugged into my laptop, I found the audio output to be quite acceptable, in fact turned up half-way, it was uncomfortable to sit in front of.
I re-built the circuit to try and make use of the muting feature. For whatever reason, I couldn’t get this to work, but the alternate circuit provided a volume control which was useful in itself.
For the line-level audio, there’s no need for anything more fancy than a couple of resistors to act as a passive summation of the left and right channels, however for a microphone and for the LeoStick, I’d need a preamp. I grabbed a LM358 and plugged that into my breadboard alongside the TDA1905.
Before long, I had a working microphone preamp working using one half of the LM358, based on a circuit I found. I experimented with some resistor values and found I got reasonable amplification if I upped some of the resistor values to dial the gain back a little. Otherwise I got feedback.
For the LeoStick, it already puts out 5V TTL, so a unity-gain voltage follower was all that was needed. The second half of the LM358 provided this. A passive summation network consisting of two resistors and DC-blocking capacitor allowed me to combine these outputs for the TDA1905.
One thing I found necessary, the TDA1905 and LM358 misbehave badly unless there’s a decent size capacitor on the 9V rail. I found a 330uF electrolytic helped in addition to the datasheet-prescribed 100nF ceramics.
Since I’m running on batteries with no means of generating power, it’s important that the circuit does not draw power when idle. Ideally, the circuit should power on when either I:
plug the USB cable in (for firmware update/USB audio)
toggle the external source switch
press the bell button
We also need two power rails: a 9V one for the analogue electronics, and a 5V one for the LeoStick. A LM7809 and LM7805 proved to be the easiest way to achieve this.
To allow software control of the power, a IRF9540N MOSFET was connected to the 12V input and supplies the LM7809. The gate pin is connected to a wired-OR bus. The bell button and external source switch connect to this bus with signal diodes that pull down on the gate.
Two BC547s also have collectors wired up to this bus, one driven from the USB +5V supply, and the other from a pin on the LeoStick. Pressing the Bell button would power the entire circuit up, at which point the LeoStick would assert its power on signal (turning on one of the BC547s) then sample the state of the bell button and start playing sound. When it detects the button has been released, it finishes its playback and turns itself off by releasing the power on signal.
Sound effect generator
Earlier I had prototyped a bell generator, however it wasn’t much use as it just repeatedly made a bell noise regardless of the inputs. To add insult to injury, I had lost the source code I used. I had a closer look at the MCU datasheet, deciding to start from a clean slate.
The LeoStick provides its audio on pin D11, which is wired up to Port B Pin 7. Within the chip, two possible timers hook up: Timer 0, which is an 8-bit timer, and Timer 1, which is 16-bits. Both are fed from the 16MHz system clock. The bit depth affects the PWM carrier frequency we can generate, the higher the resolution, the slower the PWM runs. You want the PWM frequency as high as possible, ideally well above 20kHz so that it’s not audible in the audio output, and obviously well above the audio sampling rate.
At 16MHz, a 16-bit timer would barely exceed 240Hz, which is utterly useless for audio. A 10-bit timer fares better, with 15kHz, older people may not hear it but I certainly can hear 15kHz. That leaves us with 8-bits which gets us up to 62kHz. So no point in using Timer 1 if we’re only going to be using 8-bits of it, we might as well use Timer 0.
Some of you familiar with this chip may know of Timer 4, which is a high-speed 10-bit timer fed by a separate 64MHz PLL. It’s possible to do better quality audio from here, either running at 10-bits with a 62kHz carrier, or dropping to 8-bits and ramping the frequency to 250kHz. Obviously it’d have been nice, but I had already wired things up by this stage, so it was too late to choose another pin.
Producing the output voltage is only half the equation though: once started, the PWM pin will just output a steady stream of pulses, which when low-passed, produces a DC offset. In order to play sound, we need to continually update the timer’s Capture Compare register with each new sample at a steady rate.
The most accurate way to do this, is to use another timer. Timer 3 is another 16-bit timer unit, with just one capture compare output available on Port C pin 3. It is an ideal candidate for a timer that has no external influence, so it gets the job of updating the PWM capture compare value with new samples.
Timer 1 is connected to pins that drive two of the three LEDs on the LeoStick, with Timer 4 driving the remaining one, so if I wanted, I could have LEDs fade in and out with it instead of just blinking. However, my needs are basic, and I need something to debounce switches and visibly blink LEDs. So I use that with a nice long period to give me a 10Hz timer.
Here is the source code. I’ll add schematics and other notes to it with time, but the particular bits of interest for those wanting to incorporate PWM-generated sound in their AVR projects are the interrupt routine and the sound control functions.
To permit gapless playback, I define two buffers which I alternate between, so while one is being played back, the other can be filled up with samples. I define these on line 139 with the functions starting at line 190. The interrupt routine that orchestrates the playback is at line 469.
When sound is to be played, the first thing that needs to happen is for the initial buffer to be loaded with samples using the write_audio function. This can either read from a separate buffer in RAM (e.g. from USB) or from program memory. One of the options permits looping of audio. Having loaded some initial data in, we can then call start_audio to set up the two timers and get audio playback rolling. start_audio needs the sample rate to configure the sample rate timer, and can accept any sample rate that is a factor of 16MHz (so 8kHz, 16kHz up to 32kHz).
The audio in this application is statically compiled in, taking the form of an array of uint8_t‘s in PROGMEM.
Creating the sounds
I initially had a look around to see if I could get a suitable sound effect. This proved futile, I was ideally looking around for a simple openly-licensed audio file. Lots of places offered something, but then wanted you to sign up or pay money. Fine, I can understand the need to make a quid, and if I were doing this a lot, I’d pay up, but this is a once-off.
Eventually, I found some recordings which were sort of what I was after, but not quite. So I downloaded these then fired up Audacity to have a closer look.
The bicycle bell
Bicycle bells have a very distinctive sound to them, and are surprisingly complicated. I initially tried to model it as an exponentially decaying sinusoid of different frequencies, but nothing sounded quite right.
The recording I had told me that the fundamental frequency was just over 2kHz. Moreover though, the envelope was amplitude-modulated by a second sinusoid: this one about 15Hz. Soon as I plugged this second term in, things sounded better. This script, was the end result. The resulting bell sounds like this:
So somewhat bell-like. To reduce the space, I use a sample rate of 6.4kHz. I did try a 4kHz sample rate but was momentarily miffed at the result until I realised what was going on: the bell was above the Nyquist frequency at 4kHz, 6.4kHz is the minimum practical rate that reproduces the audio.
I used Audacity to pick a point in the waveform for looping purposes, to make it sound like a bell being repeatedly struck.
I wanted something that sounded a little gutsy. Like an air-horn on a truck. Once again, I hit the web, and found a recording of a train horn. Close enough, but not long enough, and a bit noisy. However opening it up in Audacity and doing a spectrum analysis, I saw there were about 5 tones involved. I plugged these straight into a Python script and decided to generate those directly. Using a raised cosine filter to shape the envelope at the start and end, and I soon had my horn effect. This script generates the horn. The audio sounds like this:
Using other sound files
If you really wanted, you could use your own sound recordings. Just keep in mind the constraints of the ATMega32U4, namely, 32kB of flash has to hold both code and recordings. An ATMega64 would do better. The audio should be mono, 8-bits and unsigned with as lower sample rate as you can get away with. (6.4kHz proved to be sufficient for my needs.)
Your easiest bet would be to either figure out how to read WAV files (in Python: wave module), or alternatively, convert to raw headerless audio files, then code up a script that reads the file one byte at a time. The Python scripts I’ve provided might be a useful starting point for generating the C files.
Alternatively, you can try interfacing a SDCard and embedding a filesystem driver and audio file parser (not sure about WAVE but Sun Audio is easily parsed), this is left as an exercise for the adventurous.
I’ll put schematics and pictures up soonish. I’m yet to try mounting the whole set up, but so far the amplifier is performing fine on the bench.
Earlier this week I had an idea. We’ve got an old clock radio that picks up interference from the fridge when it turns on and the buttons on it are starting to fail with age.
I thought: “Why not build a new one?”
So the requirements are simple. We need a real-time clock, display driver, and of course, a receiver. The unit we have spends most of its time tuned to 792kHz AM (4QG or “ABC Radio National”), so a simple direct conversion receiver was what I was thinking of. But what about the LO?
Now I do have some clock radio ICs that implement the timing circuitry, alarm function and LED panel driver somewhere in a junk box. You feed them with the 50Hz or 60Hz waveform that comes out of the transformer and they use that as the timing source. Easy to use a 555 timer for the time source, and I’d make a traditional receiver. Another option is to use a AVR microcontroller, I have a few ATMega8Ls in the junk box with a NXP I2C RTC chip which I also have a few of.
The ATMega8L has a couple of PWM channels one 16-bit and one 8-bit: could they be used as an LO?
So: after digging around and locating my bought-years-ago and not-yet-used AVR programmer, and dusting off a breadboard that had an ATMega8L on it from a previous experiment I set to work.
This page explains in good detail how the PWM channels work. I started with those examples as a guide and tweaked from there.
For the PWM channel to work as a receiver LO, I want it to cover 540kHz to ~2MHz, with reasonable granularity. Question is, how far can I crank this? I have a 4MHz crystal, not the fastest I can use with this chip, but the absolute top of the range for the ATMegas isn’t much higher: 16MHz or maybe 20MHz. So if you’ve got a 16MHz crystal, you can expect to quadruple what I do here.
I started off with some blink code. If you take out all the delays, you get the following code:
The yellow waveform there is off one of the crystal pins. The cyan one is the PWM pin output, which in this case is a software driven GPIO. Even if this one worked, you wouldn’t want to do it this way unless your chip was doing only this task, and who’d use a programmable chip like an ATMega8L for that?
So, after reading through the documentation and examples, I loaded in the following code:
Well, for a few weeks now I’ve been (metaphorically) tearing my hair out, trying to figure out why I had such bad antenna problems on VHF. HF, I still have work to do as right now, the RF just induces currents where it pleases, including in my microphone cabling, but that’s a different matter. VHF until recently had been rock solid.
I tried replacing coax, re-terminating leads, checking solder joints, replacing antennas. Yesterday, I re-wired the entire antenna system, doing away with the BNC connectors in the top box and hard-wiring the antenna mounts to the coax inside. Rode up to Ashgrove today thinking I had fixed the problem.
Each bump in the road, I watched the S-meter graph move from S9 to S4 and back again.
What could it be? Why is it that it only occurs when I’m mobile, and not stationary? There’s a bad link somewhere, but where? No amount of jiggling cables was locating the problem. Finally today, I decided to take a peek inside the FT-857D.
Ohh, well that would do it!
I looked closely at the point where the N connector solders to the PCB. I noticed a small line around the wire where it met the solder blob. So I picked at it with pliers, and pulled it away from the blob: it was a dry joint!
Tomorrow, I shall know if this was the final problem. At least I don’t run full power on FM, my license only affords me 30W continuous, so the only time I do 50W is when I’m doing SSB at which point it’s only on voice peaks.
Update: It’s been a few days, the difference is like the difference between chalk and cheese. Prior to the fix my set was deaf as a post, and it’s not hard to see why!
This is a simple vertical groundplane antenna intended for mounting atop a 10m Squid Pole. These can be made to nearly any frequency you desire, and can be self-supporting if needed. The main limitation is the stiffness of the wire used.
The antenna gets its name as the original was one I quickly knocked up just prior to a horse endurence ride event that took place at Donnybrook in 2011. I was assisting Brisbane Area WICEN with the emergency communications at this event, and this antenna, worked very well. 10W was more than sufficient to get back to base on 2m FM.
The design is very simple. You’ll need some stiff copper wire, and a panel-mount BNC connector. I used some strands from a thick mains cable: this was being tossed out at a ham radio meeting some years back. The cable had a black plastic coating and inside were 7 strands of solid copper, each about 2mm thick. Perfect for small antennas.
Similar wire can be found in non-stranded house mains cable.
First step is to work out what length to cut the elements. They should all be roughly the same length. This can be calculated by the simple formula:
which if you take as being the velocity of light in a vacuum (~ m/s; radio will travel a little slower through air, but who’s counting?) and as being and solve for you get 2.04m as the wavelength. We want ¼ of this, so I’ve aimed for 51cm long elements.
Don’t worry about them being perfectly straight when measuring, extra length is good at this point, you’ll want a good 2cm extra. You can make a wire shorter, you can’t make it longer.
Measuring the elements
Measure and cut the 4 elements. 3 will become your groundplane, and the 4th the radiating element. Also cut off about 10cm or so, give or take, which will be the ground wire used to hook the groundplane elements to the BNC connector. Also add to your parts list, some small velcro strips: you’ll find these handy to strap the coax to the squid pole.
Start with the short piece of wire. You’ll want to bend it into a rough triangle shape, with loops of wire at the corners. The groundplane radials will loop through these holes. The excess wire should be coiled up to one side: this is the loop the squid pole will pass through. The BNC connector will be fitted in between the 3 small loops.
Be sure you can still put the nut back on.
Take 3 of the four elements, and make a hook at one end. Pass this hook through each of the small loops in the triangle. Try to make them sit roughly straight out from the centre of the triangle, then solder each hook into the loop.
Attaching the radials
Having done this, put the BNC connector in and do the nut up tight. You can do away with the eyelet with the solder tag. To finish off, take your remaining element, make a hook just big enough to go around the centre pin of the BNC connector, then solder into place.
Attaching the radiating element
To finish off, bend this until it is vertical. The antenna is now ready for tuning.
Completed untuned antenna
Double check the length is about right. It should be around the 51~52cm mark.
To check the tuning, use a SWR meter or antenna analyser if you have one. Here, I used the built-in SWR meter on my Yaesu FT-857D. When using a SWR meter, ensure you’re running minimum power. The following are some results from my set. It is at this point, you do any trimming of your antenna. The following are without trimming the antenna, you’ll note that in most examples, the SWR is very low, just a point or so showing up on the left side of the screen.
To mount the antenna on your squid pole, feed the tip of the squid pole through the remaining loop. Bend the tip of the antenna around the tip of the squid pole. Hook your coaxial cable to the BNC connector and use velcro straps at regular points to hold the coax to the side of the squid pole.
Recommended coax for this purpose is RG-195. RG-58 will work, but is lossy, RG-213 and LMR400 are too heavy to use on a squid pole and will cause it to bend or collapse.
Update: This antenna performed quite well. Saturday, we used it for 2m packet, providing a digipeater for the stations in our area in case they couldn’t reach the main node (at “the pineapple farm” just outside Imbil). We had stable packet communications all day. Since the stations around us found they could work the main node directly, we swapped antennas around and used it instead for a VHF/UHF cross-band voice repeater. Signal reports were good through the Imbil state forest.
This last week the local repeaters here in Brisbane have been rather quiet.
One repeater I used to use a lot has been acting up, and so rather than potentially try to exacerbate a possibly worsening issue, I figured I’d leave it well alone until it was fixed.
Another I lurk on, has been working fine, but many of the people I’d talk to, are away on holidays.
So, I figured I’d dust off my trusty HF whip and give the lower frequencies another crack. This time last week I was getting nowhere on 15m. Maybe wrong place at the wrong time (Aside: is there ever a right time to be in the wrong place?) and so didn’t get anywhere.
40m I knew worked on this particular antenna, so I’ve been lurking there… calling in on the Coral Coast net on 7060kHz in the mornings, and tuning up and down the band on the way home. I make note of my listening frequency via APRS-IS, see my tracker or look for VK4MSL-10 on aprs.fi.
I knew the antenna worked there, not perfect, but it did work. It works particularly well when the other station is equipped to pick up weak stations. Earlier this evening, I set out from my workplace listening on 7060kHz where I was this morning. I noticed it was chock-a-bloc full of stations north of us. Indonesia and surrounds by the sounds of things.
Couldn’t make a head or tail of what they were saying, so I moved up the band, stumbled across a couple of “local” stations chatting around 7175kHz. Turns out one was portable in Barcaldine, didn’t catch the name, but the callsign was VK2DQC, I think. (I didn’t write it down.) We chatted for a short while, but apparently my signal was up and down like a yo-yo.
No surprise, I started the QSO walking up Greer Street, Bardon, continued my next over riding down The Drive, Cecil Road and Bowman Parade then up through Sunset Park. Anyone who knows that stretch knows it goes up then down then up again then down. I finished the chat as I came down Monoplane Street, Ashgrove.
Tuning around, I found another pair talking on 7158kHz. Bob VK6KJ and Bruce VK2??. As they were talking a third station, Joe, W5?? called in from Florida USA. To say I was impressed would be an understatement, all three were coming in Q5, and signal strengths in excess of S6 in most cases. Bob was peaking S9.
Joe mentioned is misfortune of having some equipment destroyed in a storm, and this necessitating the replacement of a computer along with its OS. Apparently he’s not a fan of “Window 8” (as we call it at work). I did try to call Joe but must’ve doubled and wasn’t heard.
I did though, manage to make contact with Bob. He was located in Albany, about 400km south-southeast of Perth, and running 400W into a two-element beam pointed at the US. With my measly 100W and stubby home-made antenna, I apparently was registering a Q5S5 signal with the odd drop-out.
Clearly Bob’s end was doing all the work, but impressive nonetheless. Seeing as the evenings can be particularly quiet, I think I’ve found a new past-time to while away the hour-long trip home, stirring up HF on the deadly-treadly-mobile!