Leaving London and Going to Scotland

On the morning of 7 Oct Sarah and I headed to the Stansted airport to fly to Glasgow.  It’s fairly easy to get to the airport, there’s a train out of the Liverpool Street station that takes you right there.  I got tickets in advance, and they’ll take them right from your phone screen.  We cashed in the remaining funds on our Oyster cards before heading out – the normal Oyster machines at the station will give your remaining money back.

Once we got to the airport, Ryanair made the flights easy.  By the time I’m writing this we’ve actually left Glasgow again on a Ryanair flight to Dublin.  That second flight had a bit of a delay, but no other problems, so the service was reasonable.  They have a carry-on bag weight and size limit, but nobody was measuring them, so no problems there. Unlike Norwegian.

Stansted makes security easy, but after security is a different story.  Security is well organized, with many short lines and a couple large lines that feed into those in a fair manner.  There’s an automatic bin-return hopper, so employees aren’t wasting their time there.

Once past security you have to crawl through the bowls of a shopping mall in what seems like a crowded line that will never end, with no sign to indicate the status or locations of any flights, no clues as to where to go other than forward, and a constant crush of people and what I can only assume are soulless automatons that are capable of spraying perfume and foisting garbage fliers upon you.  This part feel like a bad dream.  I told Sarah that I had literally had this bad dream before – at the airport there’s always this low level worry I have that I’m late and that coupled with the ridiculous market really is straight out of a nightmare.

Once you coil through this mall for maybe 10 minutes, and I’m really not exaggerating, you arrive at what is best described as the stomach of the airport.  It’s a large bulbous seating area surrounded by restaurants, fed by the intestine-shaped mall area.  That makes security the anus.  There are a few screens in this area showing departure times, but a key part of how this airport works is that they want you to stay in the stomach mall area and away from the gates until the last minute. Therefore, the signs state that they won’t display your gate until about 20 minutes prior to boarding.

At this point, waiting at Stansted was largely pleasant.  Eventually the airport threw us up, spitting us towards our target of Glasgow.

The analogy has to end there, because Glasgow is anything other than a toilet.

I had reserved a car at Budget from the Glasgow airport.  The rental car woman and I had a funny little conversation, after which she expressed concern that I had rented the smallest cat possible.  I crouched down and showed her that I would have no problem fitting.

She went away to look at the availabilities, came back, told me where my car was located with a little grin, and left us to our business.  Sarah and I looked in the spot I had been told, but a beautiful SUV was there… I continued to search the lot for some other A-12, but none existed.  I tried the unlock button on the key – the SUV was ours.

A Peugeot 3008 is a beautiful machine.  That sounds like it must be a joke, but it is not.  This was a 6 speed diesel beauty with all kinds of electronic doo-dad sensors. I used every one of them to keep us alive.

Here’s a thing: these people drive on the wrong side of the road. There’s no turning on red – none. There’s a red-yellow stoplight combo. There aren’t speed limit signs on most roads. The ones that are there look different. Street signs often don’t have any words to tell you what they mean – three slash two slash one slash why?  There are all kinds of new street markings in paint. People jaywalk.

And the big one – the roads are narrow in the highlands, or single-track.

Overall though, once I re-learned how to drive, driving was extremely pleasant. Drivers are well behaved. It was really wonderful.

But I’m moving too fast. Glasgow was a beauty of a city. We stayed in a nice little hotel in a part of town called Finnieston. This is trendy area with great food and drink, for good prices too.  We started by going to Kelvingrove Cafe for lunch, and I really can’t imagine a better way to start a visit to Scotland.  Great whisky for crazy low prices, but we just had coffee and lunch and were impressed.

Sarah and I stayed at Sandyford Hotel, which is wonderful and really could be considered a good spot for breakfast apart from the hotel. I got in a great run around downtown and the river, and Sarah and I went for a walk from the hotel through downtown Glasgow.

At one point we stopped at this karaoke place, an old guy bar.  We stayed for about an hour drinking cheap beer and whiskey, and then this old dude who had been giving Sarah the eye all night got up.

He leaned heavily in his cane, and as he stood he adjusted his jacket to cover the liver spots on his chest that showed through his dirty polo. He stumbled once on his ten foot journey to the karaoke DJ. He glanced back over his shoulder before telling the DJ what song he wanted to sing, fixing Sarah in his gaze.  As he turned back to the DJ, a bladder attack struck Sarah, and she departed to the pisser.

Old guy talked to the DJ, then turned around as the opening chords played.  A pallor came over his face as he saw that Sarah’s seat was empty, and he’d be singing without her to hear him.  He raspfully crooned his love song to her empty seat. If his face had any moisture left in it, he would have cried as he sang to her empty seat.

Sarah strode back into the karaoke hall with confidence, and old man’s voice gathered new courage.  He was now able to raspily sing in a way that was understandable, and he sang his song of desperate love to Sarah, alternatively looking at her and the ceiling.

As soon as I was able to catch my breath from laughing, we left.

There was also a part of the karaoke where an old dude sang a love song more or less to me, but we can save that for another post.

Seeing London Sights and Saving Some Pounds

One thing I questioned before we got here was the wisdom of using this thing called The London Pass.  It’s a card you purchase for 1, 2, or 3 days of entry into a ton of attractions.  On our first partial day here I realized it was probably a good deal for us, in part just so that I wouldn’t have to wonder if any one place’s entry price was worth it.  Obviously there are many things in London that aren’t covered, but there are so many common tourist attractions that are covered, and it make sense to use this card if you’re doing to do those things for three days.  In all, we saved almost £20, saw at least one thing we probably wouldn’t have otherwise, and didn’t have to wonder once whether an entry price was worth it.  Let me run you through our trip.

Day 1:

  • Churchill War Rooms
  • Westminster Abbey
  • National Portrait Gallery (free entry anyway)

Day 2

  • Cutty Sark
  • Greenwich Observatory
  • Queen’s House (free entry)
  • Tower of London

Day 3

  • Tower Bridge
  • Chislehurst Caverns (really, they’re mines)

It also worked as a discount in several gift shops, and allows you to skip many lines.

Anyway, a couple of those spots are expensive to visit, but you get right in with the pass.  If you’re going to this number of places or more, and doing a three day trip, the pass might work for you.  It was about £90 when we got them.

Another great thing was the visitor Oyster card.  This costs £5, which you don’t get back, but then it’s a pre-paid card you just tap on a pad to get on most London-area public transport.  It, plus generous use of Google Maps public transport routing, makes using transport here so ridiculously easy.  The public transport links every part so tightly, even the outlying suburbs.  And with the Oyster card it’s crazy easy to use.  It’s pre-paid, but there’s (supposed to be) a simple way to get any leftover money refunded after your last usage before leaving town.  You can’t get those first £5 back, but the convenience is worth it if you’re here for a few days.

Foggy London Town Day 2 3/4

Jolly old England!

Time for a bloggie postie!  A bloggie-do!  A postarama bloggy style!

Cheerio pip pip and wotnot ole chap!

Ok, enough of that shit.  Sarah and I are in London, England!

This is the end of our second full day here, and I’m pleased to say we didn’t sleep in too much.  Today we got going around 930, down to Silvia’s Corner, a real foodie’s breakfast place near our air b&b. Well, the foodiest place nearby.  This was a great place to stop for both of us.  Sarah got a juice and this eggs and chorizo and toast thing that was fantastic, and I got a greasy ass plate of buttered toast, bacon, sausage and eggs.  Fantastic.

After breakfast we took the light rail down to Greenwich and checked out the Cutty Sark, the observatory, and the Queen’s House.  They were working on the rigging on the ship, and you get to walk all over it.  They’ve setup fantastic animations and museum games down in the hold.  Over at the observatory you can stand on the prime meridian, and see some of the original clocks that enabled naval navigation.  The Queen’s House is now an art museum. It’s open to visitors for free.

For lunch we stopped at the Greenwich market, which is full of kitschy shops and street food places.  Sarah browsed the shops, while I looked around for which Indian food place was the best.  We had samosas and a Chicken Tikka wrap while sitting in the warm sunlight.  We grabbed coffees before hoping back on the light rail and heading in toward the Tower of London.

We spent about to hours bumming around the Tower. This place is a castle that is almost entirely open to the public.  Beefeaters are living here still, giving tours, and our tour guide Spike was hilarious.  This guy knew his history and knew how to entertain. We had a great time, and followed the tour up with a self-guided exploration within the walls.  The Tower Bridge raised up at one point to let a boat through – you can find the Tower Bridge raising times scheduled out on their website, and you can find great views of the tower bridge at the tower of London.

Now we’re sitting in a pub just back from a main drag, called Draft House Seething.  Great place.

Yesterday began with us walking up late.  No worries mate.  I went on what accidentally became a six mile run, but I got to see a good chunk of the city.  The Millennium Bridge, Shakespeare’s Globe Theater, Tower Bridge.  Well, we had seen Tower Bridge the night before.  There was a place playing London Bridge is Falling Down under London Bridge.  It was on a loopie doopie as they call it here in gay old London town.

Anyway, after that we picked up a couple London Passes, which we have been using ever since.  They’re basically prepaid entry to more places that you can ever visit. But we knew we were going to visit a bunch of them.  On that first full day, Churchill’s War Rooms, Westminster Abbey, the National Portrait Gallery (which is free anyway), Big Ben is down there too, but he’s under construction.  You know why the ladies call him Big Ben right?

We went to dinner around there, and some sort of London Film Fest was happening.  So of course we had dinner with Kate Winslet and Sarah drew her like she draws me, her French girl.

Dinner at Waxy’s Little Sister, this pub with good food and an upstairs couch lounge.  We walked around and stopped by Sherlock’s house, which is a museum at 221b Baker Street.  That was a short stop away on the Tubey Wubey, as they call it here in Foggy Londonnerville.

I’m sticking to my doctor prescribed one-cask-ale-a-day prescription.  It’s tough but I think I’m the man to accomplish it.

Titty titty ta ta for now, as they say here in Queener-do-ville.

RasPi Flow Meter In A Pinch – Part 2

META: Part 1 describes the problem I’m trying to solve here.

I need a way to monitor water flow through my water filter over several days, and I don’t want to sit and watch it.

So – I took a Raspberry Pi I’ve got and a little Python and hacked a solution together.  The basic idea was that I’d position a plastic cup below the output stream of the waste water, I’d put two wires into the cup, I’d put a voltage on one wire and attempt to see the voltage on the other.  I’d use the Raspberry Pi to check for the voltage once per minute and log the status to a file with a timestamp.  Later, I could graph the state of the voltage – DETECTED or NOT DETECTED – over time, and produce a graph showing when the waste water was running.  With that I could even get an approximate flow rate waste water, if I wanted, by measuring how long it takes to output a liter of waste water and multiplying by run time.

First – the cup.  The simple flow meter.  I poked a hole in the bottom so water drains out slowly, and poked a couple holes through the sides to hold wires in position close to each other without touching.  When water covers the wires current should be able to flow between them, when the water drains out current should stop flowing.  If the waste water overflows the cup it will just run over and down the drain as it usually does.  It takes about 30 seconds for water to drain from overflow until the wires are not conducting, and I was hoping to measure conductivity every minute, so my initial cup holes were close enough.  The waste water runs quickly enough that the cup fills up in about a minute.  This means that polling every minute should produce a graph that closely represents reality.

Cup with two wires hooked up, water running into the top, and water overflowing down the side.  Cup is sitting in a laundry room slop sink.

Next – the Raspberry Pi.  I got Adafruit’s Pi Cobbler along with the Pi, which is a cleverly-named pinout that’s easy to plug into a breadboard.  That plus this handy tutorial from Make made it really easy to write a little voltage tester.  Here’s the code.

#!/usr/bin/env python3

import RPi.GPIO as GPIO
from time import sleep, ctime
import atexit

INPUT_PIN=21
POLL_PERIOD=60
LOG_FILE="/home/username/waterLog.csv"

def resetGPIO():
 GPIO.cleanup()

def setupGPIO():
 GPIO.setmode(GPIO.BCM)
 """ Set INPUT_PIN to pull-up, so the signal will be when it goes low
  That way, we won't potentially source a lot of current to ground with
  a positive voltage, and also just the ground of water might pull it down,
  which would indicate there's water in the cup (and therefore, is what we
  want)
  """
 GPIO.setup(INPUT_PIN, GPIO.IN, pull_up_down = GPIO.PUD_UP)
 
def pollForWater():
 with open(LOG_FILE, "a") as f:
  f.write(",".join((ctime(), str(GPIO.input(INPUT_PIN) == 0)))+"\n")

if __name__ == "__main__":
 atexit.register(resetGPIO)
 setupGPIO()
 while True:
  pollForWater()
  sleep(POLL_PERIOD)

So, now I connect the Pi to a ribbon cable, to a Pi Cobbler, to a breadboard, to two wires on pin 21 and a ground pin respectively.  The other ends of the wires are not touching and are in the cup.  A couple design choices – I could make the pin I’m using for input (pin 21) connect to the Pi via a pull-up or a pull-down resistor.  These options, and the resistors, are built-in to the Pi and selectable in code.

I told pin 21 to use a pull-up resistor, but if instead I told pin 21 to use a pull-down resistor, it would normally rest at 0 V and I would detect a voltage (and thereby detect water) by connecting 3.3 V to the other wire.  There’s a problem with that – I’m putting these wires in water and that will potentially introduce another “ground” connection.  When the wires touch water, the 3.3 V wire would essentially be connected directly to ground, and then the Pi would try to provide a bunch of current, and that could be bad for the Pi.

I told pin 21 to use a pull-up resistor, so that means it normally rests at 3.3 V.  It is connected through a good-sized resistor to 3.3 V, so when nothing is connecting the pin to ground or some other voltage, that resistor “pulls” the voltage on pin 21 up to 3.3 V.  If something connects the pin to ground, the Pi will try to provide current again, just like before.  However, in this case the good-sized resistor is in the way, between 3.3 V and ground, so the Pi won’t have to provide too much current to get everything to equilibrium.  Some folks call this “current limiting” – the Pi is limited to how much current it can provide.  A voltage source simply provides enough current to raise the voltage at its output to its set level.  When that happens, all the currents and voltages balance out and everything reaches equilibrium and stays the same until some other thing happens to the circuit to throw everything out-of-balance.  With pin 21 set as “pull-up”, even if the water introduces another ground, nothing bad should happen to the Pi.

Another design choice – I used Python’s “atexit” to cleanup the Pi’s GPIO port.  The example website I linked to above simply put it after the “while True” polling loop.  The problem with putting the GPIO cleanup after the infinite loop is that if you kill the program by pressing ctrl+c (or by any other means I can think of) the cleanup code never runs.  Python just exits the program immediately.  By registering the cleanup code with “atexit”, Python will run that cleanup code as the last thing it does whenever it possibly can.  There are ways to kill the program where Python will bypass atexit, but all the common methods will let Python exit cleanly and cleanup the port.  Port cleanup isn’t critical in my case – I’ve already got the simple ground protection setup I described above, but it can’t hurt, and if I ever just copy my old code into a new project I’ll be glad I did it correctly.

Raspberry Pi connected via ribbon cable to breadboard.  Breadboard has several circuits on it, and is sitting on a table.  Two wires run from breadboard to slop sink to the right.

Um, that’s pretty much it.  There’s some other stuff on the breadboard but it’s just an old circuit and is irrelevant here.

Waste water hose draining into cup (the cup with the two wires, sitting in the slop sink).

So, that’s what the setup in the sink looks like.  The water is running out of the output here, it’s hard to see in the photo but there’s the shadow.

Photo of a command prompt terminal displaying sample output.  Sample output is date stamp on the left followed by a true or false value, separated by a comma.  The time stamps are a second apart, and true/false values vary through the data.

And here’s a photo of the screen.  Because no screenshots for you.  Just gonna take a photo and pretend like that’s cool.  See how some say true and some say false?  This was a test run, polling every second.  When the wires are less than half-submerged they don’t provide a clean on/off signal to the Pi.  That’s ok, this was a hack.  When I poll only every minute the on/off signal gets much sharper.

Screenshot of terminal data taken once a minute, timestamp comma true/false.  All of the early time stamps are true, then about halfway through they switch to all-false.

Actual data – a screenshot this time because we’re not savages.  I filled up some containers at around 17:20, that caused the filter to start filtering and the waste water to start running, then the water ran until about 18:31, so about an hour.  I would expect that the water doesn’t run again until late tomorrow at the earliest…  We’ll see!

RasPi Flow Meter In A Pinch – Part 1

META: This first part is about the problem that caused me to build the solution.  Part 2 is about the solution.

My new place has an awesome feature that was disabled when I moved in – a reverse osmosis water filter!  It’s not a whole-house hookup, it’s just for the refrigerator and a dedicated tap on the sink.  We definitely wanted to use this thing!  At first, I just turned it on and it seemed to work fine.  However, with a little time, I noticed that the output water from the filter never seemed to stop, and there was a small leak on the “filtered water” side…

A marketing image of a reverse osmosis filter.  There's a storage tank that holds about four gallons on the left, there's a five stage filtering system on the right.  The first three stages are long tubes along the bottom, they filter out sediment and shit.  The fourth stage is the reverse osmosis membrane.  It's the branes of the operation, but it's hidden behind the fifth stage and sitting on a small platform just above those first three cylinders.  Stage four and five are squat horizontal cylinders.  Stage five modifies water flavor.

So – reverse osmosis filtering – it uses water flowing past a membrane to pull impurities out of the water on the other side of the membrane…  It uses water to filter water…  Pretty crazy.  That water that did the pulling, however, has to get dumped down the drain.  The filtering system wastes about 5 times as much water as we drink.  Not great, I know, but maybe I’ll rig the thing up to water the plants later, or something.  It’s not like the waste water got very dirty.

Anyway – that waste water never stopped running.  It was very wasteful.  The parts didn’t really have numbers on them so I couldn’t lookup the system to figure out what was wrong…  I just called some dude who knew.

And he wanted $340 to fix the thing!  Crazy.  I can figure this out.

I decided to start by fixing the small leak.  Start small!  I figured out how the hoses worked, then figured out how to look the system and spare parts up online, then rejiggered the output hose, and the leak stopped.  Score!

The waste water output is controlled by two valves.  One valve prevents backflow – when this is broken it frequently causes the waste water output to never stop.  The other valve is a pressure balance thing, so when the filtered water side pressure is close-enough to the input water pressure the valve closes off and it stops water from flowing through the filter.  Pretty slick!  When the pressure balance is broken it frequently causes the waste water output to never stop.  A little troubleshooting indicated that the pressure-balance valve was the real culprit.  Perhaps it was broken, or dirty, or just out of balance?

It was at about this point in the troubleshooting that I realized the output water was not continuously running anymore – the entire system seemed to be working properly.  I think solving the small output leak caused the pressure on the filtered size to raise enough that it closed the pressure-balance valve.

Problem solved!  Maybe…  I’m never very confident when problems with systems I don’t understand very well seem to solve themselves…  It’s nice, but not ideal.  Plus, it’s hard to tell if the output water is really running a sensible amount.  The system has this tank built in to store up water, so even after we dispense a normal amount, the pressure in the filtered side is still pretty high – it’s still high enough that the system doesn’t need to filter more water right away.  That sets up this very nice natural hysteresis, which is great for the system but not great for troubleshooting.

To be confident everything is working, I need to monitor the waste water output for several days.  I do not want to watch the output valve for several days.  I need a data-recording flow meter.  Time to get nerdy!