Categories
Uncategorized

Citroen Key Fob issue

I recently had a minor win, the key fob for my aging Berlingo was knackered; the buttons would unlock but not lock – which was more than an minor inconvenience when I was with my greyhound Elsie.

I had looked into it before, and I think I assumed there was more damage to the PCB than I thought and/or assumed that soldering on a tiny switch was beyond my skills.

As you can see, the PCB was filthy (because the top side of the fob had fallen apart). Not only that, you’ll notice there is only one microswitch, the should have been one to the right but it’s obviously been knocked off.

Anyway, I did look into replacements but for immobilizers, but this can quickly get expensive. And, because I didn’t have a soldering iron at the time, I discounted a fix.

Fast forward 6 months and I now owning a natty new soldering iron, I revisited this mini-project….

Testing

Firstly I had a brain wave, clean up the board (with iso alc) and then use a wire to trip what I assumed where the ‘lock’ PCB pads.

With this test I could see if the PCB would actually respond properly, saving me the hassle of soldering etc if it was a forgone conclusion.

And yes! It worked! It was lovely to see the car lock actually, as it’s a massive pain to have to manually lock via the driver side door (especially when I’m with Elsie).

New Fob

So, I needed a new small microswitch (or TACT switch I think they are called). I didn’t want to buy 400 so a whole set of them was a pain and then I found the perfect solution, a replacement key fob case that included two switches.

Perfect! I could even test solder one just in case.

Everything arrived and, much to my relief, I was able to solder the switch on without too much grief (yay soldering skills!).

The only issue I had was the I tried to keep the original fob case back with the new front (the bit with the buttons on). The original fob back had a lovely Citroen logo on it.

However, that didnt’ work well as it just didn’t fit very tightly, causing inconsistent button registration plus the whole case opened in my pocket.

So I had to bite the bullet and change out the nice back as well. But I was lucky that I’d just watched a Youtube video on this because, unbeknownst to me, aside from the PCB there is a tiny black transponder in the back of the fob as well. If you weren’t told you would not know it was there! Without know that, the new fob wouldn’t have fully worked. I’d have got there in the end, but I was glad I saw that video.

Anyway, that’s a lot of text to sum up a simple fix; but a fix that I really appreciated; a fully working key fob again!

Categories
Embedded

Debugging

I’ve been playing around with my simple sound toy and I hit a weird issue which I’m glad to say I finally solved….

The sound toy will play clips of Bob or Paul from the wonderful Gone Fishing programme. Yeah, yeah, I know it’s copyright but this is purely a personal project and is just a vehicle for learning.

Weirdness

Once I sorted the GPIO pin issue (see previous post) and finally got the Adafruit Rp20240 to play a WAV file, I thought I was home free. Fool I am!

My next task was one I’d been putting off, I was going to have to wade through all 7 (seven!) series of Gone Fishing and to select a set of clips I wanted to embed in this toy.

I wanted around 25+ clips; but after playing around with the sample rate (lower sample rate, smaller file size, squeeze more in the flash memory) I realised I could have more than that.

The issue was then one of workflow.

I started off by watching a few episodes and then noting a few phrases per episode that I liked. However, when you stop and think about it, this doesn’t work for two reasons:

  1. I’d have to go back and get the WAV sample(s)
  2. A few phrases per episode?! Including Christmas specials, there have been 49 episodes! So really I need less than one clip per episode.

I needed to re-think things!

My new plan was to watch the episodes on my laptop, and somehow record the sample I like straight away. Also, I would need to LOVE the clip – I was not short of footage or episodes to get through. And I certainly didn’t need more than 40-50 samples on the toy.

There are some nerdy ways of going about recording audio from a video you are playing on the on the computer but, to save the amount of thinking I had to do, I elected to go back to an app I’d used before, many moons ago: Audio Hijack.

With this tool, I could watch episodes on my laptop, and quickly record snippets.

Yeah the snippets may well need a bit of editing but what the heck?

I found that the mac desktop had a built in ‘trim’ facility to help me trim the clip down, which was great, but it created a problem.

The Problem

The problem was that if you use the ‘trim’ facility built into Mac Finder, it messes with the WAV header, which then mucks up the code.

Trust me, I am doing you a favour by not talking you through how I painstakingly found this out, but it did involving viewing the WAV files in hex!

In fairness, as happens a lot, with a bit of time to mull, I smelled the rough direction of the problem. The (ChatGPT) code (that has already caused me issues – see previous posts!) had hard coded offset values for the WAV file headers – errrr….yeah, that’s not very brittle is it?

Editor’s note: it was very brittle.

Long story short (again!) using the Mac Finder ‘trim’ messed up the headers and the offest.

Answer? Use Audio Hijack to capture my raw clips, and then use Audacity to trim the clips and to export.

Oh, and my other learning was that exporting to a sample rate of 11,025 Khz is a good compromise between quality and file sizes.

So, back to reviewing Gone Fishing!

p.s. I have also started the very early stages of looking into how to design 3D stuff for another project I’m working on.

Categories
Embedded

It’s alive!

So I had to wait a few days to get a variable voltage power supply (you can just see it on the left) but this was pretty easy to set up.

I dialed up 5v and 1amp and nothing happened. Uh oh I thought. Then when I increased the voltage a little, the little blue light on the device lit up.

I looked around and noticed an old speaker from a lovely old Sony mini-stereo I had. I had no idea if it still worked but I thought I would give it a try.

It immediately sprang into life (Garbage – I’m only happy when it rains) and it sounded bloody good!

Oh, I missed a step – connecting my iPhone to it via Bluetooth was typically straight forward. Only oddity was that it seemed to have two Bluetooth profiles:

  • Wuzhi Audio
  • Wuzhi Audio App

I think the App one is for an App which can control certain settings. I downloaded what I thought was the app but it looked pretty ropey so I gave up on it and got back to the task in hand.

I then decided to run out and grab a speaker from my car (partially to see if it’s bad compared to the Sony, people have been saying how bad these original Citroen speakers are) and then, when on the street, remembered by car was in the garage having an MOT. Doh!

Still, this is progress.

Next step. Test with a speaker from the car. Hopefully that doesn’t sound bad (will test it back to back with the Sony speaker). If it does sound a bit ropey I can always invest in some new ones for the car.

Next test after that is to test the set up with the power supply from the car. I need to double check how I plug in to the custom ribbon on the Citroen audio.

The other big step will be getting the audio cage which this will sit in and the 3D printed fascia will attach to. The more I think of it, the knob will be in the middle.