Just a fun little commentary:
Just a fun little commentary:
I’ve been attending our local lean coffee agile lunch (“lean lunch” sounds like something different…), and our discussion last Wednesday included something that I was meaning to write up for a couple of months, so here it is.
The setup is that we were discussion why agile adoption – XP adoption specifically – was so poor when the results were so obviously better.
This issue is the way management culture works and the way the incentives are structured. Let me posit two different groups.
The first lead – let’s call her Traditional Teri – does the existing company methodology well. Her team does code reviews, they do decent designs, they fix the right bugs first, and they take corrective action early.
The second lead – let’s call her Radical Rachael – is an agile advocate. Her team does decent agile; they do pairing, TDD where appropriate, story-based design, incremental releases, experimentation, etc.
Just to pull some numbers out of the air, Teri is about 20% better at getting software to market than her peers, and Rachael is about 100% better.
Who will be more successful at most companies?
We would all love for the answer to be “Rachael”, but the answer is, in fact, “Teri”. Almost universally. Because the cards are stacked against Racheal:
The end result is that Teri has much better career prospects at her company. It’s *easy* to make a case why Teri should get a promoted and why she would be a good choice as a second level manager, and the discussions that Susan has to have to convince others that Teri should be promoted are comfortable. And Rachael won’t get that promotion because Susan not only has a harder time making the case to Susan’s peers, it is not conducive to Susan’s career aspirations to have those process conversations.
The controller software lives here on github. My current software development environment is Visual Studio Code with Platform IO installed on top of it. It’s quite a bit better than the Arduino IDE for my usage patterns.
I’ve done my best to build a flexible and well-abstracted design. With the exception of main.cpp, all of the C++ classes are written in the include (.h) files so that I don’t have to deal with multiple files per class.
Here are the classes and a brief description of what they do:
The main loop runs with a 10mS delay so that every time through the loop is roughly that long; that is needed to implement the timeouts in the device class. I could have done this in a more sophisticated manner but what I did is clear and good enough for the requirement. The Manager and Device classes warrant a bit more discussion. They are use a software pattern called “Chain of Responsibility”; there are basically 5 devices that all look alike, and the manager just passes the action through to all of them and the device that the action belongs to deals with it. This vastly simplifies the manager class – otherwise it would have to check every string and figure out which device to pass it to – and makes it really easy to implement group devices; the “lights” group refers to all light devices. It also makes it easier to implement the OnIfAnyDevice class, which otherwise would have required special case code.
The main loop runs with a 10mS delay so that every time through the loop is roughly that long; that is needed to implement the timeouts in the device class. I could have done this in a more sophisticated manner but what I did is clear and good enough for the requirement.
The Manager and Device classes warrant a bit more discussion. They are use a software pattern called “Chain of Responsibility”; there are basically 5 devices that all look alike, and the manager just passes the action through to all of them and the device that the action belongs to deals with it.
This vastly simplifies the manager class – otherwise it would have to check every string and figure out which device to pass it to – and makes it really easy to implement group devices; the “lights” group refers to all light devices. It also makes it easier to implement the OnIfAnyDevice class, which otherwise would have required special case code.
In our last installment, we were trying to decide whether to hand-wire the controller or to go with the PC board. The PC board won out handily since it only cost $13.30 for the standard 3 boards from OSHPark.
Here’s a picture of the board with populated with the 3 MOSFETs and 5 resistors. I did the solder paste application by hand since I only need to do one of these. Standard solder-paste since the MOSFETS may switch up to around 8 amps and therefore may get a bit warm.
And here’s a picture after the reflow. Reflow done in my Controleo 3 toaster oven reflow-er. Looks just fine.
One little comment: One problem I had during layout was how to connect the top pin of the MOSFETS to ground in a way that could flow enough current from the front to the back. My first design started with a number of vias, but I didn’t like it. Then I realize I had an easier solution; I just use a single through-hold pad and hand filled it with solder. It will carry far more current than I need.
In my original concept all of this was going to fit inside of a double-gang electrical outlet box, but I realized that a) I’d rather mix as little low voltage and line voltage as possible and b) the box I used was only half-depth, so no room. Which argued to use a box and mount it to the house. Here’s the one I chose:
It’s a good size and has mounting bars. I don’t really need the gasket because I’ll be cutting holes for the wires. $11.60.
The next order of business was to figure out how to connect the big 12-gauge lighting wire to small connections on the board. I am lucky enough to have a good local Electronics store 15 minutes from my house (if you are in the Seattle area, Vetco is worth a trip), and that yielded a couple of terminal strips:
I think I bought two for $4.99 each, plus I bought some 18 gauge wire to go from the board to the strip (the big holes on the board can only support 18 gauge. Which led to this:
Those are all of the connections that take big wire, and the terminal strip color-coded with Sharpies.
Yes, I know I messed up the sequence; the 12V in at the lower right portion of the board really wanted to be there for each connection to the three 12V outputs. And it turns out that the wemos nodemcu layout I used was upside down, so the ESP-12 is hiding underneath the module rather than on top of it. There are female headers soldered to the board and male headers soldered to the nodemcu board. This allows me to easily remove it for reprogramming. Which was already required a time or two.
I used the same technique for the remaining controls I needed but they don’t map 1:1 to the board.
Here’s a few steps at once. I found an MDF cutoff and used that as the back of the board, and the screws that mount it also mount the terminal strips.
On the upper right terminal strip we have 120VAC coming into the box; that connects to a 5V power supply. There is a small 2AMP SSR that I had lying around that will switch on the 200 watt 12V power supply when it is needed. The “Pump on” output will connect to a similar SSR in the remote electrical box.
I did a full test of all the features, and they all worked. Well, except for the switching for the 12V power supply, which was broken by a refactoring I did in the software. We have a shade umbrella with some chair under it, and one of the requirements was to have some light underneath it. I didn’t find any premade ones that I liked, so I bought 5 meters of 12V led strip and made my own. I made 8 strips that were 16” in length, attached wire, shrinkwrapped them, and then hooked them all together to a single supply. I only took one picture during construction: But I did get this picture of them in operation: The box got installed on the wall and the various wires were hooked up. This is under my covered kitchen deck so there is no real chance of any water getting in. The AC comes in from the far right; that is a 15’ extension cord that plugs into a GFI with an in-use cover; directly under that is the 12 volt 16.5 amp power supply which then feeds back into the 12V input for the board. The red/white wire carries a 5V signal to the SSR in the electrical box that controls the fountain. The three main loads are hooked in along the bottom. There are two things missing in this picture; the 12V line that used to run the stair lights is not hooked in, and the stair lights are not connected into one of the existing lines. It turns out the transformer for the stair lights does not put out 12V with no load; it puts out 17.3V. I did a conservative design on the board that would support 15V without damaging the ESP, but 17.3V was too much. I therefore built a small in-line voltage divider and used that to connect the stair lights in. As of now, everything works fine delta one bug that I am chasing down. I’ll write up a post about the software next.
We have a shade umbrella with some chair under it, and one of the requirements was to have some light underneath it. I didn’t find any premade ones that I liked, so I bought 5 meters of 12V led strip and made my own. I made 8 strips that were 16” in length, attached wire, shrinkwrapped them, and then hooked them all together to a single supply. I only took one picture during construction:
But I did get this picture of them in operation:
The box got installed on the wall and the various wires were hooked up. This is under my covered kitchen deck so there is no real chance of any water getting in.
The AC comes in from the far right; that is a 15’ extension cord that plugs into a GFI with an in-use cover; directly under that is the 12 volt 16.5 amp power supply which then feeds back into the 12V input for the board. The red/white wire carries a 5V signal to the SSR in the electrical box that controls the fountain. The three main loads are hooked in along the bottom.
There are two things missing in this picture; the 12V line that used to run the stair lights is not hooked in, and the stair lights are not connected into one of the existing lines. It turns out the transformer for the stair lights does not put out 12V with no load; it puts out 17.3V. I did a conservative design on the board that would support 15V without damaging the ESP, but 17.3V was too much. I therefore built a small in-line voltage divider and used that to connect the stair lights in.
As of now, everything works fine delta one bug that I am chasing down.
I’ll write up a post about the software next.
My original plan for the controller was to do all the wiring by hand on a perfboard (“old school”); it’s not that complicated and I wouldn’t need to wait for a board. But I decided to do a pcb board to see how much it would cost and because I wanted an excuse to try out Kicad 5.0.
I started with the schematic:
We have the Wemos D1 mini (clone, actually) in the middle, with 5 outputs (PUMP, 12VPOWER, HOUSE, BED, AND UMBRELLA), and two inputs (STAIR_SENSE and controller). If you haven’t seen labels used in a schematic before, every pin with the same name is logically connected though there is no wire drawn between them.
On the right we have three drivers for the landscape lights using the NPN transisitor/MOSFET circuit I discussed in the last post. All of those outputs connect to the 6-connector header (screw terminal) strip.
On the upper right, the Wired_Controller1 header will be for a (possible) hard-wired controller for the lights and pump. It’s connected into the analog input of the ESP. In the actual handheld controller there will be four switches hooked across a voltage divider so that the switches will give 1V, 0.75V, 0.50V, or 0.25V when pressed. The ESP code will figure out which switch was pressed and therefore which action to take.
In the middle is the AC_Switching1 header. It contains the two outputs to control the remote solid-state relays for the pump and 12V power supply. It also contains the 5V and ground from the 5V power supply that will run the ESP.
On the left we have the parts for the stair light sensor. We have a voltage divider that will convert from the 12 V that will come in to a value that the ESP can tolerate. There was a bit of calculation there. The valid ESP8266 input voltages range from 2.5V (for the lowest guaranteed high value) to 3.6V (the maximum input without damage). We want to choose the voltage divider ratio to work well within that range.
My first choice was to use 330K for the upper resistor and 110K for the lower one; that would give a 4:1 ratio. That would put the lowest guaranteed high value at 2.5*4 = 10V, and the highest tolerable value at 3.6*4=14.4V. I decided I wanted a bit more range on the high side, so I opted from 330K and 100K resistors, giving a 4.3:1 ratio, and a voltage range of 10.75V to 15.5V. I considered overvoltage protection, but given the ampacity of the supply a simple zener likely wouldn’t be enough and I would need an SCR crowbar to handle overvoltage. I decided to skip it in this version as the power supply is a regulated one.
That’s all for the schematic; not really that sophisticated. Oh, the NPNs are really 2N2222; I chose the 2N2219 because it already existed.
Here’s the board layout. It’s a weird mix of through-hole and SMD components as I already had both the MOSFETS and the NPN transistors. I started with the header for the landscape lights because they will be pulling some hefty current; that meant I wanted to keep the traces short, and it also meant that I wanted to put the 12V in nearby in the upper right. The controlled where the MOSFETS ended up, which controlled where the NPN transistors and their resistors ended up. I reordered the output pins on the header so that they matched the order of the output pins on the ESP module; I could have remapped the pins as well but this was a bit simpler. The AC switching header also got re-ordered to make the connections simpler. And then I tightened things up a bit to minimize the size of the board. At that point, it was about $20 to do a board from oshpark, which was pretty much the cheapest I could find.
That’s relatively cheap, but I’m not excited about having to wait for it to make it back to me. The footprints for the screw terminals is not based on a header that I have; I bought some terminal strips before I decided to do a board design, but I need to buy some better ones for this sort of design. I need to get real terminals so I can get real dimensions, and I might see what I can do with all SMD devices; smaller terminals and transistors could cut the size of the board by 25%.
Two more things to mention. You’ll notice that there is not a copper pour for the ground. It’s probably not required for a board operating at these speeds, and I would have to be careful around the ESP8266 antenna because having copper underneath it would mess it up.
I did another layout with through-hole resistors in case I wanted to hand build it:
Back to the problem in hand… If I was willing to wait for a PCB to show up, I could wait for some new MOSFETS and transistors, and that would certainly make things smaller. So, I went MOSFET hunting, and I found the IRLR7821PbF, available in a TO-252AA package at $6 for 5 MOSFETS. Sound good.
I pulled up the datasheet and started reading. It’s pretty similar to the IRLB8721 that I had currently specified, but on Page 2 I found the output characteristics graph:
Looks like the one we saw in the last post, right? Except this this one starts at 2.5V and 2.7V curves. Looking at the 3.0V curve – to be conservative – and we see that with 10V drain to source, we can get a little more than 10 amps of current at a junction temperature of 25 degrees. At 3.3 volts, it’s closer to 12 amps.
What that means is that we can drive this MOSFET directly from the ESP8266. We can lose the NPN transistors to drive the MOSFETs plus one of the resistors.
So, off to do a new design with this MOSFET. I decided that I’m going to mount the board, run wires from the board to some terminal strips that I have, and then hook the real wires to those terminal strips. That will make it easier to hook up and I can make the board smaller so that it will be cheaper.
After a lot of iteration, here’s what I end up with:
It’s about 30% smaller than the original board; part of that is done by letting the ESP board overhang the end of this board, but they will both be in an enclosure (3D printed, I think), so there’s no harm in that. All of the heavy current stuff is contained on the right side of the board.
I first head to OSHPark, which tells me the board is 48mm x 37mm. That’s less than half the size of a credit card, so, tiny. They will make me 3 boards for $13.30, and oshpark does really nice boards, with an ENIG finish, but they take a couple of weeks to show up. I head next to pcbshopper.com and find nobody cheaper, except allpcb.com. I used them for the boards in my dodecahedron and they’ve done good work, and I can get 5 boards in 5 days for $10, shipping included. They must be blackmailing DHL to be able to ship so cheaply.
I’m trending towards OSHPark since I need to order the new MOSFETs in anyway.
This is my third attempt at the “Idiot Level” Passport2Pain course, and my third completion (2013, 2016, and 2018). In 2016 I left my GPS at home and apparently didn’t bother to write anything up, so any comparisons will be to 2013.
My wife and I went over Friday afternoon to have dinner with and stay at the house of one of our ski instructor friends, who very conveniently lives 15 minutes from the starting line. I slept poorly as is my usual before big rides, but got up, skipped breakfast, and we headed over to the starting point.
After the usual wait and ride introduction (“In thinking about fundraisers, we had an idea. It wasn’t a *good* idea, but it was an idea…”), we queued up to start. They start with 4-5 riders every 30 seconds or slow to spread the riders out. Contrary to the pre-ride description, they made no effort to actually send out the idiot (80 mile) route riders first; I knew to line up near the front but I would have been upset if I had to wait 40 minutes to start. Considering the difference between the two routes is well over two hours, they need to do better at this.
We pedaled away from the start at Jensen Point, which is on this weird little spit. I started talking with a guy in a t shirt, jersey, and cutoffs; he had forgotten his clothes. He pulled ahead and took the first turn to exit the park area and immediately pancaked on this left side.
It had, you see, rained the night before and it was 57 degrees and cloudy. So there was still a bit of moisture on the road, and likely a bit of oily film.
He was fine and we rode off to start our quest, and I made a mental note not to ride too near to him – or any other riders – while the roads were wet.
I generally describe P2P as riding all the way around Vashon island and taking every road that goes down to the beach.
That is hyperbole. There are, in fact, numerous hills that will will not ride down, but we will ride down a large number; overall, there are 25 climbs on the ride, most of which are in the 200-300’ range, plus a bunch of small hills and rollers. If you are doing a ride like RAMROD, there are really only 3 hills (Paradise, Backbone ride, and Cayuse), and that’s how you track your progress. On P2P they do have checkpoints where you get your passport stamped, but there are 18 of them.
My approach is to just ride; I know what the parts are, and I know that I need to ride slow because the last set of hills is pretty bad.
So, we head off, do a short climb, and then descend down to the first real climb, which is a weird down and up. And quickly run into our first issues.
We roads and steep climbs do not mix. Going down you can just take it easy, and even with disc brakes I’m taking it easy on the still wet roads. The problem is when you start having to go up again. I can sit and ride up a 15% hill pretty easily and tough out a 20% hill, but it’s nice to be able to stand. Except if you do that, your rear wheel spins up. Which is bad. So, you just need to sit and suffer.
The first 5 stops go by pretty fast; slow and careful on the descent, and then doing my best on the climbs to stay smooth and keep calm. This part of the ride is the warmup, though it’s a little nuts that the warmup has 8 main climbs and 2500’ of up over the first 25 miles. We then have 5 miles with a climb or two, and then turn off onto Burma Road.
Burma is a mostly paved goatpath that rolls up down and around; they laid asphalt with doing as little grading as possible. Burma has one easy climb – say 13% or so – and then two hard climbs. They are aren’t very high, but they are well in excess of 20% (my GPS said 27 but I really don’t think they are quite that bad). The general way to attack Burma is to be able to ride slowly – say 3MPH – while standing, and if traffic permits, do a slight weave back and forth. It’s not categorically different than “The Widowmaker” in Sufferin’ Summits, and it’s quite a bit shorter, though it’s barely one lane wide.
That is what I did on two previous rides, but Burma is fully shaded and quite wet this year. After spinning the rear up despite being really gentle, I just ride slowly and muscle my way up. Not fun at all and I’m stressing my legs much more than I hoped, but it’s either that or just fall over (I don’t think I could unclip and stop), so I ride up both pitches apprehensively and then get to meet the devil.
Almost directly after, there’s another hill with a torn up descent at the bottom where you can barely stop and an ascent where you can’t stand, but that’s par for the course. Later this same hill has a solid 20% section, but luckily that pavement is dry and a real road so you can tack/paperboy back and forth and stand if you want to.
There’s one more loop down to the water, a spin along the main highway, and we hit the lunch stop.
I’ve been snacking a bit along the way; I have some nuts and I’m eating small amounts of carbs, and that’s working great except for 5 peanut M&Ms that give me a knot in the stomach.. At this point, I’m pretty tired and deciding whether to do the 55 mile or the 80. I eat the fillings of a very forgettable BLT and a bit of bread and then stop at the Thriftway for a Coke Zero but am stuck with a Diet Coke.
I mean, seriously, what are they thinking?
I text Kim to let her know where I am (she is doing a ride into the village for coffee) and tell her I’m 50/50 on which variant I will do and I’ll text her when I decide.
I roll out. There’s a small and ugly climb on the next section, but this one is dry and I’m feeling decent until my right hamstring starts to cramp near the top of the hill. I stop, dig some electrolyte capsules out of my pack, and wash them down. Then it’s off to Evil Twin #1 and #2. They really aren’t that bad and I’m climbing a bit better after food and Diet Coke. The second stop has chips and guac, and I have a few, heavy on the Guac.
And that’s all the hills on the 50 mile/6500’ route, so I need to make a decision. My toes and left shoulder hurt a little, but my legs are feeling okay, so I stop to text Kim and press on, onto Maury Island, and get ready to grit my teeth. Because as tough as the Burma Road section is, this section is a real bastard. It looks like it won’t be that bad – there are only 5 stops – but it’s a full 30 miles and over 3000’ of up.
We work our way through 14, and then descend down to 15. This has the added pain that as I near the stop, I ride by our friend’s house and out in front my Outback is parked, with a perfect bike-shaped space in the back, beckoning to me. I manage to avoid the temptation, but man, the hill out is a major bitch, and I’m tacking back and forth for all I am worth. And it’s not like I’m getting passed much, since all the fast people are in front those near me are bound together in a brotherhood and sisterhood of suffering and pain.
On the plus side, I’ve had no more cramping issues, so there is that.
Then there’s an ugly descent, and we ride into Dockton. We have three stops left, so three hills, right? How bad could that be?
I hate Dockton. We are down right at the water, but we climb 300’ up to the top of the island, and then we descend all the way to the water down yet another sketchy, wet, and slightly mossy road. For a measly stamp on our passports. Then we climb out that same damn hill, though the way from the water is worse.
And then – and this is the wonderfully terrible part of this ride – we do it again. Climb 200’ up into the hills, all the way down to the water, collect our penultimate stamp, and then it’s another 250’ climb back to where we started.
And the pain of Dockton is over. At this point I’m feeling pretty good; I *know* can finish the last hill, and then there are only a few rollers after that. I ride up a 150’ uncategorized hill – I mean really, it’s only a 7% and it feels very easy – in company with another rider, and I form a plan.
There is only one hill left and my legs feel like they have a little something left. So, we come to the last hill – 330’ of fun or so – and I start climbing hard, which is somewhere between 230 and 280 watts as the hill steepens and eases (my earlier target was <200 watts if I could). My data shows that I’m 43 seconds faster than my 2013 ascent – a full 9% faster. I get to the top, have a little bit of popcorn, and spin out to finish the ride.
The way back is about 4 miles with only a few rolling hills, so I push my speed up a bit. And then, finally, I finish, and get to have some well-earned barbecue with my spouse. It’s pretty good in the “Puget Sound Barbecue” category, but the brisket needed another couple hours in the smoker.
Strava says I pulled 12 PRs on the route, and 9 of those were on hills. That makes me pretty happy, and I felt strong for most of the ride. It’s so much nicer and prettier than Sufferin’ summits. Stats: 80.81 miles How does that compare to 2013? Well, in 2013 I rode 1.5 miles farther, which was probably due to more back-and-forth across the road, and finished in 7:13:27. My average speed then was 11.4 mil/hr, faster than this year, but my speed on descents was at least 25% slower than before because of the wetness. 2013’s ride was done on my Trek Madone, a fine bike for making speed but it was pretty harsh on the crappy Vashon roads. This year I was on my Roubaix with disc brakes, a frame tuned to soak up vibration, shocks in the seat and steering head, and 28mm tires at 80 psi. It was gloriously better; the stuff that really would have beat me up last year was still annoying but not too bad.
7:11:46 riding time
9,949’ of up
11.2 mi/hr average
Strava says I pulled 12 PRs on the route, and 9 of those were on hills. That makes me pretty happy, and I felt strong for most of the ride. It’s so much nicer and prettier than Sufferin’ summits.
How does that compare to 2013? Well, in 2013 I rode 1.5 miles farther, which was probably due to more back-and-forth across the road, and finished in 7:13:27. My average speed then was 11.4 mil/hr, faster than this year, but my speed on descents was at least 25% slower than before because of the wetness.
2013’s ride was done on my Trek Madone, a fine bike for making speed but it was pretty harsh on the crappy Vashon roads. This year I was on my Roubaix with disc brakes, a frame tuned to soak up vibration, shocks in the seat and steering head, and 28mm tires at 80 psi. It was gloriously better; the stuff that really would have beat me up last year was still annoying but not too bad.
As some of you know, Sufferin’ Summits is a stupid idea I had 4 years ago that I’m still paying for 4 years later… It all started with a simple idea – could I create a ride like Ronde PDX – where “Ronde” means “A dance in which dancers move in a circle”, and PDX refers so a “Private Data Exchange”, a way of exchanging data without being burdened with all of the downsides of the public internet.
Where was I? Oh yeah, the ride. So, anyway, I came up with the outline for a ride, and it was pretty stupid. And then I went out and rode a bunch of hills and figured out a way to make it stupider. It is simply the hilliest ride that I could cram into 55 miles, something around 9000’ of up. And it turns out that it’s worse than Ronde PDX, though they do have a second day (okay, so, technically, there *is* a route for the second day of Sufferin’ Summits, but I am just not quite stupid enough to publish it, let alone ride it the day after).
For the first couple of years I did some light marketing of Sufferin’ Summits to the local community, but now I just kindof let it sit out there, the lesser-known, poorly behaved, and frankly less attractive cousin of Passport2Pain. I tell people that it’s because I want it to have that “underground” mystique, but the reality is that I’ve worked with people who organize big rides and I’m far too lazy to put in that much effort. So, it typically pulls in 20-30 people, and that’s just fine; I get to ride it with a few friends and look publicly stupid to the rest of the cycling population. Win win in my book. The ride is technically unsupported though my lovely wife has hosted a snax table at the halfway point the past two years.
I generally spend quite a bit of time in these hills on the Saturdays during the summer, and I felt pretty good about my fitness this year. But, there were two possible flies in the ointment, chinks in my armor, or bats in my belfry:
The first was that we had been treated to an extended run of “Wildfire Smoke”, and let me be clear that it was it was not the Tony-award-winning production that we had been promised. It was on hiatus Thursday night, but came back for an encore presentation the day of the ride. It was officially in the “unhealthy for sensitive groups” category, which – among other things – says that if you experience shortness of breath or unusual fatigue, you should contact your health provider.
I’m not quite sure how to apply that advice in practice, since “shortness of breath and unusual fatigue” bears an uncanny resemblance to the my written mission statement for the ride…
The secondary issue is that because of the crappy air quality, my training for the past few weeks has been a lot lighter than usual. I’m a fan of a nice taper in general, but two rides in two weeks is a bit extreme.
Anyway, that’s enough foreshadowing for now…
Friday night, we watched the Hawks extend their perfect preseason record, and then I headed to bed. That 5:30 AM alarm was going to come soon enough. And yet, it didn’t. Because I could not get to sleep, and 2 AM found me on the living room couch, reading (“Crash Test Girl” by Mythbusters alumnus Kari Byron is pretty good, and “Year of the Cow” (Stone) is a fun mix of history, science, and cookbook). So, anyway, I got off the couch at 5AM and then proceeded to not make my usual breakfast of bacon, eggs, and berries, because I typically do these rides (mostly) fasted. My food bag has one Honey Stinger “waffle” (mostly emergency carbs), a small bag of cheez-its, and a small bag of extra mixed nuts (that’s what you get if you take mixed nuts and add more nuts, right?). One water bottle has water, the second gets a serving of Biosteel hydration powder mixed into it, which I’ve been experimenting with for electrolytes recently. You know that it’s good because a) it has Calcareous Marine Algae and 2) the “mixed berry” flavor I have tastes remarkably like the cough syrup my parents gave me when I was a kid. On the way out I mix up two scoops of SuperStarch with half a scoop of endurox in a failed bid to make it more palatable; two scoops of highly educated cornstarch in a glass of water tastes exactly like what you think it does.
Oh, and I grab 12.5 macadamia nuts and eat them on the way out of the door because macadamia nuts.
The ride starts at a park in Issaquah, and I expect that the smoke is going to affect the turnout. We end up with 13 of us at the start, which is a few more than I expected. I ask how many people are doing the ride for the first time and then give a quick pre-ride briefing, which mostly consists of an assertion that while experience would lead one to expect that the first half of the ride is worse than the second half, experience would, in this case, be a poor guide.
Did I mention it was cold? Two years ago we started at 9 AM and it was 95 degrees when we finished, so the official (which only means “ride with Eric until you get tired of his slow pace”…) start is now 7AM, and it’s 54 degrees out right now. That is a great temperature for climbing but a crappy one for descending; you will still be sweaty at the top. I’m wearing a jersey (*not* my Sufferin’ Summits jersey) and shorts, plus arm warmers and a vest. We spin out of the starting point across Issaquah, to the first climb, Grand Ridge.
Grand Ridge is really a warmup, it’s mostly not that hard. On the first climb, the fast group rides ahead, and I expect not to see them for the rest of the day. We head through the “Little Red Riding Hood” forest path, where the part of the wolf is ably portrayed by two short but nasty 20% climbs near the top of the section. Eventually we top out, and are rewarded by a non-existent view. We’re up around 1000’ now, and on a decent day you can see Bellevue, Seattle, and the Olympics, but we can’t even really see our next climb. My descent karma fails and I get stuck behind a car driving 5 miles under the speed limit, but eventually we get on the main drag and descend down into Issaquah proper.
Squak Mountain is next. The bottom half has a series of rollers where the steep parts are 16% or so, then we turn onto the top section. I’m climbing okay, and looking at my stats, it took me 11:05 to climb the 940’ of the main climb. That’s only about a minute over my PR, so, pretty good. The data shows I climbed at 760 meters (2500’) per hour, also decent, though my legs are only feeling average. We top out there, avoid incidents on the sharp turns of the descent, and ride over to Telus.
We go up the Telus North climb, which hits about 18% immediately, eases a bit in the middle, flattens out in the neighborhoods, has a mercifully short 24% (!) section, and then finally tops out. It’s only about 450’ total, thankfully, but it gets my attention. We head to the other end of the development, pick up a few more feet of vertical, and then descend back down. This time it’s a Hyundai driving 18 MPH in a 25 zone.
Which brings us to hill #4, Zoo hill. In previous years the route has used a convoluted route to pick up a particularly nasty climb, but I’ve switched back to the classic climb. The very bottom part is newly repaved but the crappy middle part is still it’s crappy self, the rollers are still soul-sucking, and the climb to the water tank and radio towers is its usual cantankerous self. My legs really don’t feel very good on this part, but Strava says that I pulled a PR on it by 44 seconds on the lower 2/3 of the climb. I am skeptical, given that I’m only pushing 200 watts and my heart rate is about 20 beats below my max. I’m spending a little time tacking back and forth across the hill because my legs feel weak. There’s no reason to take pictures at the top because you cannot see a damn thing, and I get cold as soon as we stop. I do note that the smoke hasn’t really been that much of an issue; it seems that once we get above the first 200-300 feet, the air is a bit cleaner. We descend down, climb up Pinnacles, descend a bit more, climb up Belvedere, and then head down and up a short and easy hill to get to Lewis Creek Park. My lovely wife is waiting there with snax, I mix another bottle of blue steel and eat a few nuts.
Then it’s off to hill 5. Which is really a side hill that we will climb 3 times. We start on “The Widowmaker”, which is really nasty 494’ climb; it starts at 18%, flattens a bit, and then has a full 300’ of 20% or more. At the worst, I’m riding 3MPH and 44 RPM and pushing 275 watts. It’s the “Coffin Corner” of climbs; I can’t really slow down without falling over and if I push harder I’ll burn my legs worse and may run out of aerobic capacity (ref. “Falling over”). After 10 minutes and 28 seconds of enjoyment, I top out, meet the rest of the group waiting for me, and we descend. Only to repeat the pattern; we ride up the West Summit climb, descend, ride up a short unnamed hill, then finally up the Summit climb to the top. I’m in little danger of setting PRs on these, but I am climbing at over 800 meters per hour (10.9 fathoms/moment), which is okay. My legs are really tired; not hurting, but really tired. As we reach the top of the climb, we get a change in the weather; the smoke blows away and we can see the top of the smoke across the whole region. Glorious.
Not really, we still can’t see a damn thing. What really happens is it starts to rain. And I whine about my legs, though technically speaking I’ve been doing that for the last hour, so that’s not a new thing. I make some noise about maybe being done so that the other riders with me have an “out” to quit without losing face. I pull out my stuffable vest, put it on (you probably figured that part out on your own), and we start the descent. It’s a nice 500’ descent on a mostly straight road with mostly good pavement, but a fast cold descent with wet pavement is not my preference.
At the bottom the four of us discuss what we are going to do:
Protagonist (me): Guys, my legs are cooked and I’m too cold. I’m going to bail and ride back to the start before it gets any wetter.
Antagonist: My legs are cramping and I don’t have a jacket. I’ll ride back with you.
Non Sequitur: Guys, there’s a car behind us. We should move out of the way.
Antithesis: I’m going to head down and do at least one more hill.
Consonance: I’ll join you as long as it doesn’t get too wet.
So, we split into two groups, and Mike and I spend 10 minutes getting cold and getting back to the starting point.
The following questions probe the heart of what we are learning:
Eric uses: Specialized Roubaix expert, S-Works shoes, Pioneer power meter, Garmin 705 GPS, Pearl Izumi shorts, Giro helmet/gloves, and a random assortment of jerseys he’s picked up over the years.
Eric uses: Specialized Roubaix expert, S-Works shoes, Pioneer power meter, Garmin 705 GPS, Pearl Izumi shorts, Giro helmet/gloves, and a random assortment of jerseys he’s picked up over the years.
I’ve done a lot more work on the backyard controller design and things have firmed up.
Here’s what it looks like.
First, I don’t think the 100 watt power supply I bought is going to cut it; I have 36 watts on the ground and 40 watts on the house, and we’ve added tree accent lighting, fountain accent lighting, and I think I’m going to include some existing stair lighting on this. Oh, and some umbrella lighting. That would put me close or slightly over 100 watts, and that doesn’t leave any margin for losses in the wiring or a power supply that doesn’t quite do what I think it’s going to do.
The project is going to be split into two modules.
The first will live in the duplex outlet and will consist of the SSRs to drive the pump and the power supply and a 5V power supply for the NodeMcu. I have some nice thin 2 amp SSRs that will do nicely for those two loads and I’ve verified that they work fine on 3 volts (they worked okay on 2 volts in my tests), and my current plan is to hot glue them to the back of a split duplex outlet. One outlet will be used to plug the 12V power supply into, and the other will be back wired to connect to wiring that goes to the outlet next to the water feature. I *might* go hunting for some beefier SSRS, but the good ones are unfortunately expensive and the cheap ones have a bad reputation. So, we’ll see. The ones I have are fine for those applications but if somebody plugs something beefier things will not work well.
The 5V power supply will be just enough to run the ESP; an amp will be fine. And yes, I’m going to break code and mix high and low voltage in the same box, but I will do my best to do it sanely.
From that box I’ll run some 4-conductor cable out. It will have:
That cable will run to the second box mounted up underneath the deck. It has the following inputs:
And the following outputs:
Maybe I’ll add in the under-umbrella lights as a separate circuit; the extra components are cheap and it would be nice to have separate control there.
My current stair lights are controlled by a switch in the garage and a power supply there. I originally thought I’d use a 12V relay to either power them from the garage or this controller, but it’s easier to just sense the 12V in the new controller and power all of them from the new power supply.
The MOSFETS I have are IRLB8721PbF, which are reputed to be decent for logic-level switching… Let’s take a look at the data sheet:
What I’m trying to figure out is what sort of current I can expect if I drive them from the ESP8266 pins. My drain to source voltage is 12 volts, so I’m looking at the right side of the curve, and I’ll pick the 3.0 V curve to be conservative. And that shows me that I can get around 10 Amps, which would be 120 watts. With 200 watts planned, I’d only pull 100 watts or so, so it looks like I’m close but okay.
But… Take a look carefully at that graph. See where it says “Tj = 175 C”. Yeah, that’s hot, and it’s the absolute maximum temperature, which means I’d really need some heatsinking or other cooling. The whole point of a nice power MOSFET is that they have low R(DS) resistances and therefore don’t get very hot. Which is not true if you are only driving it with 3V. This is the “if you’re stupid” graph.
There’s another graph in the datasheet:
Notice this one says that it has a junction temperature of 25 degrees centigrade. Which isn’t even body temperature. But, to get that from a 3 volt drive, I can only pull 3 amps.
What that really means is that I could easily build a test circuit and have it work great with my test loads of 30 watts or so, and then install it and hook it up to a 100 watt load and it will melt. Which would be bad.
The graph gives a really simple solution; instead of driving it with 3 volts, I need to drive it with something high. Like – I don’t know – maybe the 12 volts that I already have in the circuit. The graph only goes to 10 but if it went to 12 (insert Spinal Tap reference here), we’d expect that it’s pretty much the same. And it shows that we could do upwards of 100 amps from this device in that situation.
We can’t; the maximum continuous is 62 amps, but we can easily pull the 10 amps that we need. And the datasheet also tells us that at 10V(GS), the R(DS) is 8.7 milliohms. So, at a 10 amp current, that means the voltage across the MOSFET will be 0.087 volts, and it will dissipate 0.87 watts. A bipolar transistor here would drop 0.6 volts and dissipate 6 watts, which you would definitely need a good heatsink for.
MOSFETS do see increases in R(DS) as they get warmer. I am *probably* okay, but I’ll also probably put a small heatsink on the MOSFETS anyway and do a little testing overnight to see how they are pushing that much current. Or I could do the thermal calculations to see how much junction temperature rise I can expect.
Or… I might get lazy, and run two of them in parallel. Another nice thing that you can do with MOSFETS that is problematic with bipolar transistors. Bipolars have positive thermal coefficient, so if one gets hotter it pulls more current and things rapidly go downhill. MOSFETs does the offset, so you can generally put them in parallel with no problems.
So, how do we switch it with 12V? There are numerous MOSFET gate drivers out there that are designed not only to use a higher voltage but push enough current to be able to switch quickly; MOSFETS do not technically draw current but they do have gate capacitance so you need to pull some current to get them to switch quickly. That’s really important if you are building something like a switching power supply that you are switching at a relatively high frequency, but for my application, all I need is on and off and it doesn’t have to switch particularly quickly.
So, I’m going to go old school and use a small signal bipolar transistor to switch the gate.
The schematic comes from here. It’s really simple; when the logic input is low, the transistor won’t be conducting and the pull-up resistor will pull the gate high, turning on the MOSFET. Turn the transistor on by flipping the logic input high, it pulls the gate to ground (well, to 0.6 volts, which is close enough), and the MOSFET will turn off. It does invert the signal, which is a bit inconvenient but not really problematic in this case, as the 12V is only there is the power supply is turned on.
Pretty much any NPN transistor will do; I have some metal cased 2n2222s in my box, so that’s what I will use.
The only remaining part of the hardware is the sensing circuit for the 12V coming from the current stair light power supply. That’s pretty simple; take the 12 volts in, run it through a simple voltage divider, and I’ll get 3 volts to feed to the ESP.
All this is going to get hand-wired on a breadboard; there’s no reason to do a PC board for this application. I think the connections will all be screw-terminal barrier strips as they work well with the beefy 12 gauge wire for the low voltage lights.
I’m also going to build a small remote that you can use inside so you don’t need your phone to do the switching.
The software will be based on the ESP8266WebServer class, with a simple method to query the current state and separate methods to do the switching. I’ll do turn on, turn off, and toggle methods to provide some flexibility.
I recently switched to VS Code and Platform IO; it took some futzing to get it working, but the experience is so much better than the arduino IDE, and it knows how to create an ESP project that works out of the box. I have the bare-bones http server running for this; I don’t expect the full code is more than a day’s work if that. Oh, and I’ll do a web-page interface as long as I’m doing it.
I haven’t done anything on implementing the advanced functions based on sunset times etc., though I will probably implement auto-off for both the fountain and the lights.
10. Stuck with a group of people chosen by random chance
9. No talking
8. Note taking required
7. Really uncomfortable chairs
6. Courtroom built in the 1940s
4. No leaving until the judge gives you permission
3. Learning a bunch of stuff you will never need to know later
2. There is a major group project at the end
1. Early dismissal on a sunny afternoon makes everybody smile
We’re in the process of doing some new landscaping in our back yard, and that involves a small fountain and some landscape lighting. Which of course brings up the question obvious question:
How are you going to control the fountain and the lighting?
Here are some initial requirements:
The main controller will be based on a – no surprises here – an ESP8266 NodeMCU controller running a hacked-up variant of my animation software. The landscape lighting is going to be LED, which gives the following control requirements:
The AC control will be done with a couple of solid state relays that I salvaged out of earlier holiday light projects. The DC control will be done with some nice power mosfets. I should be able to drive both directly from the controller.
All of this needs to fit in one half of an outlet box. I’m not sure the form factor; I’m thinking that I’m going to 3D print a box for the electronics, but how it fits into the duplex box is tbd. I *might* put override switches on the box so that if you want to you can just press a button to turn the lights on for an hour.
And you can take the underground conduit for the pump outlet and the wire for the landscape beds as “already implemented”.
Here are the parts that have already shown up:
A 100 watt 12V DC power supply. It claims to be IP67 waterproof. The “6” means that it is “Dust Tight – No ingress of dust; complete protection against contact”. The “7” means “immersion up to 1m – ingress of water in harmful quantity shall not be possible when the enclosure is immersed in water under defined conditions of pressure and time (up to 1 m of submersion)”.
IP67 rating is impressively good. If it were true, I could drop this puppy into the fountain reservoir and it would keep running…
Alas, it is unlikely to be true; the ratings for much of the stuff out of China are hit and miss, with a bit more on the “miss” side of things. Which is why it’s going to be mounted up under the kitchen deck where water won’t be able to get to it.
I should call these “ubiquitous 10 watt low voltage LED lights”. I have a bunch of these at my cabin, and they are pretty well made; nice heavy aluminum housings to get rid of the heat, decent mounting options. This go about 18’ up in the eaves to project a nice smooth light down on the yard. I bought 4 of them.
These are the pathway lights. I spent a lot of time trolling the chinese marketplace sites (aliexpress/alibaba etc.) looking for some decent lights that were cheap. What I found is that you can either buy high end lights that are $45 each, or you can buy part of an endless supply of really cheap and crappy solar lights, but nothing in between. So I settled for these from Amazon. The Amazon product is not linked because it has changed underneath to some other lights; suffice it to say that I bought 12 of these for about $13 each. These will be spaced out in the beds to make them look all pretty-like.
Astute readers will note that I’m using 36 watts for the pathway lights and 40 watts for the floods (or only 30 if I only put up three). That leaves me about 25 watts to spare. Some may go to accent lights on the north fence, and others might go for some lighting to help get to the hot tub. If I was smart, I would have gone bigger than 100 watts, but that can be replaced if necessary later on.
This is a nice little power MOSFET that will be switching the landscape light circuits. Why this MOSFET? Well, let’s look at the datasheet.
First off, MOSFETS are far nicer to use to switch loads than bipolar transistors. Bipolar transistors have significant downsides; you need quite a bit of current to switch big loads (the overhead lights will be about 3 amps) or you need darlington transistors, and because of the fixed collector/emitter voltage drop, you lose a lot of energy in the transistors, and they get hot.
This little MOSFET will happily switch 44 amps @ 10 volts and 100 degrees C, which is *way* more than it will ever see. It will switch 3 amps with 3 volts on the gate and 11 amps at 3.5 volts; the ESP runs at 3.3 volts so it will be enough to switch the current I need (if I needed big current, I’d need a bipolar driver in front to push the voltage higher). And – like most power MOSFETS – it has very low resistance between the drain and source (8.7 milliOhms with 10 volts on the gate). What that means is that it dissipates almost no energy as heat when on, and I can run it without a heat sink; it will at most get very slightly warm. And it also means I’ll send a full 12 volts out to the lights.
I guess I could also show the big 200’ roll of landscape cable. In the old world of incandescent lights, I would have needed to power these lights with a loop or maybe multiple wiring runs; in this world, the floods have their own power supplies so the voltage to them isn’t critical and the path lights don’t pull enough power to result in much voltage drop.
For the box connections, I’m thinking I will probably go with some molex connectors; that gives me a fairly safe way to hook up the AC to the power source and that way I can disconnect the whole module.