• 2 Posts
  • 25 Comments
Joined 1 year ago
cake
Cake day: June 14th, 2023

help-circle

  • You know, that’s an interesting question. It looks like the answer is probably 1, but it might be 2.

    It’s not entirely clear to me, but it looks like Ulysses S. Grant may have been arrested in 1872, while he was still in office. For speeding. On horseback. The practice of taking mugshots on arrest began in the 1850s, but the officer apparently did not take the president into the station, so while I bet no mugshot was taken, I haven’t been able to completely rule it out either.

    Then after traveling for some time, Grant did attempt to run for office again, but failed to obtain the number of required number of votes for nomination, and a compromise candidate was chosen (Garfield, who got assassinated), but he did technically run.

    Apologies if I’ve used the wrong terms or gotten some bits wrong. My knowledge of the US political system is vague at best, I’m nowhere near you guys, I’m just having a terribly slow day and work and wondered if this particular situation actually had happened before. Then I found an unexpected rabbit hole of weird historical half-truths.








  • Yeah know what you mean. However these days I can generally get a microcontroller for a lower price than a cds photo resistor, and with a 100 year expected lifetime – also usually it consumes less power too.

    I could do it with a phototransistor more easily than a photo resistor. That would be a solid competitor to using an MCU in terms of cost, performance, and power consumption in a simple system!

    Anyway in practice I rarely get to use analog or discrete components professionally. The MCUs are just too damn good.


  • Sure – and that’s an easy way to do it. However if I’m going to make it automatic, I like the elegance of using an LED as it’s own sensor for how bright it should be. It also uses up fewer microcontroller pins – for example, I can use pulse width modulation to give the LED a default brightness. Then during the OFF part of the cycle, reconfigure the pin to act as an ADC and make a measurement of the ambient light and adjust the duty cycle as needed.

    It’s the kind of optimization I enjoy! Another neat trick is using the watchdog timer and counting CPU cycles to allow really low duty cycles for lights you want to keep very dim, without using a resistor to limit current (you are instead using the IV curve on the datasheet and a little math). I use this plus magnets and coin cells to make little lights I can stick to things to avoid hitting my head on them, usually doorframes (I’m very tall and live in Southeast Asia). They run for 3+ years off the cell, and have configurable brightness!



  • I design electronics sometimes. Generally, people want an indicator light on their product, since it’s a cheap way to show the state of a system.

    The main problem is, the human eye adapts to darkness. You can still clearly see an LED in a dark room when a few microamperes pass through them, but then they are useless in brighter light in that case. There’s no specific amount of current that produces light that’s bright enough in a lit room, but isn’t too bright in a dark room.

    I can fix that by occasionally turning off the LED and measuring voltage across it (LEDs detect light in addition to emitting it), then dimming it if I’m in a dark room. However, this is quite complicated to do and requires a capable microcontroller and a pretty ninja embedded systems programmer. Most product developers I know won’t think of specifically doing this.

    Finally, I can save 0.1 cents (plus board space plus assembly complexity, which cost more) by connecting an LED directly to the pins of a microcontroller instead of using a resistor to limit current. Some microcontrollers specifically allow this, up to 10 or 20 milliamperes, which is enough to be too bright in some contexts already. Margins on hardware manufacture are extremely thin, so optimizing even 1 cent off a board is pretty important.

    All of this together leads to a lot of LED proliferation, which I’ don’t like either. The stuff I build for myself often has a way to control the LED brightness, although this would be too expensive to add to a consumer product as a general rule. For small devices, there’s a tilt switch inside that turns off the indicator LEDs if you turn it upside down and hold it for a few seconds. That way you can just reach over at night and fix it without fiddling for switches or controls.


  • I built it myself. I used an optoisolator to convert the sine wave of AC power to a series of pulses, and also for safety reasons (it communicates data over light pulses, so that the mains power circuit is completely electrically isolated from the stuff I might touch). Then I used a microcontroller to precisely time the deviation from 50Hz, and output a serial port via MAX232. A desktop computer logs the data and gives me a real-time graph of the deviation. I might have some sample files lying around somewhere.

    The microcontroller (ATMEGA16) ran at 20MHz using a crystal oscillator, and with some slightly funky tradeoffs, I was able to get a time resolution of 50 nanoseconds with an error of about 20 parts per million. If it deviates too far from 50Hz, I get nonsense measurements due to the tradeoff though (I trade measurement range for precision).

    The original idea was to analyze tiny variations in phase at extremely short time scales to use the mains power transmission lines as a sort of large antenna array. Then use that to study space weather (e.g. solar wind, flares, etc.) more cheaply than sending up satellites. As a hardened skeptic, I originally built it as an elaborate practical joke due to all those ‘Mayan Calendar Doomsday 2012’ folks. You see if the world did end, I would have been in a position of absolutely dreadful embarrassment. So I built it as a sort of ‘doomsday detector’.

    Sadly, that component of the project never worked. I ran it during some solar activity peaks, and was unable to correlate the measurements taken by satellites to anything I found. It does still allow some weird things though, like I can apparently create a phase variance ‘fingerprint’ and use that to conclude whether a video was recorded in my city, and at what time. I’ve heard of some people doing that to youtube videos.

    I can also get an idea of the power draw of the city I’m in. As people draw more power, the phase drops, then the power authority turns more turbines on. When the load lightens, the phase goes up, and I can see those turbines being turned off. This is sort of fun to turn on and watch if you get home early, you can see everyone else getting home and turning stuff on.



  • Old public clocks sometimes use the mains frequency as a clock signal to maintain correct time. At the end of the day, the power authority is supposed to adjust the signal slightly to make sure these clocks maintain the correct time.

    So I built a device that analyzes mains power supply phase variance with microsecond resolution. It’s accurate enough that I can see the power authority turning on and off supplementary turbines to keeps the mains frequency correct.

    That’s how I determine my level of trust in public clocks.

    Well, that and maintaining sub-relativistic velocities relative to them. Which is pretty easy honestly. If you’re having problems with this, you’ve probably ceased to be biology or chemistry and started being physics. So you probably have more pressing concerns than keeping time!



  • Haha, the first thing I did when I got to my apartment in Canada was buy a 10 or 20 kg bag of flour.

    You can eat pretty well off onions, carrots, turnips, potatoes, rice, beans, and beets. Also ground horse meat was super cheap for some reason in Montreal, and actually really good. I think I was in the 2-5$ range per meal.

    Over here pandemic survival was pretty straightforward. The country was covid-free about a year into the pandemic, but you couldn’t enter or leave the country, and there was mandatory free testing. Positive? Off to military quarantine for you. Not fun, but you’re fed pretty well and receive free medical care if needed. Then once Covid finally arrived, we had 2 months of don’t-leave-home-for-any-reason (you could order food online), followed by a free vaccination campaign. Covid became irrelevant shortly after that. While I’m saddened that it was hard on other people, it was a very pleasant 2 months of quiet study and remote work for me.

    So we didn’t quite skip covid, but we nearly did. If we were on the priority list for vaccines (e.g. a rich country), we might have done it!

    I would say the biggest effect of Covid was we began to question our assumption that America is some sort of well-organized paradise. People here still have a pretty high opinion of the USA, but it really got knocked down a peg that year. People still have a positive opinion of Canada, at least until they try to get a visitor visa… that process has been an embarrassing mess for 5+ years, even without the recent hiccup!


  • Oh, I’m in Vietnam. I’ve been here about a decade. It’s true that the ‘slums’ here are quite nice, I live in one of them. It’s safe and pleasant, if a bit crowded. 80% unemployment is about right for my area, but mostly people don’t seem to feel the need to work – too much trouble for too little money. I mean, they’re going to get priced out of their own homes in a generation or two, but I admit that they lead happy lives!

    Unofficial dwellings are common, but usually take the form of an unregistered dwelling, on land legally owned by the residents. This lets them informally subdivide plots as families grow.

    Most families seem to own the home they live in. I don’t know all the details, but it is sort of de jure impossible to be homeless here. I think all families were allocated a piece of land at some point – I don’t know the exact mechanism (since I immigrated here long after that was sorted out). Then you are registered in the ‘house book’ for that land, and have some claim to it. I’ve never met anyone whose family doesn’t have at least one piece of land they can live on, even if it’s far away.

    In practice, someone could have sold their plot, it could not be a good enough piece to live on, it could be far from an economic center, too many floods, and so on. There are de facto a few homeless people.

    If your land is out in the countryside? There are some good things about that, too. Not many economic opportunities, but you’re also not going to starve. It’s not like Canada where you need a ton of civilization just to survive. Want food? Walk to the nearest fruit tree or go fishing for an hour. Some of my colleagues in tech are tempted to just give up and go back to their hometown instead of doing this ridiculous hustle.


  • One thing that has always been remarkable to me – I was born in Montreal, and I just figured that tons of people living on the streets was normal in any big city.

    Then I moved to a developing country in Asia, to a city 4 times larger, and there’s no such problem. I mean, there are other problems, but not this one. I feel like there’s a lesson in it, maybe something to learn from the family or societal model, but I can’t seem to exactly pin it down.

    For example, I know one older gentleman on my street. His home does not seem to be static, he sort of just lives with a variety of families he’s related to at varying degrees, and who live on the same street. I see him working at various shops and food carts those families run. Everyone seems happy to welcome him, and on a daily basis, he seems quite a bit happier than me, if I’m being honest.

    I would love to see other people that happy too. I know it’s possible, because I’ve seen it – but I don’t know what needs to change to make it happen.


  • You may as well declare that your permanent address. It’s where you live now. May as well try and find happiness where you are.

    You’ll meet friends there, settle in, maybe get married and have some kids, grow old and retire to the back seat, having lived a rich and full life.

    In a few generations, the fact that the cars can move will only be a children’s story, and eventually forgotten altogether.