Xmas Lights

Christmas lights are something I really look forward to this time of year. Ideally with snow, which lately seems scarce. But changing weather aside it still stays darker this time of year in the Northern Hemisphere, and the extra light looks nice.

One of the changes since I was younger is the proliferation of LED lighting. In a way, LEDs are kind of natural for Xmas lights. They’re small, and of course more efficient. That means less heat, and you can string more of them together. Not only that, but they don’t have a filament, and last much longer.

Of course, there are a couple issues with LEDs. They’re diodes, and they only conduct in one direction, which presents an issue when running on alternating current, which changing directions. Early LED light strings were just a series string of LEDs connected to the AC line, meaning they were off roughly half the time. This made for some interesting strobing effects, particularly if the string blows in the wind.

That issue can be worked around in a couple ways. If you run the LEDs on DC, you don’t have this issue. Higher-quality light strings no include a rectifier and filter capacitor, which helps a lot. You can still see maybe a little flicker if you shake the string hard enough, since some ripple will get through depending on how the filtering is done, but it’s not hard to mitigate this. Of course, small strings that run on batteries also don’t have this issue.

Another issue is the light quality itself. LEDs produce a fairly “pure” monochrome light, which is a little jarring. This gives them a fairly cold and mechanical look. Actually, if you just want to use a single color, this can kind of be an advantage. But if you put multicolor strings up, it’s not quite the same effect as the incandescents.

C7 Lights

The lights I was referring to above are the smaller strings, with series connections. Bigger lights, using the C7 or similar-size bulbs, are run in parallel. These have their own nice warm look, but they use a lot of power – the C7 size uses about 5 watts per bulb, while the C9 size uses 7 watts. For a 25-light string, that’s 125 watts with C7s, and 175 watts for the C9s.

There are LED alternatives. You can get lights which are basically the smaller LEDs with plastic lenses that are the size of the bigger lights, as well as ones with a fake filament that run on 120 VAC and replace the incandescent lights in the same string. I had an earlier string of these, and they look okay.

Then, I became aware of Tru-Tone lights. These are made using a warm white filament-shaped LED, inside a bulb made exactly like the old, conventional incandescents. In other words, frosted glass. Here are some pictures from one of my trees:

Strings of C7 LED light bulbs on a leafless tree at night.
A closeup of the C7 LED lights on a tree at night.

Overall, these lights look great. In fact, they’re almost indistinguishable from the incandescents they replace, or close to it. Each of them uses only about 0.6 watts, so a string of 25 uses about 15 watts.

I would recommend these. I have plenty of the normal mini-LED lights, and they look okay. I wish they were warmer in color, and maybe we’ll see similar mini lights to these someday. But I’m still happy with them for some festive illumination.

(I will confess that I still use incandescent Xmas lights indoors and in places where they’re just not on all the time.)

Solar Pi Thoughts

The Solar Pi is an idea I had for a project/concept art project: a Raspberry Pi powered directly from a solar panel, hosting a website. When the sun is down, the site isn’t available. There are other solar powered websites out there, but forgoing storage is an interesting idea.

It wouldn’t have to be a Pi, other single board computers could work. The key is that the load is light enough that a solar panel itself can power it without much reserve, over a reasonable period during the day. With a larger panel, even during overcast days you might be able to keep it running somewhat. The idea is to see how useful you can make this without introducing a battery, although I’m considering a supercapacitor to provide enough storage to shutdown gracefully, and handle a single cloud going overhead.

Spiritually, this is similar to things like solar water pumping off-grid: the sun powers the pump whenever it’s out, and you pump water into a tank for use. That’s your energy (and water) storage. Or, a solar vent fan. Conventional grid-tied solar is like using the grid as a battery, although if you time your loads right you can end up using it this way too.

This has gotten me thinking about a couple things. For one, maybe running a mail server too? Email should, in theory, work if a receiving server becomes unavailable. It would be neat to include this as well.

Another idea: what about leveraging something like syncthing? The website could be shared on the Pi, and then others would just download it when it’s online. Not only that, but users could help distribute it as well.

Amusingly, given my home network, the site would probably sit behind a proxy. In other words, another web server and mail server that would relay to the Pi. These would almost certainly be powered from the grid, although I may tackle that as an other project. It kind of takes the starch out of the initial proposal, but from my perspective at least it’s kind of fun to set this all up.

The Fediverse

I’m an engineer. I enjoy working with technology, even when I find it frustrating. I enjoy solving problems using technology, and having it available for others to use and perhaps solve their own problems.

I work primarily with hardware, but I have a foot in the software realm. I’ve been a Linux user going back to high school, and also dabble in the BSDs. I’ve run my own servers and networking. I’ve had varying presences on the web, and over the years have run things like blogs and forums off my own machines. Email as well.

Technology is neat, and I was never one to leave it all to the ‘professionals’ at some big social media company. Not that I never partook, I signed up for Twitter at some point back in the day, and was on Facebook not long after it started. But I liked the idea of doing it myself.

In 2018 I signed up for an account on mastodon.social, the flagship Mastodon instance. This is part of the Fediverse, instances of Mastodon or other web-based software that can communicate with each other. So instead of an account with a big service like Twitter, you sign up at one someone, presumably a much smaller entity set up, and can talk to people on other instances. It could be a huge instance (like mastodon.social), or a smaller one (like hackers.town which I eventually migrated to). The Fediverse is known for microblogging services like Mastodon or GoToSocial, but there are others like PeerTube for video sharing and Pixelfed for something like an Instagram replacement as well.

The Fediverse is neat because of the promise of taking social media into one’s own hands. You can run an instance if you want, or at the very least pick one that aligns with your values, interests, and outlook. You could of course have multiple accounts on different instances (something I actually recommend, at least having a backup) to. While it sometimes gets talked about, in general Fediverse users aren’t interested in having an algorithm drive engagement, or some entity datamining them for the purposes of surveillance capitalism.

A lot of users made their way to Mastodon instances after recent events at Twitter (eg, the company being bought by a billionaire). Even prior to that, others had been coming over from marginalized communities, such as LGTB+, who saw it has a safe haven. The problem is, of course, that people are jerks, and moderating them is difficult. This was/is true at Twitter, and has been and continues to be a problem on the Fediverse.

To be honest, there are some real cesspools out on the Fediverse. They tend to be ‘free speech’ instances which deliberately don’t bother moderating, but they can also be instances in which the moderators simply don’t do a good enough job. It could be because it grew to big, or because the people running it just don’t care. These instances tend to get defederated – an instance that doesn’t federate with them doesn’t communicate with them, so if my instance defederates with the instance my friend is on, we can no longer communicate. Of course, I could if I had a backup account on an instance that does federate with my friend.

At first glance, defederation might seem like a weakness. You have all sorts of people running instances, and, you might think, when they don’t get along the whole network fragments. I contend that it is a useful tool, albeit one that should be used as a last resort. If an instance is a source of constant harassment, for instance, it makes sense to cut it off. Because you can. You don’t have to interact with anyone if you don’t want to, which is an important part of having freedom of speech. You don’t owe anyone a platform.

So is the Fediverse just destined to fall apart once everyone defederates with everyone else? If you jump in, there is a community there. There are enough instances federating with each other that, even if they are divided amongst somewhat isolated groups of island chains instead of one big amorphous blob of users, you can find people. Discovery isn’t so much like Twitter with its algorithm, hash tags important. While I haven’t used Twitter extensively myself, I could see it easier to discover/be discovered there. But I, personally, enjoy the feel of the Fediverse.

The issue is this: technology can move us forward. It can give us new approaches to solving problems, and new tools to use. But we can’t just throw it at social problems. I think the Fediverse and similar ideas of decentralization are steps in the right direction, but they’re not going to fix every problem seen with conventional social media. There are going to be jerks and assholes out there, and inadequate attempts at dealing with them. We’ll be facing them in the Fediverse, the difference is that it’s up to us and not the opaque actions of a big company.

Winter Weather and a New Year

Where I am, it’s about 40° F (4.4°C) right now, on January 1st, 2023. A week ago it was in the single digits, and there was a blizzard. I’m in Western NY visiting family, and was stuck inside for most of that weekend. Luckily, we had power and heat, and enough food. So we just sort of rode it out.

I’ve been caught in bad weather once in a while back home, once that took out my power for about a day and a half. It wasn’t too bad, except there was no power for my furnace – it’s natural gas, but what I presume is a small amount of power is needed to run the controls. And of course it’s hard-wired into the house. I have a small off-grid photovoltaic system I’ve cobbled together, with a 300 watt sine wave inverter that would probably have run the furnace with no problems. But I really didn’t feel like messing with the wiring right then and there. And, I was not interested in putting together a suicide cord. Something I’ll look at this year is wiring the furnace to a normal plug, and just having an outlet nearby. That way I can plug it into an extension cord next time this happens.

Between climate change, and the push for distributed energy in the form of home solar, I can see the need for individual dwellings to reduce their dependence on the grid. Not eliminate it, but just reduce it. This takes the form of backup power, as well as offloading some of the grid management difficulties regarding home solar to the homeowner. Batteries play a role here, something that a couple decades ago were in the domain of the off-gridder, but for which now there are commercial products.

Not that batteries are necessarily the perfect solution in the blizzard, unless you have a lot of them to last through a long failure. But they’re another tool.

Now, the weather is warming up, and it looks like the highs will be nearly 60° F (15.5° C) this week. At least there was snow for Christmas, I guess, and now we get a break. I find it a little unsettling, and hope for a tasteful amount of snow in a month or so. We’ll see.

I keep thinking about New Year’s resolutions, and I have varying degrees of success in keeping them. I’m just looking forward to feeling refreshed from vacation, and getting 2023 off to a good start.

Email is Fine for What It is

In theory, you should be able to host your own email server. That, in turn, should allow you to exchange emails with other people with email servers. This is a form of federation, where users on each system can talk to users on another. A similar example of this on the web-side of things would be the fediverse, including Mastodon.

Email, however, has been around for a while. These days, chances are that a user of email is doing so through a big provider like Google or Microsoft. In addition to needing the expertise to set up one’s own server, there’s also maintenance, and of course, fighting spam. As such, outsourcing email is attractive, and as long as you own the domain you can always take it somewhere else.

I’ve hosted my own email, on a machine I control, for years. I have mixed feelings about recommending this to people. It works for me, but it’s not always easy, and I still do keep accounts around with the bigger providers for certain things. But, much of my email needs are self-hosted. I do it primarily because I can, and I want to be able to. I don’t want it to become a thing that only the big providers can handle, and I see this as doing my part.

I know there are others like me, but I know a lot of sentiment exists to the effect that this is a losing battle, and it’s really not worth doing. In the fight to save users from spam, it can be difficult to get emails to go through to the big providers. This makes it difficult to run your own. And if your server is on a residential IP range, good luck – this will probably get you blocked by itself. (I use an external relay.)

Large companies do manage to run successful email servers; usually there are IT staff there to maintain it, and maintain enough of a reputation that deliverability isn’t a problem. (They could also just outsource.) For an individual, I think it’s understandable to not want to deal with this. But, I think we need to take a step back and think about what email can be: a way to exchange messages between users on different computers.

Think about it: What if you didn’t need to worry about being able to deliver email to anyone with an email address? Or receive likewise? It sounds counterintuitive, after all you’d want postal mail to be able to come to you from anywhere. But maybe you also have your friend just drop something off at your doorstep, without using the public post office. Maybe they don’t even do it at your mailing address, or maybe you have a secret location in the woods. The postal service has advantages, but you don’t need it to physically exchange packages.

The idea of the tildeverse is to treat Linux/Unix servers like their own social network. What if two of these communities wanted to allow their users to exchange email with each other, and only those two? Email (technically, the simple mail transfer protocol or SMTP) works fine for this. And if you only intend to connect the two hosts, they could blacklist everything else. Or, perhaps even firewall other hosts, or just connect via VPN.

Or, maybe you and your friend just want to exchange emails with each other, and you each have an internet-connected machine running at each of your houses. You could do similar, and without either server using a block list, it’s possible to do it just with residential connections (no relay host like I mentioned earlier). Encryption would probably be a good idea for going over the internet, but otherwise the setup could be pretty simple.

Obviously, just getting a free email with a big provider is simpler. But, for anyone who wants to self-host some of their email communication, email may not have to be that complicated, so long as you’re willing to limit its scope.

Keeping Track of Parts

I’ve touched upon Product Lifecycle Management (PLM) systems at work. The general idea makes sense, you have your thing, the subassemblies, and all the parts that go into them. And documents and whatever else. And while in big companies you end up with complex webs of objects within these systems which can sometimes feel offputing, the idea makes sense.

I’ve got a couple things going on with KiCad projects now. One is a DC-DC converter I’m throwing together, to get practice with DC-DC converters, and one is going to be a simple power/energy monitor. Both microcontroller-driven, both low voltage (12, 24, or 36 VDC nominal systems). I like KiCad, and I get that there’s a workflow associated with it in which one associates smaller things like generic passives with the design when it’s done. I however have gotten into the habit of using atomic parts – I create a part for things like a particular resistor or capacitor, in addition to bigger things like a microcontroller.

I’m not sure I need (or want) a full-blown PLM system like I’ve used at work. But, I’ve been daydreaming about something kind of similar. KiCad works on plain text, so it should be easy to script the creation of new parts. At least, for a lot of common ones, it’s a little more complicated when you need a custom symbol or footprint, but still. The other angle here is keeping track of what’s available, which is a problem thanks to all the supply chain issues going on. Digikey and Mouser, two distributors I tend to use, both have APIs where you can query for info about parts. So, I envision a script that takes a part number, grabs information about the part from one of these distributors or a different one, and sticks it in a database.

This could be something of a layer beyond KiCad then. So maybe it coalesces several 1k ohm resistors into a generic part to plop in. Maybe it queries the distributors every day and updates stock. Maybe something about tracking my own supply as well.

I may start to look at this between projects. I don’t know if it would a web app, a commandline-only thing, or heck, maybe an excuse to learn Qt. Probably, it would be best to divide this into chunks, so I don’t get stuck on producing something and get my other projects (which this would supposedly help) blocked. But it’s something to think about.

Diode-OR UPS

I recently put together what is basically a small UPS. It’s simple, made up of three diodes and some resistors, and lets you trickle charge a battery while power something and then seamlessly switch to the battery if the power source goes out.

This was actually built just for charging a small lithium iron phosphate (LiFEPO4) battery from a car cigarette lighter plug while power something, but it could be used for a lot of things. Here’s the schematic:

The schematic of the Diode-OR UPS.  It shows the positive connection from a power source, Vin+, connecting to the positive connection of an output, Vo+, through diode D1.  The positive connection of a battery, B1, also connects to Vo+, through diode D2.  Vin+ also connects to the positive of B1 through diode D3 and resistor R1.

Basically, current can flow from the input to the output (Vin to Vo) through D1, or from the battery to the output through D2. If power is present, the battery can be charged through D3 and R1 – R1 sets the current, based on the voltage difference between the source and the battery, and the forward drop in D3.

This type of circuit is great because it’s simple, and it accomplishes a lot of what you’d like: it lets a source power something and trickle charge a battery, and switches the load to the battery if the source drops. It’s passive, and should just work. On the other hand, the battery is being passively charged, and it kind of relies on the voltage of the source to regulate it. There’s also the diode drops, which for a Schottky diode is around 0.4 V. For a normal silicon diode, it would be higher, around 0.7 V.

You could improve this with an ideal diode circuit, where you could basically control a MOSFET in place of each diode to turn on and off when the diode would. This is more complex, but you almost eliminate the diode drop. If you needed something like this to handle more than a few amps, that’s probably not a bad idea.

Another option, and probably the ideal one, is to use a power converter, at least to charge the battery. A non-inverting buck-boost converter would do this, and allow you to control the charging current regardless of the voltage of the source and B1. You could have it do a proper charge of the battery, bulk/absorb/float for lead acid, or bulk/absorb for LiFEPO4 (or whatever scheme that battery chemistry calls for). A fancier converter (or converters) might supply a constant voltage to the load at the same time.

Still, for something small, the simplicity here is nice. It could work well for something like holding up a Raspberry Pi or other single board computer, for instance. One thing to note is that most diodes in a TO-220 or TO-240 or similar case often are not electrically isolated. You can get a heat sink with an electrically insulating thermal pad; I have one I garbage picked a while back.

Here is what the circuit looks like, assembled:

The circuit shown in the schematic, wired together by soldering bits of Romex wire to the components.

I put it in a heat sink and attached some leads with Anderson Powerpole connectors, like the following:

Note that I did alter the resistors to get a little more charging current. The pictures show two 2.2 ohm resistors in parallel (for 1.1 ohms), but I added two 0.9 ohm resistors in parallel as well, for about 0.32 ohms total. The diodes have about a 0.6 V drop under load, so from my car I was able to get around 1.75 amps into a LiFEPO4 battery, while the car is running. This will vary a little, and keep in mind that if your battery is at a lower state of charge you’ll get more current initially.

Switching Blogging Software

For whatever reason, I’ve been wanting to try an alternate way of composing this blog. Now, I’m not a frequent blogger, as you can see. I’ve daydreamed of putting more content at this site, but I tend to be slow at getting around to it. I’m not sure if switching to a different platform would make me write more, but there is peace of mind involved.

WordPress is actually pretty nice. It does a lot of things, and is pretty much a content management system (CMS), as opposed to just a blog platform. It’s probably a great choice if you need to throw something up like a personal or professional blog, website for your business, or whatever. Especially if you have something where a bunch of people will be logging in and creating content.

I continue to use it because it makes things like formatting, as well as managing and uploading images easy. That, and it’s easy to throw a new theme on the site. While those are pluses, it also does so much, and requires PHP and MariaDB (MySQL). These are pretty standard if you’re just looking for someplace to host your blog, but for a self-hoster such as myself, simplifying things is attractive.

Static site generators have become popular these days – you compose your content with a text editor using Markdown, and the generator uses a template to generate your site as a bunch of HTML files. Then you just stick them on your server by whatever means, eg rsync. I’ve looked at these, and have been toying with writing my own. My reasoning is that I would have to switch from WordPress, and while a lot of what’s available would probably work great, I might as well take this as an opportunity to give it a try. It might be fun or something.

In reality, this is at the bottom of a list of projects, but I daydream now and then. WordPress is a complex beast, but it’s easy to install and keep going, and that makes a big difference.

Actually, I have been playing with WriteFreely as well, and have set up a secondary blog with it here. It’s a single Go executable, and I wanted to mess with it because you can follow it from the Fediverse. I’m not sure this will completely replace my blogging here, but it’s something I’m trying out.

A Solar Website

As if I needed another project, I had been tossing something around lately regarding renewable energy and the web. Low Tech Magazine, which showcases what it considers old and forgotten technology, has an edition of their website available served from a Raspberry Pi run entirely off-grid. Their setup consists of a Pi powered from a solar-charged battery, and they make it a point that depending on weather, that site may not actually be available at all.

I think that this is an interesting concept, although I’ve been tossing around the idea of taking this further. Rather than try to keep a small web server running all the time completely on solar power, what about running it only when the sun is out? In other words, whenever enough sun hits a panel to produce enough power to keep a Raspberry Pi going (about 3 watts, say). With a large panel, this means it could stay up even when it’s cloudy.

I’ve been playing with off-grid solar for years in a hobbyist capacity, and first wondered about this when seeing the green ‘charging’ light on my charge controller turn on even on a clear night with a bright moon. That is, with enough panelage, can a useful amount of power be extracted even in low light? And what ways are there to utilize solar power without trying to store it?

The system, in my mind, would be relatively simple: A photovoltaic panel, one meant for charging a 12 volt battery, would feed a Raspberry Pi via a buck converter. When there’s enough sun to keep the Pi running, it runs. When there isn’t, it shuts down. The converter would help to match the panel’s output to the Pi, supplying it with a constant 5 VDC. With a large enough panel (>20 watts?), it should be able to put out the required 3 or so watts over a range of weather conditions.

I’m wondering about some other bells and whistles, like somehow predicting when night is about to fall, and gracefully shutting down the Pi. And monitoring voltage and current as well. I may take this as an opportunity to design my own buck with some of this built in, but I think an off-the-shelf converter would work as well.

Anyways, I’m not sure when I’ll get to this, but it’s just a thought. I’m not sure how useful it will be, but it could be kind of fun.

Goings On

I wish I had some progress to post about, but I will take a few moments to just talk about some scraps of things.

I’m seriously considering moving this blog to a static site, and have been looking at Hugo. I like the idea of composing posts in a text editor, and then regenerating the site when neede

d. I would probably integrate this blog (or a blog like thing) with the front page, ie have a similar layout, style, etc., and maybe add more static-type pages. I might even stop using the wiki, which was kind of my first thought of how this would go: Blog for routine or semi routine updates, wiki for more ‘permanent’ stuff, like how-to guides. I may just keep the wiki around.

I had considered writing my own static site generator, probably throwing something together in Perl. I’m not sure it’s worth doing that. One of the drivers for this was an idea I had about a system to accept comments via email, which I could integrate with my own static site generator. I may just look at doing something with Hugo for that, we’ll see.

This blog does get a decent amount of comments, but most (practically all) of them are spam. I could probably just not bother with it at all, but in the days of my whatsmykarma.com site, some legit comments actually would trickle through. I’ll have to see. I’m going to have to play with Hugo quite a bit, then look at migrating away from WordPress.

I’ve had some electrical projects in mind for a while, the first of which is a buck converter, which I’ve posted about before. One of the parts I was using (a MOSFET) doesn’t seem to be available, so I’ll probably just pick a new one. At this point I need to work on the layout, so I’ll have some KiCad work ahead. That should be fun.

The point of that is to not just design the buck converter, but also do the controls. And layout… And conceive of it as a ‘product,’ not just a circuit I put together. In other words, a box with terminals that will have usefulness.

This leads me to my other project, significantly more of which remains in my imagination right now. And that is an inverter/charger – a power inverter that can also rectify, acting as a battery charger. Kind of like a UPS, but not exactly uninterruptible. I mean, it should be, ideally, but the intent is more for seamlessly switching AC loads to another source and charging a battery, as opposed to keeping computers from going down. Think off-grid power system verses data center application. (Of course, there’s overlap in terms of the technology and applications.)

The first incarnation of this would go from 12 VDC (nominal) to 120 VRMS AC, sine wave output, at about 250 watts. There are a couple reasons for this project:

  • Learning, getting some experience
  • Usefulness, no one really makes a small inverter/charger like this, and I’ve thought it would come in handy
  • Progress, toward an even bigger one
  • Putting a design out there, there should be more practical examples of power conversion available. Maybe even an open source inverter project?

Anyways, more to come, maybe.