The Electrostatic Sensitive Workspace

Hi again,

So I have been working on a way to cut power to my Raspberry Pi after it shuts down properly, and to do this I thought I’d be sneaky and use a MOSFET or two.

I learnt from work that MOSFETs are actually sensitive to ESD, so I have been grounding myself frequently when working with them, just for good measure.

Hold on hold on… I should probably give you some background on where this Pi is, then it’ll make a bit more sense as to why I’m doing this.

This Raspberry Pi (version 2, with the quad core : D, or should I say, : D : D : D : D) is installed in my car, and is running an installation of OpenCarPC by Andrei Istodorescu which is working quite nicely, with a few modifications to get the USB ports to the front of the car (more on this in a future post).

I trialled just straight running the Pi off of a 12-5V DC-DC converter from the car’s battery, permanently on. This drained the car’s main battery enough to need a push start in 3 short days. I give many thanks to my good friend that gave it a push in the pouring rain to get me going.

Then I put the Pi on the accessory circuit of the car (the one that turns on when you turn the key one click), this worked well, the battery was not draining 24/7, but the Pi was getting a brown out as soon as I tried to start the car (the crank drained the volts enough for the Pi to turn off and on again).

This was not good for the OS, and became corrupt within a week, that poor OS… So then I though to plug it into a USB power bank, and charge said bank when the car was on. This meant the car’s battery would not be draining and the Pi would be on and not getting corrupt.

Nope, USB bank ran out of power within three hours of running the Pi, it takes a lot more power than I originally thought! So I decommissioned it (unplugged the power) until I could implement a better way of doing things.

I quite recently built a little circuit that switches the output (5V) from different sources, depending on if said source had enough power. The three sources are:

12-5V converter

USB power bank

– Small solar panel (connected through 12-5V converter)

This (I thought) would work a treat, and it did! In theory anyway.

So what would happen, is that when the car is turned on, the relay would switch the output from USB power to 12-5V converter, and charge the USB power bank at the same time. If the car was off, and there was sufficient sunlight, the solar panel would generate enough power to trigger the 12-5 volt converter and switch the relay, charging the USB power bank.

That works awesomely! So I go to test it and when I switch from USB power to 12 volt supply… The Pi restarts. What? Why?

Well, it’s because I’m using a relay to switch Pi power, and in the time it takes the gate to switch from USB power to 12-5v converter power, there is nothing going to the pi. Mind you, this is around 50ms of time, very little amount of time to you and me, but to something that lives off of power, this is enough to shut off.

So, I’m at work, and I go to the boss man (experienced electrical engineer) with my idea of using a super capacitor to hold up the voltage when the relay is switching. He agreed and said that’s a good idea, and I asked how to implement it in the circuit He drew up a quick circuit with a resistor for charging and a schottky diode for a fast reaction time and a low volt drop, I went home that night and built it, and it works flawlessly.

My testing went like so:

Ok, plugged in, voltage in the cap is rising… rising… rising…

2 minutes later: rising… rising… yay! 5v!

Plug in the pi on USB bank power, let it boot.

Unplug the USB power so that the Pi was running on the discharge of the supercap only, go.

Ok, good Pi is still running… still running… still running…

Yeah that went on for a solid 20 seconds before I was baffled enough to plug it back in and say “Good god I like supercaps”. Pi was still running, all is well.

Alright, implementation time. I mounted the Power bank in the back of the car near the Pi, plugged it in and it booted right away… That’s when I realised how silly I was. Dang it man, this is going to drain the power bank in three ish hours.

Which brings me back to the start of this post, cut the power to the Pi when it is turned off.

How do I do it? oh, easy man! Use a relay, turned on when the Pi is on, and off when the Pi is off. Ok, good, but how do implement that? Well you just uh… um… hmmmm…

Yeah that ensued for about 2 minutes, and I remembered playing with the GPIO a while back in python. If I find a pin on the Pi’s GPIO that is off by default, then turn it on once booted, it’ll turn back off again when the Pi is safely shut down. Good, that’s the off part, but what about the on bit, how do I get the Pi to start?

This problem is trickier than it led on to be, you see, when you get in the car to start it, you get in, put the key in, turn it (accessory circuit), then within a few seconds (less than 10) start the car. As said previously, this dims the voltage from the battery enough to turn off the pi for a few seconds (that’s what the supercap/relay is for! Woot!).

Cool, so, connect the relay to the accessory circuit, and to the power on the Pi, that will turn it on, and when the voltage from Acc (accessory) dims, the USB bank will take over for a few seconds, and keep the relay closed, keeping the Pi turned on.

Ok, now to turn it off, I said I would use the GPIO to give me a 3.3v signal when it was on, and 0v when it was off. However, when the Pi is first switched on, said GPIO pin is 0v, kinda fundamental to the whole thing. Now this brings about a problem.

If I start the car, the Acc starts the Pi, and the GPIO pin has to turn the power back off when it’s dead. But the pin is dead, so the power turns off straight away… Dang.

New thought pattern:

3v3: “Pi is on, keep alive”

GPIO: “I’m on, now listen to me (disregard 3v3)”

GPIO: “I’m off now, so cut power”

I needed a way to implement this as an analogue circuit, and I found the way through some leftovers from another project.

I have a little DIL DPDT 12V latching relay, and another normally open SPST relay, and a few MOSFETs as said at the start of the post.

After much deliberation, a design was decided upon, it included three N channel MOSFETs, a 9v battery to switch the relay when 12v power was not available, and both relays. I haven’t actually soldered the circuit together yet, but I plan to very soon.

Here we have come to the reason for this post, as my desk holds on it the sprawled remains of projects past and future, some APA102 LEDs, tools, multimeter, soldering iron, aforementioned 9V battery, an Arduino UNO, a 100m roll of wire, 4 notebooks, document wallet, and various other electronic things; I can’t help but be wary to not touch some of it, as the ESD might kill it.

On a different note, I was shuffling through my music collection, and the Goo Goo Dolls played, and damn now I can’t get them out of my head, not that I’m complaining or anything.

Until next time,

Travers.

The Group Work Complex

So, University life; you could call it that, I suppose, but you’re not really alive in Uni. Its more of a horde of shambling bodies, possessed by a combination of new TV shows, food and an urge to learn.

Yeah that last bit is only half true, you don’t go there to learn as much as you can, you go there to learn as much as you need.

Group work is an interesting aspect of the University experience, or really any job requiring too much work for one person. The main point I want to type about is the train of thought that just goes:

“… Wait wasn’t <Person A> supposed to do this bit?”

“or was I supposed to do this bit?”

“… *breathes in through teeth*”

“Oh. Nope it was <Person B>’s job.”

Then they have the same train of though, and its an endless circle.

Choo-Choo.

So I bring this up because I just completed milestone 2 of this 4 part group assignment. Nothing too complicated, and the group members seem alright.

In other news, I made two orders to Element 14 through a friend, it all started when he said last week:

“Hey, getting some uFL connectors and shizz from Element 14, want anything?”

So I brought up all of the little projects I want to do in my mind…

So yeah I ended up ordering $40 worth of components, including but not limited to:

– Potentiometers

– Pot. knobs

– D shaft knobs

– Super Capacitors (3 Farads!!)

– other things

Then to order came in the next day (dang they have fast shipping), and the Super Capacitors I ordered were… I’m gonna say misplaced, but they sent me out two black plugs, meant for a ruggid four core wire connection. Sent them an email and they fixed it up straight away, but my friend and I had a little chuckle.

Then my friend said that he ordered the wrong thing for himself, and so he was making another order for parts, and again asked if I wanted anything else.

Much obliged! I ordered $50 more of parts, including but not limited to:

– 50A continuous N channel MOSFETs

– Schottky Diodes

Arduino Uno dev. board

– other things

ARDUINO! ZOMG!

First time owner of an arduino, but I have played with software/hardware integration before with a Teensy from Uni. That was actually lots of fun, made a tank game.

I got this dev board to do some experimenting and testing for the light switch control circuit and temperature monitoring for the house. Also to see just what this thing can do, so excited!

I’ll be posting again soon, thanks for reading!

Travers.

The Wet, Wet Easter Bunny

Oh the days where a glimpse of sunlight brightened not just my day, but my outlook of said day. Yes, over the 3rd, 4th, 5th and 6th of April this year, my immediate family and I went down to Georges Creek, NSW (Coordinates for those enthused: 30°45’09.1″S 152°11’26.3″E). Of course, the Easter long weekend would not be complete without more people we know (and some we don’t).

These people were my Uncle and his family, my cousin and her fiancé, and her (to be) in-laws. 10 of us all up, quite the merry bunch, full of stories and goodhearted humour.

So, on with the recollection of the Easter weekend.

It all started at 3:30am on Friday the 3rd of April, it had been raining the entire day Thursday, and all night before I woke up in a sleep-deprived state. I had been anticipating getting up so early that I was excited about going, so naturally, I hadn’t slept for more than half an hour straight that night. However, the alarm did sound from my phone at 3:30am, and that meant that it was time to awaken from my warm, cosy, relaxing bed.

Into the morning I sprang! jumped! walked slid slumped, stumbling to the shower in hopes of washing away the tired face I had grown overnight. I had enough time to have some quick breakfast, and check my emails. Whilst sitting in a posture that I’m sure will one day come back to hurt me, sipping the “Up & Go” liquid breakfast I had so cleverly remembered to put in the fridge a few days ago, I saw that I had a new email from my Uncle. It said that Mum and Dad needed me to bring down some advantix for Billy, he had been swimming and the stuff seems to not work too well after he gets wet.

I grabbed the pack of advantix from the cupboard and placed it on the dining table. It was time to go, so I grabbed my car keys, locked the house and armed the house alarm. Off to my Uncle’s I go!

Awesome.

Yep, I’m here.

Forgot the frigging advantix.

It’s a 20 minute drive back home… Nah Billy will be fine. I knew Mum and Dad only wanted the stuff as a precaution, they didn’t need it urgently.

*GRINNNNNNNNNNN*
Yeah he grins… One of many faces…

[FYI: No, he was not with me at home, this is just in here because I like the pic.]

Packed my bags into the car and awaited my cousin and Auntie to finish packing their things into the car as well. Things packed, check. Still raining, check.

Cousin says she wants to drive the first bit into the city to pick up her Dad, says she never gets to drive the first bit, no arguments here. Coolios, she drives us into the city, with mum back-seat-driving from the front passenger seat (as all good mothers do). We get to the pickup point, and we wait in the pouring rain at 4:35am for my Uncle to get off of shift.

I switch seats with the driver- here’s the bit I’ve been waiting for, driving the car, well, not really a car, more like a 2.8 ton Diesel bumper car (it was really raining).

Now I’ll tell you what the car is and why it is important for me to tell you this: The car is a LandCruiser Prado 150 series, 3L 4cyl Turbo Diesel, with a DP Chip. This car has a HF radio, a CB radio, I’m pretty sure it’s got a satellite beacon in it somewhere, and a GPS navigator. It also is attached to a large, 1.4 ton silver and khaki anchor, also known as a camper trailer, though everything is quite new, so there’s no real danger here, just got to be extra cautious about braking distance in the wet.

I did track my journey from the City to Grafton, all 308.24 km of it (took 3hr 35min of non-stop driving). We did stop in Maccas at Grafton though, and I got hotcakes, hash brown and orange juice, omnomnomnom.

It was at this time that the rain dropped off the radar. Well, actually we just drove away from it. Turns out that if you drive far enough, you can run away from bad weather.

My cousin drove from there to Ebor falls, which was about an hour and a bit away from Grafton (I did not do any more tracking until after the weekend).

This is the Upper Falls at Ebor, quite spectacular with this amount of water
This is the Upper Falls at Ebor, quite spectacular with this amount of water

We must press on! However this place is pretty pretty, but we’ll be moving pretty quick pretty soon, so better get going- But not before a quick driver change, we had just come through some narrow roads (still dual lane carriageway, but no shoulder) and my cousin decided she would like a break until the roads are a bit nicer.

Little did she know that the roads were only going to get better from here! By better I mean narrower, more dirty, and in about 80km, it’s going to turn into loose gravel. My Uncle said that he should drive since I did 3 and a bit hours this morning, though I felt fine and was raring to get back into the driver’s seat.

A bit of back and forth, and we switched again (I am now driving, yay!). We pulled out of the park and came to a T intersection, and I had misjudged the braking capacity of the car/trailer combination just a bit… so braking was slightly uncomfortable. However, nobody seemed to be having a stroke, so I’d call it mildly successful.

About 45 minutes down the winding black road we came to a graceful part, an exciting turn of events, an unravelling of joy between my Uncle and I. It was dirt. But not just ANY dirt, it was dirt we could DRIVE on! An unspoken veil of invigorating happiness, along with some giddiness and mostly just anticipation of the moment. That was what fell upon the two of us in the front of the car, hitting us just like the subtle drop of the level of the road.

I can’t speak for the two occupants in the back of the car, but I can imagine that the grips on the doors and seats tightened somewhat as we experienced a slight amount of drift around every corner.

We reached the top of the range leading down to the camp ground; only about 25km left to go until we can pitch tent and relax.

We had just regrouped with the other people travelling down with us to enjoy this long weekend together. The Hulix went first, calling out any cars coming up so we could find a place to pull over safely and have enough room for the people coming up to pass by without getting bogged in the mushy side of the road.

Good thing too; the road wasn’t wide enough for two cars in most places, and it was an almost fatal drop off of one side, and a wall of rock and dirt on the other. But we made it down swiftly without a hitch; I met up with Mum and Dad and of course, the Bilbo Baggins. Dang that dog is soft.

We all set up camp and had some afternoon tea as we watched, grimacing at the dark grey clouds looming over to the south east. They floated ever closer, like a Caddy Shack joke in a pool, nobody wanted it, but this wasn’t chocolate, it was just… just wet.

So it rained… And rained… And rained.

I decided enough is enough, we’re camping, and dang it, we’re going to have a camp fire. I’m tired of everybody huddled under their own awning away from each other, being all anti-social.

I asked around, and sure enough one of them had a cheap tarp they didn’t mind putting high over the fire place. I assured them it wouldn’t even get warm, the rain would cool it, and the heat from the fire would dissipate enough at that height anyway.

Up went the tarp, on went the sticks, the blocks, and then the log. It was a nice fire, if only we could sit around it without getting wet from the rain…

Up went another tarp, next to the fire this time, in came one, two and three other people. Awesome! It worked! I felt like a shepherd of people.

 

Good time ensue.

 

Still wet, still dark
Still wet, still dark
But pretty
But pretty

The rain died down a lot, enough for me to salvage what was left inside my little tent, trying to get it dry. The bedding was touching the floor (NOOOOOOOOO).

It was soaked. Damn.

Luckily got it dry in time, don’t do that again. Sleeping bags are good.

Saturday night comes, I pull out my Easter eggs, ready for the morning, going to get up early and put them everywhere around camp, give everyone a nice surprise when they get up.

Sunday morning, Easter is here! Woot woot!

The rain has cleared, the birds are singing, and its 5:30am, time to hide the eggs!

Dad was already up, he said he didn’t sleep too well, back was a bit stiff, but Bill was there for him, so that was a nice walk for them both. Dad helped me hide the eggs, I gave him half of them, we hid them in plain sight, and everywhere else.

I put some on car door handles, one in a cutlery drawer, one on a tap, on a tarp edge, everywhere!

Everybody else, one by one, got up, did their morning routine, and completely missed ALL of the eggs!

Good god people, I know it’s early, but wow.

Anyway, I put them in places they had to use in the morning (tap, cutlery, etc.) so it was inevitable.

They noticed! Awesome, laughter and chocolate enjoyment ensued.

That was pretty much the entirety of Easter Sunday, then the afternoon came, filled it with board games, card games and snacks.

Night fell, my Uncle asked around to see if everybody wanted to do a communal dinner in a camp oven (known as a Dutch oven, not to be confused with a Dutch oven). It was an absolutely delicious meat and vegetable stew, beef, potatoes, carrot, onion, sweet potato, peas and a few other things, along with some port and some nice wine.

As if that wasn’t enough! He then made a self-saucing chocolate pudding!

I like my Uncle; he makes really nice camp meals, and also loves radios.

The self-saucing pudding. I’m a rather quiet person, don’t usually speak up or out at much. But in the right company, I’ve been known to say some rather funny things.

I said, to my dad, “Hey, so when are we getting that… SelfSaucingChocolatePudding?”

“Some… SelfSaucingChocolatePudding?” Said Dad,

“Yeah, that SelfSaucingChocolatePudding.” I said,

So then dad yells out to the rest of the camp, “Hey! When’s that SelfSaucingChocolatePudding gonna be ready?”

“I’d really like some of that SelfSaucingChocolatePudding!” he continued.

He repeated this in similar statements, always including, sometimes twice, the “SelfSaucingChocolatePudding” conglomeration.

It was a “you had to be there” kind of thing, but I thought I should share it anyways.

So we had the SelfSaucingChocolatePudding… My god it was so good. We had it with custard and dollop cream, and I think it was the best desert I’ve tasted yet.

We stayed up a while longer, knowing we had to pack up and go the next day.

We all enjoyed the last night thoroughly, it was a memorable weekend, and it had ended on a very satisfying high note.

Monday came around and the sun was up, the tents were drying, and the tarps were finally taken down from the fireplace.

We packed the trailer and hooked it up to the car, said our goodbyes and headed up the range. We got about 10km into the drive and saw what we had been camping in. We had been in the valley of the mountains, and the cloud had condensed enough not to be able to get over the mountain peaks, and was trapped in the valley. It was quite wonderful to behold.

The clouds were stuck in that valley
The clouds were stuck in that valley
Some nice greenery in the foreground, but the clouds were quite nice
Some nice greenery in the foreground, but the clouds were quite nice
Dad driving up the range, chasing the clouds
Dad driving up the range, chasing the clouds

Once we made it to the top of the range, we drove further and the loose gravel turned to asphalt. Sweet, sweet asphalt.

I don’t know what it is, but once you’ve been on bitumen for a while, you want to drive on dirt, then when you’ve been driving on dirt, you embrace the relief of smooth black road like a long lost friend- warm, comfortable, safe but completely platonic.

Dad drove most of the way, up until we hit Guyra, NSW. I drove from there to home, rather uneventful drive, but Bill didn’t seem to mind what anything was. He was asleep.

Once we got home, we set up the tents to dry them out completely before packing them away again, ready for another relaxing, good-memory-making trip.

Ok, now that (I think) was a long post.

Here’s some more Billy.

Look at me, I'm in a chair
Look at me, I’m in a chair
We call this face "Puffy Lips"... Can you guess why?
We call this face “Puffy Lips”… Can you guess why?
I keep asking people "Have you seen my dog at night?" They say "No", I say "... Neither have I."
I keep asking people “Have you seen my dog at night?” They say “No”, I say “… Neither have I.”
He actually quite enjoys Ice Cubes
He actually quite enjoys Ice Cubes

 

Thanks for reading!

Travers.

The Easter Trip

Hiya! (Not a ninja, just saying hello)

So, Easter is fast approaching, and my family and I have plans! 

Wow, plans! 

So this morning I am up from 3am, leaving home by 3:30am, to go to my uncle’s house, pick up his car, and drive it to him in the city where he’s just finished his night shift. We then go from the city down south, for about 7 hours. 

Down into NSW, to a lovely camping site near Georges River, near the bass Lodge. Last time we went down there, “Tour De Rocks” was on, it is a large charity bike ride from Armidale through the mountain range roads down into the camp site, it was awesome!

This time I couldn’t go down at the same time as mum and dad, I had an exam on Thursday (they left on Wednesday night). So they took the fluffy, and yeah I’m headed down there really soon, awesome! 

Will upload pics when I get back, but for now, I gotta go. 

Have a great Easter Break! 

Travers.