#0037: Tip for securing a cabled USB type-A plug and socket together

#0037: Tip for securing a cabled USB type-A plug and socket together

Preamble

This is a quick budget tip for securing a cabled USB type-A male and female plug and socket together. This technique could probably be extrapolated for use with other plug types. However I have yet to do so.

Tip for securing a USB type-A male and female plug and socket together

Now onto the tip. Simply put, I use an elastic band to hook the two plugs together. That’s it. Done. Thank you for reading…

Still here? Okay, now onto the part where we explore in excessive detail such a simple concept. One so simple you probably have immediately intuited the basic theory of operation. If not then here it is. Basically, the elastic band applies a pulling pressure that keeps the plug and socket engaged. This is especially useful when you have an otherwise loose connection, typically caused by issues such as weak retention springs within the female socket. Something that seems common to USB extension cables in my opinion. At least the ones I have encountered.

Method of application

I like to start by using a basic cow hitch to lasso one of the plugs. This is done by folding the band into a loop and simply inserting a plug into this loop. Then tightening it around the plug’s plastic shoulders. That’s a basic cow hitch.

Now, with the other side of the elastic band wind it around the plastic shoulders of the second plug a couple of times until the elastic is reasonably taught. Then insert the male into the female plug. And done. The band should now exert force that will keep pulling them together.

Elastic band application demonstration video

Best practices

For best results, I recommend using a reasonably strong elastic band. I also recommend only wrapping it around the plug’s plastic enclosure itself, and not involving their respective cables. This is so that no force is applied to the cables themselves. Force which may aid in the development of faults such as repetitive flex damage, or a kink in the cable. Additionally when the band is secured on the plug body it focuses and directionalises the force in a way that better pulls the cable ends together.

An attentive reader may notice that in one of my example images, the one with the beige elastic. The upper band loop is a little bit too high up, and sits on the plastic wire strain relief itself, rather than the plastic plug body. What can I say? Do as I say, not as I do. 😉 Its really not a huge deal either way. Securing the loop on the plug body is just what I consider best practice.

Why not use adhesive tape instead?

Alternatively to using elastic bands, you may think: why not use tape to adhere the two ends together? Briefly put, tape is messy – it leaves glue residue when removed, it’s too permanent or hard to remove, and probably most importantly: it doesn’t put pressure on the plugs to keep them together. So as time passes the plug could slowly but steadily slip out of it’s respective socket. Due to things like vibration, gravity, or general handling.

Closing thoughts and my use-case summary

In my particular use-case, I use elastic bands like these to keep the USB extension cables attached to my 4 Watt USB lights and their switches. The weak retention springs within the female USB sockets on the extension cables allow any plugs inserted into them to eventually slip out.

I used to use electrical tape to manage this but, as time went on the tape lost it’s adherence. Yet left a mess of melted glue residue. After this I switched to using duct tape, but it was too strong, and too difficult to easily remove when I wanted to. Hence the bands. Third time the charm it seems.

So far, just common garden variety elastic bands seem to work best for me in this application. Whatever you can find is fine. Funny thing is, I didn’t even buy them. I just collected the ones that my mail man keeps dropping around my door.

All in all. This is an example of a zero budget application of junk that has gained value via use. At least I found it to be so. Anyway, I hope this article is of use to you. At the very least I hope I can raise a little awareness of the genuine potential uses of random household miscellanea. And that it may assist you in exploring alternative DIY solutions to purchasing one’s way out of any given problem. I know I have been guilty of that.

Thank you for reading.

#0033: Repair and modification of a Stylophone

#0033: Repair and modification of a Stylophone

Preamble

As a bid to get myself into creating music – or at the very least something music adjacent: I decided to purchase a Stylophone. A simple and cheap electronic synthesiser. Something budget friendly and fun looking with which to test out the waters.

What is a Stylophone and how does it function?

If you are unfamiliar with what a Stylophone is, I will briefly explain. A Stylophone is a handheld electronic musical instrument. A synthesiser that creates audible waveforms from electricity.

The most notable feature of this instrument is it’s set of oversized PCB (Printed Circuit Board) pads, which operate as musical keys. These keys are accompanied by an electrically wired stylus, which functions as their activator. To play a note, one just has to touch the stylus to a keypad. This then closes an electrical circuit within the device, in essence mimicking a keyboard (button) press.

Broadly speaking, component-wise: at the heart of a typical Stylophone lies a voltage controlled oscillator. This component creates a waveform when fed a DC voltage. This waveform is then fed to the speaker to create an audible tone. Since this is a voltage controlled oscillator, it means that it’s output waveform is dependant on the input voltage supplied. Thus voltage is used to control the specific sounds produced.

To control the oscillator input voltage, each musical note key on a Stylophone has it’s own circuit with it’s own unique resistor values that are different from all the other note keys. These resistors are used with the intention of stepping down the 9 volts input into whatever each note-key’s desired oscillator supply voltage is.

Although there is undoubtedly more to discuss on Stylophones; such as how the pitch change, or vibrato functions operate: they are largely out-of-scope for this simple introduction. Although I will go into further detail if/when I do a full device analysis on this Stylophone. (Link below when/if that article is written.) However in general Stylophones like this one are really not too complicated devices.

Tools and equipment

Tools:

  • soldering iron
  • hot glue gun
  • toothbrush
  • tweezers
  • desoldering pump

Consumables:

  • hot glue
  • isopropyl alcohol
  • desoldering braid
  • (leaded) solder
  • solder flux

Components:

  • red 5mm⌀ through-hole LED
  • ethernet wire (multi-strand copper wire)
  • 10kΩ potentiometer
  • toggle switch

Device Repair

Fortunately (or perhaps unfortunately for this article) the device needed very little fixing. It’s main faults were either cosmetic in nature or trivial to fix; and since the Stylophone was basically fully functional, other than the dirt and grime that had gotten into it over the years: there’ll consequently be little to say about it in this regard.

I will say that the sound it produced was a bit choppy (intermittent), probably due to dirty contacts on the keypad. This issue of dirty contacts applied to the two built in slide switches as well, as they where notably unresponsive. Flicking them produced unreliable results.

More specifically: flicking the power switch on didn’t always cause the device to power on. I had to toggle it a couple of times for it to operate as expected. Additionally I couldn’t even tell at the time that the “Vibrato” button wasn’t functioning. It was only until after it was cleaned and started working, that I realised what it actually did. It makes the sound of the notes “wobble”.

Since these slide switches were built into the PCB itself, rather than a discrete component than can be easily removed: I decided that the best course of action was to simply inject some isopropyl alcohol into them. Then work the switches on and off until they self cleaned. The combination of the alcohol breaking down the embedded grime chemically, and the friction from mechanical manipulation cleaned the electrical contacts.

Moving on. I cleaned the PCB keypad in a similar way. Dousing it in alcohol and scrubbing it with a toothbrush to remove any loosened debris. This simple cleaning fixed both the intermittent connection issues of the switches and keypad.

Another small but annoying issue I encountered was with the stylus’s wired cord. It was damaged. The cord had a deep nick on the inner side of a loop that it had to fold in on, in order for the stylus to fit into it’s receptacle. Because of the location of this damage, it meant that I couldn’t simply just put a layer of heat-shrink tubing over it and call it a day, as it would limit the cord’s flexibility. Which in turn would make it no longer able to fold up and fit into place.

Instead I decided to just replace the entire wire. This lead to the next issue. The stylus’s original wire is somewhat unique. It’s inner structure consists of loose bundles of stranded metal conductors (presumably aluminium) interlaced with plastic (nylon?) fibres. This made it significantly more flexible than any of my wire stock. This flexibility allowed the wire to fold in tight under the stylus when placed into it’s receptacle.

Since I didn’t have an appropriate substitute wire, I decide to just use the best that I had on hand. This consisted of a single line of pure copper multi-stranded wire that was salvaged from an ethernet cable. Since this wire was considerably less flexible than the original, it meant that I could not use the original cable hole to enter the stylophone, if I also wanted to use the stylus receptacle as well. This is because the new cable could not fold into the same tight space under the stylus the old one did. Prioritising the stylus’s use of it’s holder, I decided to just drill another hole for the wire towards the back of the stylophone’s plastic housing.

Now, with regards to the more cosmetic elements of this repair: firstly, I removed and straighten the bent metal grill top plate. I then scraped it and the plastic housing clean of all that yellow hard glue using a scalpel. Ultimately I replaced all the old yellow glue with hot glue after I cut up the grill to fit my additions.

Although as a whole, probably the most noticeable thing about this Stylophone: was the prominent yellowing of the plastic housing. This yellowing is caused by ultraviolet (UV) radiation in sun light. The more sunlight a plastic enclosure like this gets in it’s lifetime, the more yellowed (or even brown) it becomes. Ironically to restore these plastics to their original colouring, one has to use a UV light in conjunction with hydrogen peroxide.

I briefly considered whether or not I wanted to restore the plastics to their original white. And if this was a full restoration project I would have done just that. However this wasn’t the point of this project, since at the end of the day: I was planning to add some crappy home-brew mods to it.

Additionally, I actually rather like the yellowing of older machines. Computers especially. I find it nostalgic. It reminds me of a simpler time: of a young boy listening to the hum of a beige box as it powered on, and the clicking and chittering of the various drives as they promised quality escapism. Insert Sierra logo tune here.

Device Modifications

First things first: for anyone who might raise an eyebrow at my choice of components below, I wish you to know that I basically decided to modify this Stylophone with whatever junk I happen to have on hand at the time. I was unwilling (and somewhat unable) to purchase or salvage more appropriate components for the task.

Not a single part that I put into this machine works as well as they could if I did take the time to source (or install) things properly. However I think that for this particular use-case, such perfectionism is unnecessary. It was just a fun and experimental hack together; and ultimately a learning experience.

With that in mind, I made three simple mods. These were made with the aim to better facilitate my particular use case of this instrument. Something I will explain as I go on.

These mods are:

  • a power indicator
  • an internal speaker cut-off switch
  • and a volume dial for the internal speaker

1) Power indicator

The necessity of an indicator was made apparent to me: when I first picked up the Stylophone to find that I had left it on between sessions, and that the battery was now flat. Now that isn’t to say that the Stylophone definitively uses power when on but not actually playing. I’d need to test whether or not that is the case to say for sure. Either way really, a power status indicator is needed on this device to remind me to turn it off when putting it away. Simple as that.

To install a power indicator, I just used a basic 5mm⌀ red through-hole LED paired with a 330 ohm resistor. I tapped into the 9 volt positive side just after the power switch, and the negative side to the common device ground.

Unfortunately, this resulted in the LED being far too bright for my liking; with a light output that is more applicable for illumination, than as a device power status indicator. I really should have ran some basic ohm’s law calculations on this. Instead I simply used the same resistor value that I was accustomed to pairing with these types of LEDs on the 5 volt circuits that I am used to. Even then, they were rather bright. Now they are even brighter. I should have used a resistor with a much higher value. 1kΩ would likely do for a status indicator on a 9v circuit.

RED 5mm⌀ LED amperage and brightness comparisons

  • maximum continuous amperage: 30mA
  • recommended continuous amperage: 20mA
  • setup I am used to: 5v/330Ω=0.015A (or 15mA) –> reasonably bright
  • current setup: 9v/330Ω=0.027A (or 27mA) –> too bright
  • future amendment: 9v/1000Ω=0.009 (or 9mA) –> perfect for a status indicator

I should state that in my experience using ohm’s law like this is a good guide for component choice. However components are all variable. The vast majority of components all operate within certain tolerances of their stated values. Additionally they can also behave differently once within a circuit.

For example I tested a red LED with a 330Ω (actual value 329Ω) resistor in series on a breadboard and provided it with 9 volts. It’s current draw was 22mA. I don’t really know why. It should still be 27mA. I’m guessing that I am likely not adjusting for something, such as the inline resistance of the breadboard and it’s contacts. Either way, these simple calculations still allow a technician to set their general expectations with regards to component behaviour.

2) Internal speaker cut-off switch

In addition to the internal speaker the Stylophone also comes with an amplifier output socket (3.5mm audio jack socket). I intend to use this socket to sample the audio. Either directly, or via an intermediary signal amplifier of some sorts. This is an alternative to recording using a microphone as you would with an acoustic instrument for example. I think direct sampling like this would produce a cleaner signal, and ultimately better audio.

I added the speaker cut-off switch because I didn’t want the Stylophone itself emitting sound while I was sampling it using a computer. Additionally, since I am likely to be plugged in to PC audio using headphones during the process: the Stylophone playing to the room is unnecessary in this scenario. Hence it might as well be silenced in order to minimised noise pollution and/or disturbance to others.

To make this happen, I just added a switch to the line between the main PCB and the speaker. I decided to use a toggle switch because they are cool. Very simple stuff. That being said, I probably wouldn’t have bothered with a speaker cut off switch if I though of installing the volume dial first. This is because it effectively performs the same function. By lowering the speaker volume to virtually nothing, it does the same job of silencing the speaker.

This was however the first thing that I installed into the device, and I have to confess it was predominantly because I thought that toggle switches were rather neat. I like the tactile feedback of flicking a switch like this, and because of that, I then went looking for a reason to install it into something. I actually almost used two switches like this to replace the two built in slide switches; but decided against it when I saw how they where integrated into the actual PCB itself. Too much work for too little return.

As it is I did notice something interesting about this toggle switch. When flicked off, the signal outputted to the 3.5mm audio jack socket lowers in volume. I think this might have something to do with the cut-off switch taking the internal speaker out of the loop. Perhaps the lower impedance of the speaker coil draws a higher amperage. Which would provide a stronger signal which then would have access to the audio out socket: since it has been place in circuit parallel with the internal speaker.

It’s just a guess, I honestly don’t know why removing the internal speaker from the circuit would result in the signal volume on the audio output lowering. I’ll look into it further when it comes time for a full device overview of this Stylophone. Just for clarity, I should also mention that this does not happen when the internal speaker’s volume dial is set to lower the volume to zero. With it’s potentiometer adding ~10kΩ in series with the speaker in the process. It only happens when the switch cuts the speaker out of circuit entirely. Hmm. :/

3) Volume dial

This is probably the only add-on of mine that is actually an absolute necessity in my opinion. Simply put: the Stylophone’s default volume is too loud. It’s tinny high pitched notes can easily come across as obnoxious and irritating at it’s default volume. Especially, when the player is using it to learn by playing the same little tune again and again, and fucking it up half the time.

To install a volume dial, I placed a potentiometer in series with the speaker. That’s it. In this case I used a 10kΩ pot as that’s what I had to hand. Once it came to testing however: it became apparent that I was using less than a quarter turn to effectively move the volume from 100% to 5% volume. With the other approximate two quarters moving the volume from 5% to 1%. Interestingly, the volume never does go down to zero. Even with the full 10kΩ of inline resistance: I can still hear the notes coming out of the speaker faintly. (For context: this pot only rotates to approximately 225 degrees; i.e. to a little under three quarter turns.)

I think this may be the reason why older devices’ volume dials ended with switches. For example with mono-sound CRT televisions: they’d work the volume level with a potentiometer, and then once the volume was below a certain threshold the dial switch would click on to either mute the volume entirely, or switch the device off all together. With that in mind, it makes the unnecessary speaker cut off switch sound almost useful. Eh?

If I were to redo this add-on: I would probably replace the potentiometer, with one with a smaller resistance value range. Maybe a pot that caps at 2500Ω. This is because only the first quarter of the current 10kΩ pot is in effective use, as it represents the most dramatic change in resultant volume.

The main reason why I may want to use a smaller value potentiometer is because it will increase the amount of incremental control the user has over the volume. This increase in precision is caused by adding a larger number of degrees that the dial needs to be rotated in order to increment the volume. Ideally this will result in a full turn of the pot corresponding to the volume scaling accordingly (100% to 5%). As opposed to the current setup of 0 to 90° rotation representing a 100% to 5% volume level, with the other 160° of rotation essentially going to waste.

Another way I could possibly achieve this is by using the same 10kΩ potentiometer and pairing it with a fixed value resistor in parallel in order to bring it’s effective max resistance value down to around the 2.5kΩ I desire. I am honestly not sure how that would work out, as I am only thinking of this while writing. I will experiment with putting resistors in parallel with the potentiometer when it comes time to revise this device.

Before & After

Before

After

Video Demonstrations

Mod demo #1

Mod demo v1:

  • internal speaker output
  • vibrato function
  • speaker cut-off switch demo
  • volume dial demo

Mod demo #2

Mod demo v2:

  • power LED
  • internal speaker output
  • vibrato function
  • volume dial
  • speaker cut-off switch

Sound output demo

Sound output demo:

  • external output plugin
  • external & internal speaker dual output
  • internal speaker output
  • internal speaker cut-off switch w/ external output demo
  • internal speaker volume dial w/ external output
  • volume dial unable to mute completely
  • volume differences on external output w/ using speaker cut-off switch

Music demo (internal speaker)

Music demo (external speaker)

Closing thoughts

Ya’know reading back on this: it really is funny how much I could say about so little. At the end of the day all I did was purchase an old Stylophone, clean it up, and then stick a bunch of bullshit in it.

Now, some people may be mad that I did this to such an old device. I noticed that it was made in the 1970’s; and honestly it’s age did give me pause. However I paid very little for this Stylophone, and bought it for the express purpose to tinker with. Additionally, it was literally the cheapest one I could find. Spares and repair condition, economy delivery, no returns accepted. You know the drill.

Also let’s be honest here: not everything old is an antique (e.g. your mum ;)). A mass produced low price point item like this Stylophone is not going to be worth much any time soon. However my innate preservationist did have to hold his breath while I butchered this wee lad. I’ll say that much.

I will be revisiting it, mostly to repair my repairs. To lower the power LED’s brightness, to decrease the volume potentiometer value, and to look into the utility of the speaker cut-off switch. I did have a few other mods in mind as well for it. Such as a 9 volt DC barrel jack socket and power source switch. That way I can run it off a wall charger in addition to battery.

That’s right you heard me. If I am going to butcher a beloved piece of British history, I am going to go all out.

Thank you for reading.

Term glossary

CRT – Cathode Ray Tube
DC – Direct Current
LED – Light Emitting Diode
PCB – Printed Circuit Board
UV – Ultra Violet

Links, reference, further reading

https://en.wikipedia.org/wiki/MIDI
https://en.wikipedia.org/wiki/Stylophone
https://en.wikipedia.org/wiki/Synthesizer
https://en.wikipedia.org/wiki/Voltage-controlled_oscillator

https://www.youtube.com/watch?v=VU7vXMezW_I

#0025: Modifying a pair of Game Boy Advance SP earphones into an auxiliary audio dongle

#0025: Modifying a pair of Game Boy Advance SP earphones into an auxiliary audio dongle

Preamble

This article will consist of a basic tutorial on how to create a Nintendo Game Boy Advance SP (GBA-SP) audio dongle using a broken third party pair of GBA-SP earphones. Additionally I will also provide some related commentary (ramblings) on the similarities between Apple and Nintendo; particularly the way they design their products, and the way that their fanbases receive them. So if you have any old earphones you got as a child and broke yet kept, or maybe even recently purchased as spares and repair? Or if you are inclined to hear me bemoan tribal consumers and corporate avarice. Well here you are.

Creating an audio dongle

The actual conversion is rather simple. You just need to first cut the earphones off; then connect the wires as shown in the pinout and wiring diagram below.

Pinout

Audio jack
1: left speaker positive
2: right speaker positive
3: common ground

GBA-SP port
1: right speaker positive (red wire)
2: closed loop switch
3: (pin absent)
4: left speaker positive (blue wire)
5: common ground
6: closed loop switch

Now that we have the broad methodology of what to do to create an audio dongle, I’d like to talk about a few specifics.

Closed loop switch

In the pinout diagram I labelled pins 2 and 6 as “closed loop switch”. What I mean by this is that there is continuity between these two pins. This means that they are electrically connected to each other. I believe they are configured in this way in order to act as a switch when the plug is inserted into the device.

The electrical connection between the two pins effectively closes an open loop within the device. One that terminates with these pins’ respective sockets. This loop is probably used so that the device can know when an audio peripheral has been connected. This is so that it can act accordingly, by for example switching off it’s built in speaker.

Where to cut the donor earphones cord?

This might seem like a rather simple question at first. However in order to answer it, I needed to answer a few other questions before knowing where exactly I wanted to make the cut. The most important question that needed answering is does the pair of earphones actually work properly, or are they broken somewhere.

Assuming that they have at least one fault somewhere within them, where is the fault? If you can not easily identify it, yet the earphones are still not outputting sound. Then perhaps the fault is hidden. In this case, it will mostly likely be either at the earphones themselves due to snag damage; or if you are unfortunate, it’ll be located near the plug due to something akin to repeated flex damage. Please note that I am just speculating from my experience with repairing headphones.

Once the fault is found, then you must make a decision. Repair the fault, or cut if off (if applicable). In my case the fault was at the left earphone itself. I didn’t probe further than identifying roughly where it was, since I had no intention of repairing something that far down stream. I did however consider whether or not I wanted to retain the inline volume dial. After some consideration I decided to remove it. The reason for this is that I feared that the relatively low quality of the componentry involved; such as the potentiometer, or the PCB and it’s solder joints may actually negatively affect sound quality. So I just snipped it off. Didn’t like it much anyway. It didn’t feel nice to use.

What type of plug or socket to terminate the cord with?

This question was primarily answered by the materials I had available at the time. I did not have an appropriate female 3.5mm audio socket available. However I did have plenty of male 3.5mm jacks on hand; including ones that were corded. In the end I went with a jack that was colour matched (black) and that had the smallest profile.

This male jack enabled me to plug the GBA-SP into an auxiliary port on a sound system should I wish to do so. Additionally when coupled with a female-to-female 3.5mm audio adapter, it enabled me to use headphones or speakers with the dongle. This setup basically gave me the same functionality as having an adapter that terminated in a female 3.5mm socket, paired with a typical male-to-male auxiliary cord.

Soldering the jack

When it comes to soldering audio jacks like these: the first actual thing I did was prepare the heat-shrink tubing for it. Selecting the right sizes and cutting them to length. I prepared two pieces, which I thought was sufficient at the time; however in hindsight I should have prepared three distinct pieces. One to isolate each line.

As it is, it has one to insulate the central shaft from the surrounding ground pad, and one to act as an outer cover; protecting all three wires and acting as a general guard against flex damage for the entire cord. It’s good enough, but it would be better in my opinion if the inner two wires were separated by more than just the enamel coating of the wire strands themselves, as I have left them. A smaller gauge piece of heat-shrink tubing on the inner terminal to cover it’s solder joint would’ve been better.

As for the soldering itself: audio jack terminals like the one pictured can be rather tricky to wire up and solder properly. The reason for this is due to a range of factors. Factors such as: the general fiddliness and fragility of the enamel wires themselves. Although more-so the close proximity of the jack’s terminals to each other, coupled with the convex curve and orientation of their soldering pads, is what adds difficulty; as the awkward angles involved can diminish dexterity.

Additionally, the presence of structural plastic insulation between the terminals, meant that a lower heat and a shorter soldering dwell time was needed. This in order not to damage the jack’s plastics with radiant heat from the work area. Otherwise the plastic will melt and warp the plug’s general shape and structure. All these various factors can make it difficult to solder in a reliable and repeatable manner. However practice and work flow optimisations will mitigate these type of annoyances as one gains experience in this task.

An example in which I optimised the process: was by preparing the wires for soldering by removing their enamel insulation. This is because prior to this: during soldering, the enamel coating on the wires sometimes wouldn’t burn off within the liquid solder blob itself; especially with the necessary (relatively) low heat and short dwell time. When this happened, it resulted in the wire not forming a good electrical connection and/or not bonding physically with it’s solder pad.

I chose to prep the wires by burning off a segment of their enamel coating using a lighter. This had to be done in very quick manner in order to not oxidise the underlying copper strands too much. Burning off the insulation in this manner allows me to quickly solder the wires into place without worrying about any complications from the insulation.

After removing a segment of insulation in this manner, I chose to attach the wires in a way that limited any exposed segments of wire present outside of the solder joint. This is to limit any exposed conductors. Consequently, the solder joints were close to their respective wires’ insulated ends, and only used the exposed segments to get a good electrical connection within the solder joint itself. After-which I’d snip off any excess exposed wire that preceded the joint.

Testing the cable

The attentive readers amongst you probably have noticed that my repair notes contain several resistance tests of the various lines. Most I ran while working on the device, those are the numbers closer to the hand-drawn diagram. Some of which have been struck out. Discount those. The ones of interest are at the bottom of the notes. Those are the results from the post repair test.

The reason for the final test was because I was dubious of the quality of the cables that I was working with. As well as generally dubious of audio cables of this calibre. Specifically, cables that consist of a small collection of loose strands dipped in (I believe) enamel for insulation; then interwoven with additional plastic or nylon strands for strength. They all look and feel fragile and cheap. Having said that however, I should say that a post repair test is a good general practice. Even when confidence in the repair is high.

As you can see the left speaker line has a end-to-end resistance of 10 ohms. Five times that of the right speaker line, and ten times that of the common return (or ground) line. The right and return lines have acceptable resistances in general, and accurate relative resistances to each other. I expected the return common line to have half the resistance due to the doubling of the lines. However, what was unexpected was that the left line was clearly an outlier in line resistance. This in my opinion is due to either the low quality of the cable in general, or a hidden defect I did not find.

It’s not ideal, but upon testing with actual sound, the loss of volume on the left line speaker due to it’s higher line resistance was not noticeable at all. So I just left it be. The effort necessary to track the fault that is adding the 8 ohms to the line, is not worth the reward of having perfectly balanced lines for a GBA-SP’s audio. I used to call it laziness not ploughing down these types of rabbit holes. However as I have aged, I have come to understand the diminishing returns on investments that this type of perfectionism offers.

Completed mod demonstration

Related thoughts on Nintendo and their Game Boy Advance SP console

Now that we have created our own DIY audio dongle, let’s talk about why we needed to do this in the first place. In other words, why the Game Boy Advance SP doesn’t have a built-in 3.5mm audio port to begin with. In order to get at this answer, let’s first discuss a completely different technology company and it’s products. As to why, I’ll let you join the dots.

Many people today (2021) credit Apple as one of the most anti-consumer consumer technology companies, specifically with regards to their product design. Although there are numerous examples I could pick out, the one relevant instance here: is the removal of the generic 3.5mm audio jack from their 2016 iPhone 7 models. Anyone who pays any critical attention to this company probably came to a similar conclusion to my own. (Proceeds to pat self on back.) This naturally being that they did so in a bid to to sell first party audio peripherals at a premium. This being to their captive audience of fruity cultists. Cultists that would happily eat that up.

Why am I mentioning this in a Nintendo article? Well it’s because peoples’ memory is generally fickle and often mired with nostalgia; and the residual emotional attachments that it incurs. This leads them to holding double-standards when it comes specifically to childhood brands like Nintendo, often holding them to a lower standard of conduct than brands like Apple. These same people forget that their friend Nintendo did the same thing 13 years prior in 2003 with the incremental release of the Nintendo Game Boy Advance Special (GBA-SP) portable games console.

A games console that had no tangible advantages over it’s Game Boy Advance (GBA) predecessor other than a few quality of life (QoL) improvements. Both consoles played exactly the same games, however the SP boasted: an internal rechargeable lithium-ion battery, and an LCD backlight. For consumers tired of repeatedly buying new AA batteries for their GBA, or always awkwardly angling the unlit LCD towards a light-source whilst avoiding glare; these were improvements worth investment. Those of you who can read between the lines, might’ve guessed that this internal battery naturally required a specific Nintendo battery charger. A theme that they continued in later products such as with the Nintendo Dual Screen portable console (NDS).

However, a more apt feature of criticism in the iteration from the GBA to the GBA-SP, is the removal of the 3.5mm audio jack. Why did they do this you may ask? Well, now I could be wrong, but the cynic in me says that it was to facilitate Nintendo selling official audio peripherals at a premium, to their captive audience of pedantic neck-beards in waiting. That’s us mate.

Laughably, Nintendo’s official response against their audience’s pushback in 2003 was basically the same as Apple’s in 2016. They both said something to the tune of: that the new device simply didn’t have the space for a 3.5mm audio jack. Apple added some device waterproofing claims to this as well. But the core reason was the same: that there’s simply no space for it. Now shut up and buy our official peripherals. Peripherals that use the same port for both audio output and power delivery. So good luck using wired headphones and charging the device at the same time. Enjoy.

To cut it short. My point is that Nintendo has proven themselves to be as anti-consumer as Apple when the mood takes them. However it saddens me that their customers are prone to look at this company through rose tinted spectacles. Often even shouting down valid criticism, yet many within the community still consider themselves distinctly different from the stock of Apple enthusiasts.

That’s what happens when one thinks with their feelings. It’s tribal fanboy-ism at it’s finest. People for whatever reason forget that an individual’s relationship with a company or business like Apple or Nintendo, is strictly transactional. Nothing more. They are not your friends. A corporation does not have the capacity for camaraderie, or loyalty. Only the capacity to take advantage of such feelings in order to sell more to the same people.

Obviously, I am not talking about the entire consumer base here, just the vocal fanatics that seem to dominate public discourse. If anything a logical or reasonable person who likes the products of a particular brand to the point of becoming brand loyal; should ideally, be even more critical (than the average Joe) of their chosen company when it strays into anti-consumer practices. Due to their investment within the brand and it’s products. They likely would wish for them to stay good, more than a person who isn’t all that invested. But that’s not the world we live in. Instead the more invested a person is in a brand, it seems the more likely they are to tribally defend them regardless of circumstance. It’s sad really.

Closing thoughts

I know what you might be thinking, this article is nice and all, but it’s also almost twenty years too late. I mean in previous years getting a hold of an audio dongle for the GBA-SP might have been troublesome or expensive. Back when (the famously litigious) Nintendo were still protective of the console. However in 2021, one could easily purchase a NEW Game Boy Advance SP audio dongle from Ebay for less than a fiver. Since Nintendo doesn’t care much about protecting the rights to peripherals for a console that old (read unprofitable). Sure, the item that you buy won’t be an official Nintendo product, or even a notable third party contemporary brand peripheral, like Competition Pro. But it’ll work. Probably.

example of an unbranded Ebay adapter

To answer that question: Yes, yes you could. You could purchase an unbranded china special peripheral for your almost twenty year old console. Alternatively you could also make use of any old and/or broken first and third party peripherals that you may already have lying around, or even purchased in a mixed joblot or bundle. Essentially converting (basically) e-waste like that into a useful cable. One made to your exact use case and specification no less. Chances are your convert will also be better quality than a bought cable depending on what materials you use to make it.

Mine isn’t, I made mine from a pair of Competition Pro earphones. But still you get my point; I bet if you made yours from a pair of official Nintendo earphones (should you happen to have them), they might be better quality. As for making something for a specific use case: I totally use mine to blast Castlevania: Aria of Sorrow’s soundtrack, via my home sound system. I do it for maximum “immersion” during my midnight gaming sessions. I also want my neighbours to know that I am cool. The banging on the wall seems to indicate that they do.

Thank you for reading.

Links, references, and further reading

https://docpop.org/2016/09/apple-learn-nintendos-headphone-mistake/
https://arstechnica.com/gaming/2016/09/no-headphone-jack-nintendo-did-it-first/
https://en.wikipedia.org/wiki/IPhone_7#Headphone_plug_removal
https://en.wikipedia.org/wiki/Game_Boy_Advance_SP#Headphone_jack

#0024: Preparing a Helping Hands tool for effective use

#0024: Preparing a Helping Hands tool for effective use

Preamble

This article covers the modifications necessary to get a box fresh Helping Hands tool ready for service. The specific version of this tool being the pictured unit. A version that consists of a small horizontal metal bar that is mounted onto a weighted base. The bar then has three adjustable arms attached to it. Two terminating in metal crocodile clips, and the third in a magnifying glass. This unit although useful and good quality for it’s price, it is also cheaply made, and mass produced. As such it requires some preparations before it can be used to good effect.

What is a Helping Hands tool

At its core a Helping Hands is a tool that consists of an adjustable jig with arms that terminate in spring loaded grabber clips. These clips are designed to hold materials and workpieces in place. This is in order to assist the user when working on them; for example: holding wires in place for tinning, or in preparation for a soldered connection.

Helping Hands are also known as “Third hands” or “X-tra Hands” depending on marketing. Although there are likely to be variants in design due to marketing, the basic tool is the same. It consists of some form of adjustable jig, with two or more grabber clips attached to it. Many variants also have adjustable arms that terminate with either a magnifying glass, or a light source of some description. They may also come with things that are specialised for a specific task: such as a soldering iron holder, or a mini microscope mount. However these are outside of the scope of this article. We will only be discussing the rather cheap and generic example unit that is pictured.

Modifications

Mod #1: Padding the crocodile clips’ jaws

The first necessary modification is rather obvious when you have a new unit in your hands. The actual clips that hold the various workpieces and materials: are crocodile clips. Crocodile clips complete with serrated teeth and a fairly powerful spring ready to push those teeth into anything that comes between it’s jaws. These needless to say leave noticeable teeth marks on anything softer than the clips’ steel when in use.

I recommend using several layers of heat shrink tubing to pad the teeth. This is because heat shrink tubing is generally tough enough to make it resistant to being pierced by the teeth’s serrations. Apply a layer of heat shrink to each jaw in turn. Then heat it so that the heat shrink, shrinks into a fitted profile on the teeth. Keep adding and heating layers in this manner until you are satisfied that the serrations of the teeth are sufficiently padded and will no longer damage anything that the clip holds. At this point, you may wish to trim off any excess tubing with a side cutter.

In my opinion heat shrink tubing is a good candidate for this application due to the fact that it does hug the profile of the teeth so well, while still padding the biting edge off of the metal. This clinging to the peaks and troughs the teeth is important because it allows the clip to still have an effective mechanical grip on the workpiece.

Additionally the rubber material that heat shrink is made from also assists in effectively gripping the held object using friction. This is useful when it comes to holding metal objects, especially cylindrical ones like telescopic radio antennae. A mechanical grip alone is likely to slip, coupled with the springs: I can see the jaws throwing out objects. A friction grip is necessary to hold low friction hard-surfaces such as metals.

Other reasons why heat shrink tubing is well suited to this particular application, consist of: firstly, the rubber material it is made of is relatively heat resistant (i.e. it takes continuous high temperatures, or a direct flame to effectively melt it). This means that the user can use solder irons and hot air around it without worrying about having to either clean or refit their Helping Hands tool. As would be the case if they used electrical tape for example.

Secondly, it is also a mild insulator of heat, this prevents heat from easily conducting into the metal clip and into the larger frame of the tool. Why is this important? It means that the user can use a soldering iron with a lower thermal mass effectively. Whereas without insulating off the greater frame of the Helping Hand tool, it will conduct away the thermal energies from the point of application. e.g. whilst soldering a joint on a metal object such as an antenna terminal.

This will require either a higher temperature setting (as a bid to compensate for the leeched energies), and deal with the associated risks and drawbacks; or having to simply use another soldering iron with a higher thermal mass. Alternatively it should be said that, insulating the metal clips in this manner really might not even have a significant effect on for example soldering performance, it largely depends on use case specifics. If you are for example using a 10 Watt USB soldering iron, well then you’ll need all the help that you can get; including this. Whereas for a more average setup, you may not be noticeably affected either way.

Mod #2: Hot glue in the clips connecting arm joints

This is an often overlooked modification that you can make to effectively extend the working life of the product. It simply involves getting a hot glue gun and pumping hot glue into the connecting joint that attaches the crocodile clips to the main jig. This is needed because the out-of-the-box setup only has those joints held in place using a friction fit between the metals of the clip and the jig arm. Unfortunately as you use the tool and rotate the clips, it will loosen the metal’s spring pressure that holds it in place until the clips just slide off. Repeatedly.

Additionally, re-tightening the friction fit using a pair of pliers will not keep the clip in place for long, just delay it falling out for a little while. Unfortunately in my case the entire clip arm kept falling out and no amount of tightening made the clip arm stay in it’s cradle, as effectively as the initial friction fit did. Hot gluing them in place however fully prevents the clip arm from sliding out of it’s cradle. It really made a very strong bond. One that is better than the original friction fit. The only trade off is that the crocodile clip can no longer rotate at the wrist joint where the friction fit connection was. Instead all rotational adjustments need to be made at the arm’s elbow joint from now on.

You might’ve wondered as to how exactly does this laughably simple modification actually extend the working life of the tool. Well, I will endeavour to answer this question with another question (or more). Have you ever had a tool that kept falling apart on you when you needed it to just work? Falling apart in moments where you might already be somewhat stressed trying to fix something broken? Maybe even whilst on a time limit? In that moment, have you ever grabbed the offending tool cursed it out, then promptly threw it into the trash? That’s how pumping those annoying joints with hot glue will extend this tools working lifespan. It’ll help this tool effectively keep it’s head down and just do it’s job.

Closing thoughts

These are simple enough modifications and are rather ubiquitous with regards to this particular tool. Even the image of the ‘dabbing’ Helper hands on the Wikipedia page for this tool, has the same teeth mod. Although they used electrical tape. Which in my opinion is an inferior material to use. Firstly its a less permanent solution due to the material’s general strength, meaning that sooner or later the teeth are going to poke through it. Additionally, it is also more susceptible to heat; meaning that if the user solders a wire for example too close to the clip they run the risk of melting the electrical tape.

That being said, small mods like these are most definitely better than nothing, and worth mentioning in order to help people not overlook them due their rather trivial nature. This is because little mods like this are easy to implement and can help the user make the most of their cheaper tools in general. Even if you are half-arsing it by using electrical tape, says the out-of-touch heat shrink tubing elite.

Thanks for reading.

Dabbing Helping Hands image from Wikipedia.org

Reference, links, and further reading

https://en.wikipedia.org/wiki/Helping_hand_(tool)

#0019: Creating custom cables for test equipment

#0019: Creating custom cables for test equipment

Preamble

I wanted to write a little on test cables in general, more specifically about the actual quality of the cables available at the lower end of the consumer market. Highlighting the prevalence of these types of cables, including the products that they tend to accompany. I also intend to instruct briefly how the end user can test these cables and how they can create their own superior home-made versions.

Low-end retail cables for test equipment

In my opinion low quality cables are especially evident in instances where the cables come bundled in with many lower-end chinese consumer test devices, as opposed to purchased separately. This is especially true in cases where the product is unbranded. Think cheap test equipment such as: £10 multimeters, or £50 bench power-supplies. For example the probe cables that come with the DT-830 multimeter.

To clarify I am not talking about genuinely dangerous or illegal (according to british safety law) cables, just low quality ones. Things such as chinese power cables that do not comply with the british safety standards – which are genuinely hazardous to the user and not fit for purpose; are outside the scope of this article. Genuinely dangerous cables like that run the risk of being confiscated at customs. I wrote an article on such a cable; it was a non-compliant BS1363. Link below. No, I am specifically talking about cables such as the ones on multimeter probes, and on bench top power-supplies. Inoffensive dreck.

article hyperlink: #0004-dangerous-non-compliant-bs1363-plug

Example of low quality cables bundled with multimeter

What factors dictate a cables quality?

Many times low quality wires will have a noticeable resistance value across them. This is often due to the cost cutting measures of the manufacturers. These include constructing items with lax specifications (quality control), or by saving on materials used. For example by minimising the number of actual strands of the copper conductors present within the cable, or by opting for a cheaper material substitute such as aluminium.

These cables being built to such a restrictive price-point: is what makes them very flimsy, basically disposable in many cases. Many of these types of cables are in my opinion, are merely designed to just tick the “comes with accessories” box in a products’ marketing materials.

This unfortunately makes the cable virtually without genuine use outside of the specific one that it was manufactured for. Often not even that use-case for long, due to their general fragility. So if you have some of these low quality cables in use. It may benefit you to replace them as soon as convenient; as they may be hampering your devices’ ability to perform.

For example, cheaper multimeters such as the previously mentioned DT-830 or the XL830L, are generally rather accurate. Often staying within a less than 2% error deviation from each other. However any variable resistances across their probes’ cables may affect their readings. They may for example: cause a notable voltage drop when in use, or affect the threshold for a continuity test.

A good example of a low quality cable would be: a power-supply cable that I got with my chinese bench-top power-supply. An unbranded QW-MS305D. By the by, it was actually the same unit that came with the non-compliant BS1363 plug. Never-the-less, the power-supply’s cable in question was used to power devices under test with DC voltages; as such they contain a male banana jack on one end and a crocodile clip on the other.

Although it is a relatively cheap power-supply, it could still reliably output it’s rated 30 volts at 5 amps. The only issue with the out-of-box setup (minus the bad plug), was that the output cable heated up and often got soft when exposed to the higher amperages that the power-supply could output. Although it took sometime for this to happen, i.e. it needed continuous output over several minutes. I still judge the cable as unsuitable for purpose. One thing I found humorous after the fact is that the online seller that I bought from had this same accessory packaged with the 10 amp version of this power-supply as well (QW-MS3010D).

Example of low quality cables that came with the power-supply

Using salvaged materials to create custom cables

As a response to the performance of the bought cable, I retired it. I removed the cable ends and attached them to a salvaged mains cable; and it has worked fine since. I really like using salvaged mains cables for these types of applications. Especially ones from UK safety certified devices; and especially ones from heating units. Such as electric room heaters, or toasters, electric grills, kettles, etcetera. Basically anything that uses electricity to generate resistive heat. This is because their cables are specced to allow large amounts of current to pass through them without heating up themselves.

For example: a typical mains oil heater, is rated for 1500 watts. This means that it’s cables need to safely pass that amount of power across them concurrently while the device is in use. When converted to volts and amperes; this means that these cables are able to handle 240 volts AC at 6.25 amps. This leaves me confident that it can safely handle the maximum 5 amps, 30 volts DC of my power-supply over long periods of time.

They do this by having very little resistance across the cable length. This is accomplished by actually putting copper in your copper cables. Although after looking at the example photos that I have, it appears that this particular cable is actually using aluminium strands as conductors.;) However the point stands; there are sufficient conductors within the cable, that the current can pass across it unhindered. I.e. The cable is of a big enough gauge, not to bottleneck the higher currents.

One thing to pay attention to when creating your own cables beyond the quality of the cable itself; is how you connect the various plugs you wish to use to it. This is because a poor connection here can impede the passage of electricity; and add resistance to the line. I suggest firm connections with as much conductive surface area touching as practical. It is also good form to do a resistance test across the entire thing once completed.

Another good source for quality salvaged cabling, is old or damaged ethernet cables. The twisted pairs within work very well in lower voltage DC applications; including carrying signal voltages (like binary data). The pair windings are configured to minimising interference for their carried digital signals after-all.

I like to use them to make home-made breadboard jumper cables. This can be done by just unwinding a length of cabling, cutting to size, then tinning the ends so that they can interface with the breadboard. Will it pretty? probably not. Will it be functional? 100%.

You could also use ethernet cables for replacing a cable between an external DC power-supply (or power-brick) and it’s paired device (e.g. Laptop). I tend to opt to wind together a pair of cables, if I wish to reliably carry current at higher DC voltages (e.g. 20VDC @ 3A for a laptop). However any higher than that and you’d be better served by using thicker gauge wires.

Home-made custom cable for power supply

Example of resistance test used to determine cable quality

Closing thoughts

That’s all really. I just wished to highlight that some low end cables are not good, and to encourage you to create your own superior cables using parts from common household devices.

Thank you for reading.

#0018: Creating and utilising QR Codes

#0018: Creating and utilising QR Codes

image of a QR code

What is a QR code?

QR codes are a type of barcode. Barcodes are a visual representation of digital (or binary) information. They are designed to be easily understandable by machines. Barcodes enable machines to do useful operations that involve interacting with the physical objects, that the barcodes are placed on. Such as sorting or counting large volumes of items accurately. For example, with packages at a mail depot, or product inventory at an automated warehouse or factory.

A QR code (or Quick Response Code), is a type of 2 dimensional barcode, otherwise known as a matrix barcode. All this means is that it represents it’s binary information visually across two axis (x and y). It does this by plotting black (1) and white (0) squares on a grid. Matrix barcodes are an evolution on the iconic one dimensional barcodes; which represent their binary information in a single array of black lines and white spaces (i.e. columns), that denote their ones and zeros respectively.

It should be noted that there are numerous different types of barcodes (both 1D and 2D) in use today. Each one is specialised to their specific applications. These specialisations manifest themselves with variations in visual design (e.g. with markers for orienting scanners with different protocols); barcode size, reflecting how much data they need to represent/encode; and data encoding ability; i.e. what type of data the barcode image represents (typically: numbers, or ASCII symbols).

The most obvious difference between one dimensional (array) and two dimensional (matrix) barcodes, is the addition of a Y dimension of information. This addition allows for a greater density of information to be stored, however it also requires more sophisticated tooling to actually read the data from the barcodes themselves. The most notable hardware difference in this regard is that one dimensional barcodes use a simple laser line scanner, whereas matrix barcodes require a camera module. Because of this, you typically can not read any matrix barcodes with hardware designed for 1D barcodes, however in many cases (providing that the software allows for it), you can use a matrix barcode scanner (e.g. smart phone) to read information from 1D barcodes.

Additionally, I make assumption that on a barcode: black denotes a one in binary and white a zero. Whereas in reality, it really doesn’t matter. This is because the interpretation of the barcode is all up to the protocol standard that it is using. For example with the case of a UPC-A type barcode, where it uses a 7 bit array to denote numbers. Different value bit arrays can symbolise the same (base 10) number depending on it’s location on the barcode.

image of a UPC-A barcode
UPC-A barcode image taken from wikipedia.org
table taken from wikipedia.org
Example of a 1D barcode in use as store’s inventory identifier

Consumer uses for QR Codes

I’ll limit this discussion to consumer use cases and applications because industrial applications are rather dry. They use QR codes in the same way they use other barcodes. Which is to orientate machines that operate with and around physical goods. This could include use cases such as at an Amazon sorting depot, barcodes are used to inform the sorting machines of what goods are in what shelves.

Where as within the consumer space; most QR codes in the wild, are simply used as a means of storing website links and affiliate information. These are designed to allow people to simply scan the code out of a magazine, business card, coupon, or what-have-you; in order to very quickly load the website hyperlink and/or fill a virtual document.

For example, a QR code at a public WIFI access point will have all the data necessary (link to login page, SSID, password) to allow the scanning smartphone to access their network. Likewise a QR code on a coupon will link to the retailer’s online store page and pass any promotional offers associated with that coupon automatically to it’s e-shop.

QR codes, at least when dealing within the consumer space, are predominantly a means of convenience. They reduce the friction encountered when user’s operate within virtual spaces. Friction such as inputting long arbitrary names or numbers (such as a WIFI network’s SSID or password); or website domain names, where a typo could expose the user to a potentially malicious imitator website.

The friction is reduced because the process of scanning a code with a modern smartphone is far easier, than inputting the data manually using (most likely) a touch keyboard into that same smartphone. Another benefit is the probability of user error (such as mistyping a password or domain name) is eliminated. This is done by automating the process of data entry and bypassing the user in that work flow. That’s what I believe constitutes the vast majority of useful applications of QR codes in the consumer space, at least this is the case when talking strictly about static QR codes.

Additionally. The Wikipedia article for QR codes list many different (specific) use cases for them in the the consumer space; however in my opinion they all boil down to the two things I mentioned earlier: following links and filling in virtual documents.

Anatomy of QR codes

The smallest unit of information on a QR code is referred to as a module. A module is a single square that is coloured either white or black. For example a version 1 QR code is made up of a 21 by 21 module grid, totalling 441 individual modules. If you were to count all the chequered squares along either axis, it will add up to 21.

Look at the below two examples, both of these QR codes are identical Version 1 QR codes. They both have the same 441 distinct modules on a 21 x 21 grid. The only difference is the actual image size. This should illustrate that (within reason) the actual pixel (or print) size of the modules doesn’t matter with QR codes. As long as the scanning devices’ cameras can fit the entire code structure within frame and focus.

Bash instructions:

qrencode -o qrc_V1_small.png -s 3 'ECC'
qrencode -o qrc_V1_large.png -s 6 'ECC'

A QR codes’ modules are organised into several structures. These include: three position markers, several alignment markers (number varies with version/size), a version information zone, a format information zone, a timing zone, an area for data and error correction keys, and finally a blank quiet zone to denote the border of a QR code.

image taken from wikipedia.org

QR code size specification

QR codes are rather versatile, they have the ability to encode: ASCII symbols (letters and numbers), media (images, sound, and video), as well as even executable programs (compiled binaries). However, although they technically have this capability, it is severely hampered by the size limitations of the QR code standard.

At the time of writing, the largest viable QR code that can be created is the ‘Version 40’ variant. QR code Version 40 can encode up to: 7089 bytes of pure numerics, 4296 bytes of alphanumerics, 2953 bytes of miscellaneous binary (e.g. media), or 1817 bytes of Japanese Kanji characters. This is done using the lowest value (level L) of error correction, thus leaving more space for actual data. So these are the absolute maximum values.

Refer to file “QRcode_version_table” below for a full list of all version specifications.

image taken from wikipedia.org

Test case of numerical barcode capacity

This was an interesting one, because although the version 40 QR code specification states that I could create a numerical QR code with a capacity of 7089 bytes. In actuality the maximum amount of data that I managed to fit into a QR code was 7080 bytes. I honestly don’t know what to make of that. The ECC (level L) was supposed to be factored into the 7089 max value, i.e that is the maximum data storage in addition to the space that the error correction takes up. So it can’t be what’s limiting me from the max value. As to what is happening, I’m not sure. It could be anything, including a limitation of the program I used to create these codes (qrencode), or it could be some unknown setting, text file associated metadata, or even some unnoticed human error in play. Hence I will include the input files I used here so that you can try it out yourself, and see where I messed up.

Bash instructions:

qrencode -r pi_decimals_7081.txt -o qrc_pi_7081.png
Failed to encode the input data: Input data too large

qrencode -r pi_decimals_7080.txt -o qrc_pi_7080.png
Successfully compiled QR code containing 7080 bytes of pure numbers
According to Xed, this file weighs 7080 bytes.

QR code Error Correction Capability

QR codes have a built in Error Correction Capability (ECC). They use the Reed-soloman error correction codes in order to facilitate a certain level of data redundancy. This enables QR codes to be readable even after they have sustained damage. Such as by getting scratched or being partially obscured by grime. This error correction facility comes in four levels: L, M, Q, and H. The error correction of each level is expressed as a percentage of the total data that can be lost whilst maintaining the QR codes readability.

This is as follows:

  • L has up to a 7% ECC
  • M has up to a 15% ECC
  • Q has up to a 25% ECC
  • H has up to a 30% ECC

Generally speaking, the error correction capability of a QR code isn’t free. The higher levels take up more of the QR code’s finite available space, space that could otherwise be used to encode more of the actual substantive data itself. This trade off between useable storage space and data read reliability, means that QR codes with higher ECC tend to be used in environments where code damage is more likely; or in applications where the printed QR code itself is going to in active operation for a longer time period. Such being attached to warehouse racking to identify the specific shelf location and product contents to an automated sorter machine.

image taken from archive.org – qrcode.com page

How to spot the ECC level on a QR code

To work out what type of ECC level set on a QR code, look towards the “format information” zone to the right of the lower left position marker. Immediately after the single column of blank (white) modules of the position marker, at the bottom of the QR code and the module just above it. These two modules display what level of ECC is employed within the QR code.

Bash instructions:

qrencode -l L -o qrc_ECC_L.png 'ECC'
qrencode -l M -o qrc_ECC_M.png 'ECC'
qrencode -l Q -o qrc_ECC_Q.png 'ECC'
qrencode -l H -o qre_ECC_H.png 'ECC'

zbarimg *.png

Using ECC to incorporate logos into QR codes

When I looked into how people actually created the fancier QR codes; the ones’ that incorporate graphics such as text and logos. I was genuinely surprised at the crudity of the methodology. I thought that it may involve something akin to passing arguments to the QR code generator to re-route the data sectors around the graphic. Nope. It’s actually laughably simple. If you wish to incorporate graphics into your QR code, just crank up the ECC to max. Output the QR code. Then slap that graphic on top the QR code using some graphics manipulation software. In this case GIMP. Done. I mean it does the job. I just don’t like the idea of purposefully damaging data integrity.

Look at the below examples. Both of these QR codes hold the same data. This being a link to this website’s homepage. The size disparity between these two is caused by the additional error correction code added to the level H QR code. It caused it to jump up a couple of versions. I’m guessing that since my logo covers more than 7% of each of the QR codes, this is the reason why the level L QR code is no longer functional, whereas the level H QR code continues to function after the addition of the logo due to the logo covering less than the 30% of it’s maximum error correction capacity. This methodology seems rather crude, but it works.

Example of a real QR code that incorporates a logo

Encoding and decoding QR codes

There are numerous ways to generate your own QR codes. I’ll just mention a few to give you an idea of where to start.

Firstly, I should mention that there are paid services that allow customers to get custom QR codes. This includes things like “dynamic” QR codes, that can supposedly keep a tally of the number of times they have been scanned. However if you aren’t using them for professional applications. I generally wouldn’t recommend using paid services like these. This is a tinkerer’s blog after all. That being said, I mention them here just to make you aware of their existence.

All the tools that I mention from this point are free to use and readily available. If you are using a Linux based operating system, or virtual machine, or use bash in Windows. I recommend downloading and using two programs: “qrencode” and “zbar-tools”. Both are available in the Ubuntu main repository. This is actually what I primarily used to create and test all the codes in this article.

The zbar-tools toolkit comes with two relevant programs. zbarimg and zbarcam. zbarimg is used to scan local images of QR codes and can output that data either to standard output (usually the shell), or piped into a file. zbarcam has similar functionality, except it can use the computer’s camera to capture a QR code.

Alternatively, for quick QR code generation you could use an online website. I don’t want to recommend any for liability reasons, as there are lots of random websites that can do this. What I found interesting though is that the search engine duckduckgo.com actually can generate QR codes as well. I came across it rather by accident, as it returned QR codes with the search term data within it.

To use DDG to create a QR code, just type in “qrcode” followed by a space and then whatever textual data you want in it. I find this method rather novel, and probably good for simple quick and dirty codes. However it lacks the precision of functionality that a program like qrencode gives you. Such as the ability to specify the module size, and ECC level of the generated QR code; qrencode does this by passing arguments to the program.

TLDR

Tools to create QR codes

  • Linux: qrencode
  • websites: duckduckgo.com, etcetera
  • paid services for business including dynamic QR codes

Tools to decode/scan QR codes

  • android phone apps
  • (zbar-tools) zbarimg & zbarwebcam

Encoding and decoding binary QR codes

To encode a file (such as an image) into a QR code, you need to pass an additional option to qrencode. Use the -8 argument to specify 8 bit mode. You also need to use the -r option to specify a file input.

qrencode -8 -r input_image.png -o output_qrcode.png

To decode a QR code image of a binary into a file. You have to pass the below options to zbarimg, to allow it to know that it is dealing with a binary file. Additionally you then need to pass the output from zbarimg into a file. Otherwise it’ll just output the data into standard output (i.e. the shell itself).

zbarimg --raw --oneshot -Sbinary qr_code.png > output_file.png

One thing to note. Versions of zbarimg (zbar-tools) older than version zbar-0.23.1 do not have the capability to decode binary files. Additionally, at the time of writing the version of zbar within the Ubuntu repository was zbar-0.23; an older version without the capacity to decode binaries.

Alternatively decoding a binary QR code without specifying the output format, or without piping the contents into a file; instead just letting it output into the shell: will cast the contents as ASCII text. Instead of a file it will output a string of nonsense characters. However the first couple of legible characters should consist of file metadata that can tell you what format the binary data is in. The below example is the same QR code as above but outputted as ASCII rather than as a binary.

QR-Code:‰PNG

\00\00\00
IHDR\00\00\00Œ\00\00\00Œ\00\00\00!¢Öi\00\00IDATxÚíݱmƒ@†á8rÏ\00´i#s¤af`7™Ã‹¸e\006Hé”|`r<oé\ù^}÷c[>õ}ÿ‚}ójHBÎNJ¢Xã?5M“ÙÞµm»øwÿt•‘$u‡´uZîýíclõõö9»f–ªª2ÛÄ»v;¦÷$IÝa¥Óݑ©ëzvÍårIؐ1½'Iêê.§“áDïI’ºƒº;HïI’ºI$$DHI$$’@H"	$$’@H"	$oéúE’7ãK’ºCuÞe>—ϵÍmïùLª$©;ü—ÓÝfI‡$‘’HI ‰$’HIG%Ù+³^¼ÈžTw8%IÝauZ®ë:»yGY–IzO’ÔH"	$aûa6œd I$!ïº3Ì®w	$u’HI0ÌJH‚aÖ0uGHINw†YIIêÎ0k˜I$$’`˜…$‘ìaV’ÔH"	$Á0+I 	†YÃ,ÔH"	$‘’@I 	$‘„58ö™OßýÞ/[¿ÁeI’¤gh:Ã5cëcþš$Iâ®aO“4ñåb©¾cëh,ÛRIzô¶AÂ\“³ Éé.[¾¯.ñw¦×ÿüéJӒ$IÒîó”j½;’4Ž‰59˶T’Á‘‚Sß÷wEa_žÈЈ$©;¬Tw$”#_{G}¨õ—´\00\00\00\00IEND®B`‚

Closing thoughts

QR codes are basically ubiquitous today. They are present everywhere. And applicable in many use cases ranging from anything; from storing simple web links, to gaming uses such as markers for augmented reality. I recently found a tiny one that was printed into the underside of my kettle. Why is it there? Just because. The point is that they are everywhere.

Additionally, the technology is exceptionally accessible. Having a surprisingly small learning curve. This coupled with the fact that quality creation tools (like qrencode) are freely available, means that if you for whatever reason would like to use a QR code within your work; there is little reason not to do so.

If I am perfectly honest however. I personally don’t see much actual utility for me other than inserting a QR code linking to my website, or email within a business card. Perhaps, even in printed articles – as a means of linking in additional online resources. It’ll certainly have a lower level of friction, than printed hyperlinks have.

If I’m honest. The main real appeal of this technology to me is the novelty of storing binary information within a printable medium. The fact that you can encode an actual binary (so long as it is smaller than 2.9kb) into a paper medium, is wondrous. Check the links below for a Youtube video of a person who encoded an entire executable game into a static QR code. Not a web link to game. The game itself. Imagine storing actual games, into a book. Tiny games, but still. Cool.

Anyway, happy QR coding. Thank you for reading.

Some fun

Links, references, and further reading

https://www.youtube.com/watch?v=ExwqNreocpg

Scan Barcode QR Code From Webcam & Image File in Linux

The purpose of QR Codes

QR Codes basics

https://en.wikipedia.org/wiki/QR_code#storage

https://en.wikipedia.org/wiki/Binary_number

http://qrcode.meetheed.com/question14.php?s=s

https://www.linux-magazine.com/Online/Features/Generating-QR-Codes-in-Linux

https://www.binaryhexconverter.com/ascii-text-to-binary-converter

https://en.wikipedia.org/wiki/EAN-8

https://en.wikipedia.org/wiki/Universal_Product_Code#Check_digit_calculation

https://en.wikipedia.org/wiki/Barcode#Symbologies

https://en.wikipedia.org/wiki/Binary_number

How To Convert Images Into ASCII Format In Linux

http://www.qrcode.com/

https://web.archive.org/web/20130127052927/

http://www.qrcode.com/en/qrgene2.html

https://www.thonky.com/qr-code-tutorial/error-correction-table

https://scanova.io/blog/blog/2018/07/26/qr-code-error-correction/

https://www.qrcode-tiger.com/qr-code-error-correctionhttps://en.wikipedia.org/wiki/Reed%E2%80%93Solomon_error_correction

https://medium.com/@r00__/decoding-a-broken-qr-code-39fc3473a034

#0017: Creating a Toy Drag Racer Car

#0017: Creating a Toy Drag Racer Car

Prelude

This will be the first in a series of articles on making crap from garbage. I intend to build on this initial car, by adding more functionality and complexity down the line later. The purpose of this series of articles is to illustrate how accessible our hobby actually is. All you really need is access to information, basic tools, and most importantly: a little motivation and imagination.

Basic drag racer toy car.

As you can probably tell from the pictures; this toy car once had additional components that I removed for this write up. These included: 4 LED “””head-lights””” (2 white, 2 red); a jumper cable and switch, to allow the motor to be run using only one of the batteries at a time (for a slower speed); and additional wiring to allow the motor to run in reverse. Essentially whatever bollocks I felt like lazily sticking into the thing.

This should however illustrate that you can keep adding complexity to the basic frame work … Yeah, that’s why I reused the same haggard little tupperware container with the two unused switches: to make a point. It wasn’t abject laziness at all. Nah.

One could even keep adding complexity and replacing components until a simple drag racer can turn into a self steering robot. This could be done by using ultrasonic sensors, microcontrollers, and servo motors just as an example. However the basic framework is a good starting point.

Toy demonstration

Making the thing.

Tools and materials.

So what do you need to make this masterpiece? A soldering iron will help but twisted wire connections and electrical tape will do. Work with whatever you have on hand. I’ll just list out what I used.

Tooling:

  • soldering iron
  • heat gun
  • DC power supply
  • multimeter
  • precision knife

Consumables:

  • electrical tape
  • heat shrink
  • hot glue

Materials:

  • wires
  • tupperware box
  • gears and wheels kit
  • switches
  • AA battery holder
  • AA batteries
  • rubber-band (elastic band)
  • 3 volts DC motor

Build process.

Its largely self explanatory from looking at the pictures but I’ll give ya a quick write up if you insist on reading. Nerd. Anyway, get either a cheap wheels and gears kit (yes I am a hippo-crit) from an online store, or salvage wheels from broken toys if you have any, or use bottle caps even. You can even make decent wheels from either cardboard or by working random stiff plastic with a saw and a file.

Next, cut appropriate holes into the plastic box, sardine can, old butter tub, or whatever you’re calling a chassis. Then affix the motor into the chassis using hot-glue or tape. I wanted to use a belt driven system for no other reason than I wanted to use a belt driven system. So I used a couple of belt pulleys from the gear kit and a near dead elastic band as a drive belt. I know what you are thinking, and yes it is very unreliable.

If I were to redesign this for simplicity and reliably; I would just insert the motor directly into one of the rear wheels and power it that way. Better yet you can use two motors, one for each rear wheel. Anyway, next, throw in a switch, a useless fuse just for fun, and an occupied battery pack. Done. Enjoy.

The project is so simple it seems silly didactically going through every step of slapping it together. Just look at the pictures: yours should be like that but good. The point is to make it using the materials on hand. Improvise as a matter of course.

One thing that might be good to improvise on is by using a salvaged battery holder if you can not find one. I know not everyone has access to broken Poundland fairy lights. For example the motor here came from a cheap hand held fan. I could easily use it’s chassis moulded battery holder instead and just butcher it to fit. No worries.

To source the material I recommend a discount store like the aforementioned Poundland or the 99P shop. You could probably get all the materials for less than a fiver. And if you’re really on a budget, then I recommend the dumpster behind Poundland. Don’t ask me how I know.

Belt demonstration

Schematic

It’s not really necessary given the simplicity of the circuit. But I’ve included one never the less for the sake of completeness.

made with digikey.com/schemeit/

Circuit power use.

To satisfy some curiosity I decided to measure the power usage of the motor, and power delivery that the batteries can supply. I did it to give me an idea of how much power the batteries are able to provide, and how much of that available power the single motor uses. That way I’d know what’s limiting performance, should that become a concern. And it will once I decide to start adding components, such as additional motors.

Results:

Tested with a 6 Ampere max bench power supply against mismatched old batteries. Guess which performed better?

(BPS = Bench Power Supply)
BPS powered Motor (spinning freely): 3V @ 0.25A (0.75 W)
BPS powered Motor (jammed): 3V @ 2.71 (8.13 W)
Battery powered Motor (spinning freely) #1: 3V @ 0.18A (0.54 W)
Battery powered Motor (jammed) #1: 3V @ 2.02A (6.06 W)
Battery powered Motor (spinning freely) #2: 3V @ 0.29A (0.87 W)
Battery powered Motor (jammed) #2: 3V @ 0.70A (2.10 W)

My conclusion on the circuits power usage is that the junk batteries that I used for this application are not able to provide the maximum amount of current that the motor can use when spinning freely in the first test. And in the second test although the batteries performed nominally when free spinning, when the motor was jammed causing it to draw more current; the batteries failed to provide the needed current. So the batteries are the limiting factor here. Probably because they’re dying. From this slapdash test, I can tentatively conclude that if I wanted to add an additional motor, I’d also need to scale the power supply relatively … or use new batteries.

Really I should’ve tested it with two fresh 1.5 volt alkaline batteries as a control. Then I could’ve tested the motor, by adding an additional two fresh 1.5 volt batteries (in 3 volt series) parallel with the base two, to allow for a higher circuit current output without increasing voltage. That would’ve been a better test. But I took all the photos for this maybe two months prior to doing this write up on it; and I don’t feel like going back to it for something this minor. However, I will for the next article that uses this drag racer. This test was bad.

Closing thoughts.

Why make this thingy? (technical term)

I wanted to make a very basic bare-bones motorised toy car. The reason for this is that I think its a really good project to get a complete beginners feet wet in electronics, and more broadly in getting to actually making things in general. The scope of the project is small and its largely practical. There is very little in the way of actual measurements and maths. In addition, the tooling needed and materials used are basic and readily available, as they are salvaged cheap electronics and household sundries.

I think something like this is ideal for children especially since once they’re done, they end up with a toy they made themselves. Every time they play with it, they might get that little endorphin kick saying ‘I made that’ and before you know it — they’ve been bitten by the bug.

Another reason why a project like this is good is because unlike how many get a start in the general electronics hobby today – i.e. by purchasing kits and completing them. Creating something useful or of-value from junk promotes and develops a better skill-set then just putting together pre-made puzzles. Sure kits can develop people’s technical skills in doing so (like soldering), a familiarity for the various components involved, and even some trouble shooting and diagnostic abilities in order to get the thing that they put together actually working.

Usually though, in my experience once the kit is complete; be it an electronic dice, an AM radio, or what have you. It is done. At which point it is put down and forgotten. This is unless the person gets interested in one of the higher concepts the kit introduced them to; like in the case of how putting together a DIY radio kit can become a gateway to repairing radios or the ham radio hobby as a whole.

This is of course a good thing. However in general, purchasing kits has in my opinion limited returns (such as mentioned above), and can get overly consumeristic in nature. Buy the kit, make the kit, buy the next kit, make the next kit; and so forth. So what do you do when you don’t have the funds for the next kit, or have a child that becomes bored and thinks that’ll all this hobby has to offer.

Well that’s where one has to become inventive. Create your own kit. And from what? Whatever is around. Putting together machines of your own creation from junk develops imagination and creativity in people. It teaches them to see more than what an item is, instead it promotes seeing the parts it is made up of, and what it could become.

That old microwave the neighbour left out. Is actually not just worthless e-waste. It is actually a magneto, various high power resistors you can use as a resistive load in your experiments, and even a high voltage transformer that’s likely to get you killed. Obviously I am joking about the microwave, I am not advocating for inexperienced or immature people start with mains power electronics. Learn, but learn safely. I.e. Low voltage direct current devices.

Working with salvage also gives people very localised and consequently practical (read valuable) experience. This is because they’ll be working and tinkering with the local devices available to them. The same ones in their everyday environments, and in doing so they will gain insights into their workings. Insights that may lead them to modifying and repairing some of the same items for future fun and profit.

Note: I read over this, and even I can tell it’s pretty bloody preachy. I am not saying kits are bad, they are just another avenue for this hobby. Sometimes it’s nice to play with something that isn’t already broken. However I do think that (certainly basic) kits are transitionary. You make kits then you move on to fucking about with whatever takes your personal interest. And like I stated, kits are often a gateway drug to your chosen field.

Make no mistake what you are reading is the toned down version. The first draft was hard for even me to read without rolling my eyes in my skull. No need to thank me for sparing you that, but you are most welcome.

Thanks for reading.

#0015: Device analysis of an unbranded LED dynamo torch

#0015: Device analysis of an unbranded LED dynamo torch

Preamble

It’s rather hard to provide a useful review of an unbranded product such as this. Since it has no brand, and no model to specify; we can only identify this particular device by it’s general appearance. Unfortunately this can be an issue when it comes to stating anything definitive about the product. This is due to the unregulated variations and derivatives on the market. In other words, just because two of these unbranded devices are outwardly identical, doesn’t necessarily mean that the components (or configuration there of) are also going to be the same. Heck, we don’t even know if any two different units were made by the same OEM (Original Equipment Manufacturer). Consequently, your mileage may (and probably will) vary if you pick up one of these dynamo torches. I can only show you what I have in front of me; and I have a sample size of two.

Device Demonstration

Device internals

Schematics

Torch A

made using https://www.digikey.com/schemeit/


Torch B

Key:

L1: 5 mmØ through-hole LED (white)
L2: 5 mmØ through-hole LED (white)
L3: 5 mmØ through-hole LED (white)
R1: 5.1 ohm resistor
S1: two-state toggle slide switch
V1: dynamo (AC source)
B1: [x3] AG10 / LR1130 button cell battery

Possible modification

  • rectifier and capacitor on the dynamo circuit

Key:

DB1: Diode Bridge
C1: capacitor

I think that perhaps some kind of rectifier followed by a capacitor on the dynamo circuit will provide the parallel LEDs with a more constant voltage. Allowing it to stay on with a constant light intensity for a little longer, at the cost of a few initial revs without any light output as the capacitor charges. Is it worth the effort? Not especially. It might just help prevent the sudden light dropout. I’ll need to test it out myself before I say anything definitive here.

As for the rectifier, I would recommend a full-bridge rectifier using four diodes for maximum efficiency. That is if there’s space for it. This is because this configuration inverts the AC negative voltage into positive, before passing it onto the smoothing capacitor. Alternatively, a single inline diode will simply cut the AC in half by passing only the positive voltage. It’ll do the job, but at the loss of the negative voltage of the AC. Although, this is lost anyway at the LEDs, since they’re diodes. With this use-case, I think we need all the efficiency we can get, and a full bridge rectifier may even make the device function a little better. Like I said it needs proper testing, that’s why I stated this as a “possible modification”, rather than my usual “recommended modification”.

EDIT (2021-02-04): On further thought, any benefits of rectifying the dynamo AC will probably be negligible. I believe this is the case due to the low voltage provided from the dynamo (approximately 2V AC) coupled with the forward voltage drop that will occur within the diodes themselves.

The example diodes I have (namely 1N5818) have a really small forward voltage drop of 0.45 volts at 1 ampere. Even this miniscule drop will have a notable effect on any resultant DC.

web link: https://www.bitsbox.co.uk/data/diodes/1N5818.pdf

Still I still think the idea of rectifying a dynamo’s AC to DC would be worth while if for no other reason then to make a generally more useful form of power. Unfortunately, for a dynamo of this output, it’s just not worth it.

Dynamo AC generation demonstration

Gear array and dynamo

A1: Spur rack: 24 mm w/ 11 teeth
B1: Spur gear: 8.5 mmØ w/ 10 teeth
B2: Spur gear: 41 mmØ w/ 81 teeth
C1: Spur gear: 7 mmØ w/ 12 teeth
C2: Latching spur gear: 2 pivoting teeth
D1: Internal spur gear: 26 mmØ (inner diameter) 32 mmØ (outer diameter)

(Please note: when two gears have the same gear letters, it means that the gears are connected.)

Dynamo:
24 mmØ toroidal (doughnut) magnet (with 4 Norths and 4 Souths)
coil consists of:

  • dynamo core (magnetic conductors)
  • a 920 cm length of 0.1 mmØ gauge copper wire
    (wrapped into a coil of ~276 revolutions)

Please forgive any inaccuracies in naming convention for the gears, this is the first time I have actually paid any attention to the subject of gears in general, and it appears to be a deeper subject than initially expected with quite the learning curve involved. The “latching spur gear” and “internal spur gear” are the ones where I hazard a guess as to what they might be called, this is because at the time of writing I was unable to find a named example of what I was looking at. It can be difficult to find something when one doesn’t know the keywords to search.

Gear system in action

Pushing force on the handle moves the spur rack against spur gear B1. B1 then rotates clockwise. This in turn rotates the conjoined spur gear B2 clockwise. B2 interfaces with spur gear C1, and rotates spur gear C1 counter-clockwise. Which in turn rotates it’s conjoined latching spur gear (counter-clockwise).

The swivel teeth within the latching spur gear are designed to lock into the teeth of the internal spur gear D1. Although this happens only when they rotate counter-clockwise within D1. In doing so they rotate D1 and it’s toroidal magnet. This rotation causes a flux in the local magnetic field. This is picked up by the magnetic metal of the “dynamo core” and transported via this core to the copper coil winding. Where it induces an alternating current that powers the LED lights.

Once the handle is fully pressed in, with the spur rack (A1) at the end of it’s track. The operator’s pressing force is removed. At which point the spring in the handle pushes the handle back out; and forces the spur rack to move back to it’s start position. In doing so it rotates spur gear B1 counter-clockwise this time, this rotation is passed on to spur gear B2. Which rotates spur gear C1 clockwise. This rotation is passed to the 2 tooth latching spur gear C2. Which in turn spins clockwise freely and allows the gear system to reset position. Then the process repeats as the operator pushes on the handle. And so on.

The device as a consumer product

Build quality

This is probably the cheapest dynamo torch on the market. If not in price, then certainly in build quality. The main body of the torch is made up of two separate mouldings that sandwich together. This configuration clips into the grey plastic ovoid that houses the LEDs, batteries, and the light guide/reflector. Add to this one or two (depending on version) small self tapping phillips screws to keep the device together.

The phillips screws for the housing are set into thin moulded standoffs that seem prone to either splitting at the screw thread or cracking at their base. The cracks on the base of these standoffs I believe are caused by the general mechanical stress incurred by the gear and spring system. Both in action: when the dynamo mechanism is being used, with the spring loaded handle being vigorously pumped back and forth; and at rest, because the spring that pushes the handle back out puts a constant stress on the gears that are set into these flimsy standoffs.

I have had these two torches in safe storage for a few years, I was surprised to find out that one of the two had broken it’s standoffs, well off. Considering my storage solution (think sealed plastic tub in a garage), this may have been caused if not exacerbated by temperature variations, in addition to the stress of having a coiled spring pushing against them. But basically, I put the thing away fixed, and found it broken. Considering that one of the use-cases the online retailers advertise this thing for is camping, I don’t think that the temperature swings of the mild british weather should have caused this.

Something positive. The internal components I generally have little problem with; from the LEDs, to the Dynamo, and nylon gears. They are all very inexpensive components, but there is nothing especially wrong with them. They are all basically fit for purpose. Even the dynamo, although unfortunately, it’s delicate hair thin wires extend out the dynamo coil and into the device proper: towards the switch and LEDs. This makes the device far more likely to suffer a breakdown, as these wires are far too thin and delicate to be used for general device circuitry. Especially when in the presence of an unshielded gear-system. Look at the pictures to compare the dynamo wire (~0.1 mmØ) to the LED (~0.4 mmØ) or switch (~0.5 mmØ) terminals to understand just how thin the dynamo coil wire is. Please note: inaccuracies in recorded measurements are due to the pictured calipers used … and me.

False advertisement claims

I have seen this torch (and it derivatives) in multiple online stores. I have also seen a lot of false advertising around this product across multiple vendors. Including Ebay, AliExpress and especially Amazon. This is predominantly due to the seller’s lifting the product descriptions from each other, in some cases they’re literal copy-pastes.

There are many claims on these store pages that made me chortle. These included: “High tech ultra bright LEDS” when referring to the 3 bottom market 5mmØ through-hole LEDs; or the sentence “perfect for outdoor use” when describing an electronic product that is about as watertight as the average kitchen sponge.

Since these claims made are subjective, you can’t say that they are technically wrong, because that’s just like your opinion man. These are (in my opinion man): just examples of product puffing or marketing wankery. Something that I honestly have come to expect at this point in my life. Whenever I go to buy something, I will inevitably have some to sit through at least some marketing bullshit, because apparently every single product ever made, is as great a sliced bread, and should get you as excited as the second coming of our lord and saviour. Or else there is clearly something wrong with you.

Moving on. Something else that I have come to expect, and let’s be honest here – enjoy: is Chinglish. And there are some great examples of this within these product descriptions. My favourite is “Works on a new technology of pressing handle with your hand.” Hey, it made me smile. Here’s another doozy for you: “LED torch adopt advanced technology of LEDs emitting level of 3 fluorescence tube”. What the actual fuck are they trying to say?! If internet scholars ever decrypt this product claim, you can probably safely bet that is it some form of bullshit.

Which nicely brings me to the real issue that I have with these product ads. It is the genuine examples of outright falsehoods. The main two claims that I have issue with, are: 1) That the dynamo action charges the batteries, and 2) That the product doesn’t include batteries in the first place.

For the first example I have an ebay advert that uses the keyword “charge” in it’s description and makes mention of the 3 disposable AG10 coin batteries that come in the unit. Although it doesn’t mention that they are single charge disposable units. Hence the assumption that the average consumer is likely to make is that the dynamo charges these batteries. Another amazon ads states the claims “No batteries required, Eco and rechargeable”, to make the customer think that it comes with some kind of componentry that either enables the device to charge without batteries (e.g. capacitors), or that the device comes with built-in rechargeable batteries.

Unfortunately neither are true. A cursory look at the above schematic for either unit A or B will show you that at no point does the dynamo charge the batteries. They are on two separate loops. Also, where is all the charging circuitry? The bridge rectifier, voltage regulator, and smoothing capacitors involved in converting the alternating current that the dynamo would produce into a fixed voltage direct current for the batteries. Additionally, even ignoring those facts: let’s say after reading this paragraph someone still isn’t convinced of my claim that the dynamo does in fact not charge the batteries; then why does this torch ship with disposable (non-rechargeable) alkaline AG10 coin batteries then? It’s because this claim is provably false.

Now onto the next false claim. This was the one that I took notice of initially, and actually inspired this rant. The claim of these torches not having a battery to begin with. The disproving evidence of this claim in some cases is in the bloody product description itself. I have even seen adverts that claim that it doesn’t have batteries, to then make the contradictory claim of a 15 minute running time at full charge.

Closing thoughts

I honestly never intended to talk this much about this budget torch. However the more I looked into the item the more I found to say. To sum it up for you: everything from the build quality, to the false claims: make this thing is absolute dreck.

I think the main reason as to why these types of products can make outlandish claims and still sell is because of their price. They are so inexpensive, that returning them may cost more in unreimbursed postage costs, than the refunded price of the product. For example: a torch costing approximately £2.50, will cost £3.10 (at time of writing) to return via a Royal Mail UK only “small parcel”. This is of course assuming that the customer bought the product from a UK distributor.

If it was bought from China, then a return is basically not financially viable. The international postage is only cheap one way; and that’s due to bulk export shipping from China. Consequently, I have had experiences with seller’s who have contacted me offering a full refund with no return if I removed a (well deserved) negative review I have given for the product. That’s likely the main reason why they have such high reviews (4/5 star average on amazon); because they buy off the negative ones; like mine.

As for my final word on the torches themselves: I think that they are basically designed to be factory fresh e-waste. They will go from the factory, to the seller, to the customer, and to the bin faster than should be acceptable. This due to their own shoddy nature and little else. They are a good testament to the saying: “you get what you pay for”. One could also use the saying “buy cheap, buy twice”, that is if a person actually intended to use these torches for their advertised use-cases. Good luck camping with this piece of hot shit in your back pocket.

Thank you for reading.

#0010: Device analysis of a USB resistive load

#0010: Device analysis of a USB resistive load

Preamble

This will (hopefully) be a start to a series where I take a look into various devices and analyse them. My intention is to begin with very simple devices and steadily ramp up to more complicated ones as time goes on. The idea is to give the reader enough information about the device (design, function, components, etc) to the point that they can conceivably create their own. As well as in some cases recommending certain modifications, tools, adapters, or companion devices for optimal practical use.

Device information

This is a resistive load with a male USB plug interface. It’s intended function is for testing the current output of USB power-supplies and power banks. It has 2 current draw settings, these include: a 1 ampere and a 2 ampere mode. This device is operated using a two state slide-toggle switch, which allows alternating between the two current draw modes. Additionally it uses a common anode bi-colour LED as an indicator for these modes. Green for the 1 amp and red for the 2 amp mode.

The general layout and configuration of the 5 ohm wire-wound power resistors is what makes this device function. One resistor (R1) is always in circuit, in both the 1A and 2A mode. Within the 2A mode, R2 is added (in parallel to R1) to the circuit. Adding R2 in parallel to R1 reduces the circuit resistance to 2.5 ohms, which in turn draws 2 amps from the power supply.

1A mode: R1 in circuit (5V/5R=1A)
2A mode: R1 and R2 in parallel (5V/2.5R=2A)

Schematic

made using https://www.digikey.com/schemeit/
common anode bi-colour LED

Key

R1: 5 ohm wire-wound power resistor
R2: 5 ohm wire-wound power resistor
R3: 560 ohm resistor
L1: light emitting diode (green)
L2: light emitting diode (red)
S1: toggle slide switch

Recommended modifications

  • 3-state switch or additional switch (for device OFF state)
  • Heatsink / fan (to efficiently dissipate generated heat)
  • PTC resistor (as a safety temperature cut off)
  • male USB to female USB extension cable (for allowing easier multimeter access)

Additional switch

Due to both states of the USB resistive load’s two-state slide-toggle switch being used during the operation of the device, the device has no plugged-in OFF state. This means that it should not be left unsupervised whilst plugged into a power-supply as it would be active at either switch state. Either adding an additional two-state switch or replacing the current one with a three state-switch, will allow the device to have an OFF state. Whether or not this is considered valuable, is largely subjective. However personally, I like the option of turning a load off without necessarily having to unplug it.

Heatsink and fan

The reason why leaving this resistive load active and unsupervised is a concern; is predominantly due to the functioning of the two large 5 ohm power resistors. These resistors dissipate around 5 watts each (5V*1A=5W) and generate considerable heat as a result. Because of this, I recommend the addition of an appropriate heatsink to be attached to these resistors in order to dissipate this resultant heat. As it is now, during continuous operation the resistors heat up to the point that they can not be handled with a naked hand. This level of heat could pose a possible burn risk, or fire hazard.

The addition of a heatsink will allow the device to run continuously without reaching these same high temperatures, it does this by dissipating the heat generated within the resistors in a more effective manner. I.e. moving it into the environment quicker, so that it doesn’t concentrate within the device. An addition of a mounted 5 volt mini fan will enable the cooler ambient air to run through the fins of the heatsink and further improve it’s ability to move heat out of the device. I specify a 5 volts fan because it can be powered from the device itself.

In addition to allowing the device to be handled after extended periods of operation, a good heatsink will in all likelihood also extend the lifespan of the two 5 ohm power resistors. It does this by dissipating any generated heat before it reaches levels that may damage either the components themselves or their neighbours. Generally speaking: devices that run cooler, live for longer.

PTC thermistor

As an alternative to the above two fairly common sense modifications; one could also choose to incorporate a Positive Temperature Coefficient (PTC) thermistor as some kind of safety shut off in the cases where the device reaches any critically high temperatures during operation; essentially as a reusable temperature fuse. The reason why I am dubious in recommending this is that: although it will make the device safer to use in a continuous application; attaching a PTC thermistor in series with the two power resistors may actually affect the resistive load’s performance if not it’s ability to function entirely. I am not sure as I am inexperienced with the application of thermistors in general, and have yet to try this particular use-case out.

My working theory is that since a PTC thermistor increases resistance as it heats up, and with this device’s current draws; it will quickly lead to a positive feedback loop where it’s resistance generates heat, which will generate more resistance, and so on until no current can pass through it – essentially becoming open circuit. I believe that the heat generated from the low resistance power resistors will kick start that sequence; and that the increasing circuit resistance from the PTC thermistor will quickly negate the the power resistors’ ability to draw current. Even if the thermistor’s resistance doesn’t increase to the point of open circuit. It only needs to be consistently higher than the power resistors’ 5 ohms in order to hamper device functionality.

Still, perhaps there is a configuration where the PTC resistor will not negatively affect the power resistors, while still being functional as a thermal fuse. Perhaps if the trip temperature of the thermistor was high enough, or it had a position on the device where it only heated up in cases of catastrophic environmental temperatures. Basically a setup that allowed for the added safety of having a thermistor in circuit without it negatively affecting the functionality of the device.

USB extension cable

I decided to create my own USB extension cable rather than use a prebuilt one. The main reason for this is that I fear that a random off the shelf unit my not be designed to handle current draws of 2 amperes (even if it’s vendor says that it is). This would mean that the cable itself would provide a level of resistance that would become a limiter to the amount of current that the resistive load can draw.

Generally if a USB cable is offering resistance, it will be in it’s cable and not in it’s plug and socket. Either the cable itself is too thin of a gauge, made of inferior materials (aluminium instead of copper), or is long enough to cause voltage drops at higher currents. With this in mind, I used thick gauge copper power cables (taken from an extension cord), and a salvaged USB plug and socket. I also made sure to keep the total length of the cable short; just being long enough to allow comfortable use of a clamp style multimeter.

Which actually brings me to the purpose of this little extension. The pictured USB extension cable is designed to allow the use of a clamp multimeter (one that can measure DC current). Alternatively, if I didn’t have a clamp multimeter, I would cut the 5 volt line in half and terminate it’s two ends with banana plugs. That way I can insert a regular multimeter in series within the circuit; and measure the actual current draws.

As an alternative to using a DIY USB extension and a multimeter, one could just buy a USB voltmeter/ammeter. Such as the one pictured. Although these things, in my opinion can skew the results: due to them (in my experience) imparting some level of resistance on the circuit; they are certainly more convenient to use. Which one a person prioritises: accuracy, or speed (neatness, etc.) will largely depend on their preferences and use-cases.

Closing statements

Although the build quality of this device is more than acceptable (i.e. it doesn’t feel like a shoddy product), it is clearly built to a price point. Only having near enough the absolute necessary components to function. I believe this to be the case, not just because of the miniscule bill of materials (BOM), or the use of inexpensive components in that list. But rather because of the in my opinion necessary things that were left out; namely a basic heatsink.

Although it actually functions fine as is; at least for short operations. If you wish to use this device safely continuously for longer periods of time than a couple of minutes, modifications will need to be made.

Sources, references, further reading

https://en.wikipedia.org/wiki/Thermistor#PTC

https://sciencing.com/difference-between-resistive-inductive-loads-12181159.html

#0009: Brief guide to creating a USB OTG cable

#0009: Brief guide to creating a USB OTG cable

What is a USB OTG cable?

USB “OTG” stands for USB “On The Go”. USB On-The-Go is a specification of the USB protocol that allows traditionally slave devices such as smart phones, to act as master devices or host systems (e.g. personal computers) when connected to either other slave devices such as digital cameras and printers; or peripherals such: USB storage disks or human interface devices (e.g. keyboard and mouse).

USB plug classifications.

There are a myriad different types and generations of USB cables available on the market today. However most obey the convention of having two different plug-socket configuration in each class specification. A type-A plug and socket for connecting with the host system (a.k.a. “A” device), and a type-B plug and socket for connecting with the slave (or “B”) device. A standard USB cable will have one male type-A plug and one male type-B plug. A USB OTG cable differs from a standard USB cable in only one significant way. The standard USB type-A plug is replaced with either a USB Mini type-A or USB Micro type-A variant. That’s it.

For example to connect a generic modern printer to a smart phone with a USB Micro type-AB socket. One would need a male USB Micro type-A to male USB type-B cable. The replacement of the USB type-A with a USB Micro type-A is what makes it an “On The Go” configuration. This means you don’t need a traditional PC to use the printer. You can connect directly with and use the mobile device to send the files to the printer in it’s stead.

Diagram of USB 2.0 connectors. Depicting USB, USB Mini, and USB Micro type-A and type-B plugs
image taken from wikipedia.org

Limitations of the USB OTG specification.

A device with OTG enabled capabilities unfortunately can not act as a general purposes host system with the same peripheral compatibilities as a personal computer. Instead they are given a Targeted Peripheral List (TPL) from their manufacturers. This is a rather limited list of general peripherals designed to work with the particular device for it’s expected use cases. This is because these devices will have limitations on them such as power output or limited supported protocols.

Unfortunately, as I see it; with the innumerable amounts of devices (smart phones, tablets, etcetera) and peripherals (with various protocols and power draws) on the market today: the best way to find out whether or not a peripheral is compatible with your particular device – is to just plug it in and see. This is also true for finding out whether or not your device supports the USB OTG functionality in general. Some might not.

I tested a couple of smart phones I had on hand, and of the four I had, only one actually supported OTG functionality. The other three simply didn’t register the peripherals (including a basic USB thumb stick) plugged into them. These were: (2011) Samsung GT-I5500, (2012) HTC Chacha, (2015) Huawei GRA-L09, and (2018) Blackview A30. Of them only the Huawei GRA-L09 worked with my OTG cable. It performed perfectly with the wireless USB keyboard-mouse combo, and the thumb drive I tested with. The Huawei even allowed connections to the other smartphones (using a Micro type-A to Micro type-B cable). It could charge the other devices, register on their end as connected to a host, but not allow access to their filesystem like a PC would allow. This last thing could be a software limitation, that will require some further tinkering to work; or possibly using some kind of third-party file browser or peripheral manager. Long story short, when it comes to compatibility: your mileage may vary.

Creating a USB Micro OTG cable.

The USB OTG specification was originally created for use with mobile devices that utilised the USB Mini standard, and later updated to include the USB Micro standard. We will create an OTG cable by modifying a Micro type-B plug to a Micro type-A plug. Then using it to create a male USB Micro type-A to USB (full size) type-A socket. This is to connect basic low power USB peripherals such as storage drives or a wireless mouse and keyboard combo. Which is my particular use case. However it should be stated that the same modifications can be made to a USB Mini type-B plug to turn it into an OTG enabled Mini type-A plug.

To create a basic USB Micro OTG cable is actually rather simple. All you essentially need to do is short the ID pin (pin 4) on the USB Micro type-B plug to ground (pin 5). This procedure effectively (i.e. electrically) turns the Micro type-B plug into a Micro type-A plug.

Unfortunately in my case, my kit USB Micro plugs only came with 4 soldering pads (for the power and data lines). It was missing a solder pad for the ID pin. This meant I couldn’t just run a small jumper from the ID pad to the ground pad. I instead had to access the ID pin directly. On one hand this makes creating the OTG cables that require some resistance value between the ID and the ground pin significantly harder. Due to no room for the resistor. However if you intend to just create a basic cable, then this method of just bridging the ID and ground pin can be useful for salvaged USB Micro plugs who in all likelihood won’t have an ID solder pad.

With this in mind, I disassembled a kit USB Micro type-B plug. Next I scraped the covering plastic on pin 4 and 5, then soldered a bridge across them. I removed the plastic to create space and headroom for the solder bridge. Otherwise, I may be unable to slide the plug head (with it’s plastic inner lining) back on. Space constraints need to be paid attention to. Reassembled the plug. Then tested for continuity using a multimeter and a USB Micro type-B socket breakout board. Id est making sure that pin 4 is grounded, and that the solder bridge wasn’t coming off.

Please note, there are other methods for creating OTG cables that involve running a specific resistor across the ID and ground pins for certain devices to work, or to enable the host and/or peripheral device to draw power from an external power source. However I am omitting them, for brevity. This is a quick guide to build a basic DIY OTG cable.

I decided to make the pictured OTG cable modular using breadboard jumper cables. The reason for this is because I intend to mix and match various plug and socket ends to create different types of cables. However, I would recommend making a more fixed and permanent cable for actual real-world use.

Modular OTG cable example

Tooling and material example

Disassembly and modification of a USB Micro type-B plug

Modular male Micro type-A to female USB type-A OTG cable in use

Modular male Micro type-A to male Micro type-B OTG cable in use

References / Sources / Further Reading:

  • https://en.wikibooks.org/wiki/Serial_Programming/USB#What_is_USB?
  • https://en.wikipedia.org/wiki/USBhttps://en.wikipedia.org/wiki/USB_hardware
  • https://en.wikipedia.org/wiki/USB_On-The-Go
  • https://en.wikipedia.org/wiki/USB_(Communications)#Signaling_state