Random thoughts about software, hardware and electronics. And other things too...
perjantai 18. tammikuuta 2019
Does your scale lie to you?
I guess almost everyone has a bathroom scale somewhere. I also guess that quite a few people are somewhat nervous if not scared to use theirs (I may or may not be one of them), but that is not the topic here.
These days scales are mostly digital. When you get on the scale, it ponders a while (flashing something on display for several seconds) and then, unerringly, shows you the result. There's something that feels trustworthy about that.
You may try this. Step on your scale several times and take readings. Pretty close to same number every time, right? Even with the cheapes possible scale you can find.
But is it really so?
A friend tried this one time. He got on a scale, and got a reading. Tried again, got same reading. Third time, the same.
Then he told his wife to step on.
And then he tried again himself. This time the reading was off from previous reading by several kilograms.
Curious...
After some more experimenting he determined that the scale was horribly inaccurate, and to cover this it remembered last reading, and if new measurement was relatively close to last one, it showed the previous reading again. Different enough weigh reset this memory and started with new number.
Now, one should not expect cheap(est) bathroom scale to be very accurate anyway. Even in that kind of relatively simple analog-to-digital system, there are many places where errors creep in. Main measurement components, amplification and A/D converter as primary culprits.
And when you are trying to shave every cent from the cost of the scale, these things suffer.
I've said this before, and it's worth repeating here again: Never buy a tool from the very cheapest group (make that from two or three cheapest groups if you're ordering directly from china), as it will be pure junk. Pick one from the next price group up, as it very likely is of much better quality.
torstai 10. tammikuuta 2019
Artificial Intelligence
Before I start, understand that I do not work, dabble or have never even played with with any kind of AI/ML (Artificial Intelligence / Machine Learning) systems, so everything that follows is my interpretations based on relatively superficial articles and discussions I've read and may be partially or even completely wrong. You've been warned.
There's been a lot of talk about AI lately, how it is going to be massively change everything, from work to society to ... everything. I am a bit skeptical though, as everything I've read points the current state of AI being mostly hype. Even the term AI is wrong at the moment. There is absolutely no intelligence involved there - only small mathematical models that have been trained to give specific output with various inputs - Machine Learning. Like identifying objects from pictures - is this a cat? chair? elephant?
Don't get me wrong here, making that work is impressively difficult task. But the problem is that this is just about the point where these systems stop. They do that one - and only one - task well, and nothing else. Yet they still are immensely useful.
These things are essentially black boxes however - you feed them training data, telling them what the expected response for that data is, until you get reliably the result from them you want. Which is nice, but if you ask specialists how they work internally, you get no response. They don't know what happens inside, it "just works". Until it doesn't, and you can't really even figure out why it suddenly doesn't work. Say, wouldn't it be fun if your automatic car's traffic sign detection suddenly went haywire just because there's a balloon or something else equally unexpected somewhere in camera view...
I'm using car here as an example a lot, since people reading this are likely to have at least passing understanding of driving as an challenge, even for human mind.
Worse yet, you can't even train these algorithms when they are deployed. Or more specifically, you can't allow them to be trained (or allow them to train themselves) in uncontrolled environment - like when being used in your car, because that might too easily train them to behave in erratic fashion, or simply wrong.
And then we return to issue of these models doing just one job. How do you combine them to produce useful result, even in unexpected situations? And how do you define unexpected in the first place - remember, these models occasionally behave in weird ways when they see data they didn't expect. So what your car's collision avoidance system does when it suddenly sees 5-feet high milkshake in front of it?
All that being said, I have no doubt that in very strictly defined jobs and environments these systems are absolutely wonderful, say, as quality control system picking out bad products in factory or something like that. But considering all things I mentioned above, I dare to say that we're still very, very far away from useful general-use artificial intelligence, and super-minds visioned in both utopian and dystopian sci-fi is currently just that - fiction.
But I still don't rule out the possibility of it getting suddenly much closer due to some new innovation.
torstai 3. tammikuuta 2019
Santa Fe key fob fix
The other car I have - Hyundai Santa Fe 2003 - will be replaced this spring or summer, but still I have to do some upkeep. Including clutch replacement which I had to do few months back (cost: about 800€ total, which I will definitely not be getting back in re-sale value).
But other annoyance has been the key fob, specifically the remote control. It has apparently been troublesome in past, too, as previous owner has really mangled it at some point, to a degree it can't be closed without some external aid (he had used duct tape; ugly, ugly..)
Without this fob working the re-sale value of this car would be even lower, so I pretty much had to get it working now, so I opened it up. Battery was good, so that wasn't an issue this time.
As expected, it has single board and battery inside it. Battery here is hidden underneath the rubber part (in middle) and connects to PCB with contacts underneath.
After some probing, I figured out that this time, both buttons had some contact issues and were not toggling properly, and that solder joints on the main chip were bad too. Latter was easy fix; apply some flux, some solder and clean up. Done. Buttons, however, were a bit more troublesome, as they were a bit special - just 1,5mm thick, or 1,2mm (or maybe 1,3? can't remember now) when pressed. Not exactly common part. On picture above the buttons have been removed already (hot air station with controllable temperature and air flow is very useful for this kind of rework)
After some searching I found button that appeared to be identical to originals - but, as usual, this was no longer produced and also out of stock. Damn.
Trying to find suitable component can be sometimes difficult. Especially when you are not exactly sure what you are looking for. This wasn't even worst one to look for - parametric search most sites offer is good enough to narrow parameters down and then it's mostly browsing and checking datasheets for details.
On the other hand, I was just looking for suitable connector. In that case I didn't have any details in mind, just that I want board-to-wire connector where I can very easily change a wire, as target device was new version of test module for a finished product (so bed of nails-type tester wasn't an option). For testing I need to insert four wires to tester, run test, then disconnect. So quick and easy connect and disconnects were priority.
Opening just "connectors" page of Farnell gives me somewhere around 400 000 (four hundred thousand!) different connectors and connector parts. Fortunately I could quickly ignore some categories completely (Circular connectors, RF connectors, FFCs and so on) but still I ended up with thousands still to browse through.
I wouldn't mind browsing through thousands of connectors if the page loading were fast - which farnell's page isn't. It's sloooow. So slow that I'd actually prefer to browse old-style catalog with thousands of paper pages instead. Sometimes after some browsing I end up with handful of options which I will order some pieces to figure out with physical model with would be the best. Not this time though. In the end I couldn't find better - or even close to it - connector for this job than old spring-loaded speaker connectors I already had though of. So guess I'll settle for them for now for that job.
But back to this fob. After a bit more searching I found almost identical button. Dimensions were almost exactly same, but this didn't have similar SMD contacts than the old ones, but instead just small pads underneath. Not great fit, but close enough - I managed to get them soldered in, with fairly liberal amount of (leaded) solder and after gluing the fob back together (not a prettiest of jobs, but better than duct tape) it's working again.
So at least that's one less issue to think about.
sunnuntai 30. joulukuuta 2018
Bluetooth printer
Some time ago I got my hands on a couple bluetooth-enabled thermal printers. These also had RS-232 input, and were relatively cheap so I was a bit excited; I've been looking for this kind of printers for some time for my purposes.
Very quickly my excitement died, though. Although printer could be connected with RS232 and bluetooth at same time, these interfaces couldn't be used when both were connected. So effectively, this printer is useless to me.
I contacted the manufacturer for help, and their response was essentially that this is by design and there is nothing they can do. If RS232 connector is connected, bluetooth printing is disabled to prevent situation where printing were requested from both sources at same time.
While I understand the reasoning - after all, I wouldn't like the situation either where I had data from both sources mixed on same paper - I was mostly dismayed because they essentially refused to acknowledge that this is actually an very easily solvable problem.
You only need two print buffers. Data received from RS232 goes to one, and data from bluetooth to another. When printer is idle, printing from one buffer is committed, and other stays there, gathering data, until first receipt is done, and then buffers are switched - possibly after short idle timeout. Simple, effective and exactly what I'd need - there printers after all are used only occasionally to print single receipt and then it sits idle for a period.
But no, whatever the reason is, they just couldn't or wouldn't do it. So guess I'll need to keep looking for better units.
keskiviikko 26. joulukuuta 2018
PHEV Outlander: Winter update
Well, I've had the Mitsubishi Outlander PHEV for more than half a year now, and so far I've driven about 16700km with it. The overall fuel usage has been around 5 litres gasoline per 100km, which is obviously way more than rated consumption, but still not too bad for 2-ton 4WD SUV.
The main factors for this high reading of course are the battery size and average length of my (daily) trips. For example we go to our summer cottage (about 100km one way) on average once a month, more often on summer, so it doesn't really help that about 150km of this 200km is driven with gasoline. And then there are longer journeys...
As long as driving is local and less than 35km per day, it can be done on battery alone. Great!
Well, except now. Winter here is cold - right now it is around -15 degrees C, and I expect that it will get much much colder yet on January (despite climate change). Our Christmas trip out (about 200km one way) took whopping 8,5l/100km! Not good, not good at all. And even with warmer weather (say, -5 C) battery is good for just 20km, at best, as computer tells me. Let's just say that I'm not exactly pleased with these figures right now.
Now, after that shocking fuel consumption figure I did some reading, and it turns out that the car's computer has serious aversion of letting the gasoline engine getting cold. So, just to keep it warm it is run much much more in cold weather that strictly necessary for driving.
Hmm.
It's common to add a "mask" at the front of cooler around here during winter, even with normal cars (and especially with diesels, as they run cooler than gasoline engines already), just to keep engine warmer in cold weather. Even with this mask in place my old diesel just barely reached nominal running temperature during winters (on sub -15 C weather), and when stopping (e.g. at lights) the engine started getting colder immediately, even when idling.
So added a mask to PHEV too, just pieces of 2mm thick rubber matting I had handy that I carved into shape with knife and attached with few cable ties, and was pleasantly surprised as our return trip (exact same 200km) took only 6,5l per 100km! Two liters per 100km savings. Weather was of course a bit warmer now (-15..-21 going there; -5 ..-15 coming back), but nevertheless, DIY mask absolutely appears to help.
Now, before you block entire air intake of your car, I should warn you that this has drawbacks too. If weather gets warm, your car might overheat without sufficient cooling air, so don't overdo it. I left maybe 15-20% of air intake uncovered, but your proverbial mileage may vary. I'd suggest starting with half and watching how it affects things. If the cooler fan ever starts, you've covered to much already.
This of course doesn't help with that lousy 20km-with-full-battery figure, but guess that can't be helped. But at least now the car doesn't use - waste - that much gasoline for nothing...
lauantai 17. marraskuuta 2018
Where are they?
Fermi Paradox and Drake Equation are - depending on where you stand - fun or really un-fun thought experiments. Latter tells us us that probability of life is so high that it is almost completely certain that there are other intelligent species out there. But we haven't heard even a hint of anyone. Why is that?
What if almost civilizations rise to point where we are now, and higher - and then fall, never to be able to climb back up again? (well, I guess this would fall into "transmitting only briefly" category, in a fashion).
At this point, we, the humankind, have utilized almost every easily accessible source of raw materials (minerals and oil, primarily) that there are, and only by using fairly advanced tech we are able to extract more inaccessible resources right now.
We have managed to dodge a proverbial bullet with nuclear holocaust so far (but that story isn't at end yet), as well as biological pathogens and weapons (ditto there). Climate change is one of major issues at this point, and I can only guess how bad it could get. What if, say, 100 million people find their current location inhabitable and choose to move to better location -- say, North America or Europe? That scenario looks right now way too plausible for comfort, and would quite certainly trigger a major wars - in plural, all over the world.
This isn't the only scenario. Our globally high level of civilization is built on very fragile framework of technology where majority of people are very narrowly defined specialists, and any major disaster might bring it crashing down. If large enough number of these people are gone, the remaining population could very easily find their knowledge lacking in every field there is, from basic agriculture to ... well, anything. In just generation or two there could be huge monuments of high tech behind that we could no longer use (lack of knowledge or [electrical or chemical] power), care (lack of maintenance) or build (technology is always build on just slightly less advanced tech).
Again, easily available resources are now gone, and we no longer have tech to get to the hard-to-get ones. Could we ever rise up again as technological power? I am not certain that we could. Mankind might be doomed to live here, on this earth, never being able to get past the orbit or reach out for anyone.
How many civilizations have fallen like this, and will it be our destiny too?
“Ask ten different scientists about the environment, population control, genetics and you'll get ten different answers, but there's one thing every scientist on the planet agrees on. Whether it happens in a hundred years or a thousand years or a million years, eventually our Sun will grow cold and go out. When that happens, it won't just take us. It'll take Marilyn Monroe and Lao-Tzu, Einstein, Morobuto, Buddy Holly, Aristophanes .. and all of this .. all of this was for nothing unless we go to the stars.”
(in Babylon 5, written by J. Michael Straczynski,)
sunnuntai 4. marraskuuta 2018
CFL lifetime
When the ban of incandescent light bulbs came into effect, common argument against that was the lifetime if CFLs (and later, LEDs) that were to replace them were as short as incandescents, or even shorter.
It took a while (a long while), but now I got some anecdotal evidence on that argument.
We've lived in this house for over 10 years now, and we have never changed the outside lights (four of them in total). Until now. One of them had gone bad. A 11-watt CFL. The glass tube seems that have neatly broken at one point and let magic smoke out, or something to that effect. Other three identical CFLs are still going strong.
So these things have been out there for at least 10 years, in varying weather from -40 degrees C to +30 degrees C. Possibly over 20 years, even. During that time we've had some half dozen other CFLs in the house that, granted, have been used more, but so far none of them has broken.
Going back even more, I got my first larger apartment around 2003 or so. At that time I bought a light fixture to kitchen that I still have (some plastic parts have gone bad since, though). For that fixture I bought a CFL bulb that is still in use. So that would be 15 years, and that one has been used a lot during that time, considering that is has been in the kitchen, and lately, in my office kitchen/break room where it gets easily 6+ hours of use a day in winter (much less in summer, of course). I'd say that I've gotten far more "bang for a buck" out of CFLs, all in all, than ever from incandescents.
Now, that being said, CFLs have other issues, like some brightening very slowly, but lifetime certainly isn't one of their weak aspects.
Now, LEDs, so far, seem to be be falling in middle. At the moment we have maybe 10 LED bulbs around here, with maybe half being dimmable and oldest being somewhere between 5 and 8 years old (no firm anchor point on time for those like for CFL examples above, you see). So far one has failed (and I did open it and post here too, and once again semi-clever topic names bite me in the back as I can't find the post right now). Still, quite many hours of use we've gotten out of those, too.
I, for one, won't be missing incandescent lights, except maybe in color rendering purposes for photography. For that I'll keep some in spare. But I wouldn't be surprised even if that situation were to change in near future too.
Tilaa:
Blogitekstit (Atom)
