Browsing Posts in Power

More science fun. 10/01/13

I’m currently just putting the finishing touches to another ‘electric bicycle trainer’ for our good, good friends at Trade Base.

They took a good look at ours, and immediately wanted one.  Now, this was quite a few months ago, and since then I’ve been building it in my ‘spare time’. (…Ha!  Wassat, then?..)

It’s now very near completion -just a FET to change, and when it’s done, unlike ours, it will have a 240 Volt mains socket on it.

Now, this 240 Volt output won’t be able to power much more than a phone charger, battery drill charger, or other low-current device.  It certainly won’t be able to boil a kettle, but is perfectly adequate for running LED lighting and the like from.

However, after this evening’s management meeting, Diane and I were discussing options, and, well, stuff.

At one point, she had an idea of running a 240 Volt slow cooker from a bike box.

What an absolutely brilliant idea!!  Slow cookers take much less juice than, say, a kettle.

This means on a Saturday, we can prep stuff up in a morning, then by close of play, it’ll all be done and piping hot; ready to eat!


…Tomorrow morning, I’ll finish off the Trade Base box, then run a series of tests on it to see exactly how much ‘juice’ it uses when powering a slow cooker.  This will involve measuring the current being drawn out of the battery from cold, then monitoring it as it gets up to temperature, then measuring how much it takes just keeping the food warm.

If all goes well, we’ll be able to ‘properly’ test it over at our Plots this Saturday.  If that goes well, I have another ‘Slightly Pranged’ 240 Volt converter that just needs a couple of switching FETs in it, and I’ll then ‘retro-fit’ that inverter into ‘our’ bike box.

Who said ‘domestic science’ (…or whatever they call it nowadays…) was boring?

Slightly different topic, but still ‘electrickery’-related.

Many, many years ago, when I was just a wee small boy, my dad bought me a Ladybird book; ‘making a Transistor Radio’.

It was a how-to book, written in that inimitable Ladybird style.  Starting with just a long length of wire for an aerial, a coil, a tuning condenser (…’vari-cap’ in modern language…), a cat’s whisker (…diode…) and a good earth, it showed you how to make a true ‘crystal set’.  No batteries, no integrated circuits.

Now, my allotment is the required length to string up an aerial.  And there’s plenty of ‘good earths’ to be had by simply whacking a metal pole into the ground…

…I wonder if one of our junior volunteers (…Step up, Jordan!..) would like to learn to do ‘proper’ electronics?

I’ll run it by him on Saturday…

Watch this space…

You must have caught the news recently?  There have been items about the new ‘Raspberry Pi’ single-board computer that the government is hoping to get into schools to teach children proper programming rather than just how to use ‘Word’ or ‘PowerPoint’ (…shudder.  I HATE ‘PowerPoint’…).

We think this is a very, very good thing.

Of course, guys of a similar age to me will fondly remember spending hours and hours over their ZX80’s or ZX81’s typing in programs to play ‘Space Invaders’!  Aaaah…  Happy days!

Nostalgia aside, its great that the Government have finally seen sense and decided to overhaul the computing curriculum.

AnywayDad, what ARE you going on about?

I’ve been following the progress of the little Raspberry Pi with great interest.  As soon as it was announced that it was available, I was one of the hundreds of thousands of guys and gals who totally crashed both the Farnell and Radio Spares websites, all wanting our orders there and then.

When Farnell had put their servers back together (!!!), they mailed me and said that they had received my order, and that my Raspberry Pi would be dispatched late April.  Well, today I received a polite mail telling me that the dispatch is ‘imminent’.


So what’s this all to do with a growing project here in Sunny Sheffield?

Well Dear Reader, as soon as my little board arrives, I’m looking to hook it up to the Electric Bike!

Out go the LED displays and little LED ‘tell-tales’.  In comes a full HD display!  Full high-definition graphics!

Out goes assembler programming, in comes Python, C, C#, HTML and CSS.

As the title says: Watch This Space for further fun and photos!

(Yes.  That photo is obviously my cat, Alfie.  This was his look this morning from my knee as I shouted in glee that my Pi was on its way.)

The parts have arrived! 17/12/11


This morning my smiling postman delivered four more PIC16F876A’s and two opto-sensors.

The PIC’s are for the circuit boards (…I only had one, so making two talk with each other was more than a little difficult…), and the opto-sensors are for the generator.

I plan to have a disc with a couple of holes in connected to the main generator drive wheel that the back wheel of the bike runs on.

These sensors will provide interrupts to the PIC to show that the wheels are moving.  By doing it this way, it means there’s no need to modify a bike to fit an infra red sensor and it will mean that unlike the bike computers you fit to your own bike, there’ll be no need to input the wheel diameter.  Instead, it will measure the speed of the generator and therefore the ‘speed of travel’ of the bike.


Don’t worry, it’s all been properly thought through.

SO, that means I can get changed into my ‘outdoor gear’ and go straight over to The Plots, hopefully for a hard day’s digging.

Being sat at a bench all day writing code and building circuits while eating the Co-Op’s finest donuts is great for the mind (…though not for the waistline, unfortunately…), but digging is good for the soul.

Of course, the promise of Mitzi to cuddle, gallons of Plot Tea to drink in the weak winter sunshine kind of helps too.

Another PIC board built. 16/12/11

Wednesday afternoon then yesterday, I built another little PIC board based on the PIC16F876A with just two display units on -this gives four digits of 0-9.

The difference with this board is that as I want to use it for I2C communications, I couldn’t use PORTC3 or PORTC4 because they are used by the I2C for SDA and SCL -that’s serial data and clock.

I therefore had to use two separate pins to power the ‘d’ and ‘e’ segments of the displays.

This wasn’t quite as easy as it sounds, but after a couple of hours re-learning about bit-shifts and the like, I got it fully working -it would count from 0 to 9 quite happily.

Then, I went back to my original board and modified that so I could free up those two lines.

Anyway, long story short and all that; now both boards are wired in the new configuration and both working well.

Now, I’m hoping that Farnell will deliver me some parts today.  I ordered some more 16F876A’s and a couple of infrared sensors on Wednesday and expected them yesterday, but as I had to go out to pick up some ink cartridges for Diane yesterday morning, I think I missed the delivery guy.  I need the 16F876A’s because I’ve only got one.  Trying to make two processors chat when you’ve only got one of them is somewhat difficult!

Anyway, as soon as the new 16F876A’s arrive, I’ll be able to put one in the other board, wire up for I2C then the fun will really begin as I get the two of them talking.

I know.  I haven’t explained this at all well, but please bear with me.

Its still early!

Soaking it up. 14/12/11

I left the board plugged in and switched on last night to give it a few hours soak testing.

And it all passed with flying colours.And counting.

To the right you can see it this morning, and it shows its been on for 10 hours, 39 minutes and 52 seconds.

What you can’t see is the dot between the ‘9’ and the ‘5’ which flashes briefly every second as the seconds count up.

Up at the top right, you can see the ’00’ of the speed indicators, which obviously is zero because I’m not on the bike pedaling!

Actually, I need to change a little of the code for doing the speed because it tends to ‘bounce’ as your speed varies, but a little tweak and it will be perfectly readable.

“So, Wardo,” someone shouts. “What’s the plan for today?”

Today I have to go down to good old Maplin’s to pick up yet more bits, and as I ordered them online last night after they’d shut, I expect a call very soon after 9.00.  And yes, now they’re starting to get their stock under control, I checked online, and they have everything in stock.

And talking of stock, yesterday I became the first person in Sheffield to buy Maplin’s entire stock of two different parts from both their Sheffield stores.  I pity anyone else who wanted BC547’s or those cute little 7-segment displays!

Today will be for some 32.768KHz crystals for the embedded RTC’s (Real Time Clock), some little 22pf and 33pf capacitors for running the main PIC clocks and some 330R resistors that drive the anodes of the display LED’s.  I may well see if they have any off-cuts of veroboard because I’m running a little low on that as well.

In other news, I spoke with Sheffield’s Best Electronic Engineer the other day -when I was waiting for that Farnell order to see what time they were likely to tip up (…just after I’d put down the phone!), and due to a mix up, he has a spare soldering iron he had to buy in an emergency because he couldn’t get a part for his Weller iron.

He said I could have it for Christmas!

Okay, its not a Weller, but it’ll be a whole lot better than the little Antex I’m using, and I’m going round to pick it up early next week, so HUGE thanks are in order to him for this.

Anyway, I’d better get in gear.  Much to do today.

14 seconds. 13/12/11

That’s how much the timing circuit gains in one hour.

Now, the purists out there would say I have to correct this, but at this time I really want to crack on with other, more exciting stuff -like getting two PIC’s to chat to each other via the I2C communications I’ve been talking about for the last few days.

Anyway, I’ve now got the bottom six digits showing seconds, minutes and hours as it should. And yes, its showing it in the right format -the seconds and minutes roll over at sixty as they should.

This only took a matter of minutes in ‘C’!  If I’d tried to do this in assembler, it would have taken forever to write and debug.

So, its down to Maplin’s to buy their entire stock of FA02C green segment displays (7) along with their entire stock of BC547C’s (…Er. One…)

More pictures later.

Where do you go? 12/12/11

Beyond: ‘Whose Cat!!’?

This morning, I waited for the postie like a little kid on Christmas Eve.  I was so excited, I really couldn’t sit still; pacing to and fro, nervously looking at my watch every two minutes.

Would he or wouldn’t he?

…And much to my chagrin, he didn’t.

All I received was some junk mail and some other stuff that wasn’t really important.

Ya, boo and sucks.

But then, just as I was glumly getting ready for the imminent arrival of Mr Ward Senior for our regular Monday lunch date, another postie turned up, big parcel in his hands and a large grin on his face.

“Waiting for this were you, Mr Ward?’  He happily exclaimed.

“You bet!  Merry Christmas!”  And I meant it.

So, before my dad arrived, I just had to open it up and check it was right.

And it was!

Throughout lunch, I’ll admit I kept looking at my watch.  I could hear the programmer, still in its wrapper at home, laughing at me.

As soon as I got in…

…I very calmly got a shower & shave, changed my clothes into the ‘All Grey’ comfy programming gear I seem to prefer, made myself a cup of tea then sat down at my bench and carefully opened it all up and plugged it all in.It works!

The Integrated Development Environment (IDE) was pretty cool about it being plugged in, so I set it up in software (…minimal, really…), then realised I had to make a programming lead to go to my new super-duper 8 digit display board.

ANYWAY, to cut a long and boring story only slightly shorter, suffice to say that my new board works (…Whose Cat??!!…), and not only that, it works exactly as I planned and built it to!

Okay, I tell a fib.  I’d forgotten that PORTA4 in an open-drain output.  This means that it can’t drive current, only sink it.  A quick 10K resistor up to the top rail soon cured that.  Oh, and there was a slight short between two of the segment address lines, but on clearing that, it worked absolutely perfectly.

And here you can see it to the right.  You can see the 10K just below to the left of the big chip towards the left of the board.

The top right and middle left digits are counting from 0 to 9 together on an interrupt.

The ‘.0′ you can see is the rev counter, sat at zero because I’m not pedaling!

What you can’t see because it’s so quick is the millisecond flash every second just to the right of that which tells me that the other timer is working perfectly.

Now, don’t worry.  I’ll very easily move the digits around so the top right two are showing revs and the bottom six will, at first, just provide a simple timer.  Once I’ve got this timer code in, I’ll leave it overnight to see if its drifts any.

Then I have to pop a couple of buttons on -one to change between km/h and mph and the other for that bottom display so it will show either and incremental counter, or on repeated pressing, count-downs from 10, 15 and possibly twenty minutes.

Then I have to carry on learning that circuit and circuit board making software I keep blathering on about.

Happy Days!

Ladies and Gentlemen… 11/12/11

…I present to you:


Difficult to believe, but its true.

Two digits of your finest counts-per-second.

Yes, I know that ‘counts’ means nothing in the real world (…2.25m to be exact -the circumference of the back bike wheel…), but that’s only a quick calculation, and one I don’t need to do right now.

The most important thing will be to get the new programmer tomorrow morning, see Mr Ward Senior (…a regular Monday lunchtime fixture…), then its on with the dead comfy jogging bottoms, the old grey T-shirt, the worn-out slippers, and I can look forward to not having to shave or shower for days!

Seriously though, it means that once the new programmer is here, I can quickly port-over the code then get some sensible numbers of out it.

And I can’t wait!

Building veroboard ‘creations’ is all very well, but its bad for the eyesight and it plays havoc with the ends of your fingers as you have to keep wiping the veroboard to clear detritus from between the tracks.

And after that?!

Ah, then I have to get to grips with the free printed circuit board software I mentioned many, many months ago from Express PCB.

Then I have to design the board (…no mean feat…), and get it squirted over to Dave so he can make the circuit boards with his ace ‘fabbing’ equipment.

Should be done by no later than Thursday morning.

(…Hang on, I see a flying pig overhead…)

Today’s mission… 11/12/11

…should I choose to accept it will be to program the display board I built last week with some new code.  This will be to give me speed and distance.

Okay, its with the old chip, but as I’ve mentioned before, porting code across chips with ‘C’ and the Microchip Integrated Development Environment (IDE) is ridiculously easy.

It will give me a ‘feel’ for doing it on the ‘proper’ board in the next few days after the new PICKIT3 arrives tomorrow. (…It will arrive.  Its FARNELL, after all…)

BUT, of course there is a slight problem.

In the course of the madess that was the other night, I’m sure I’ve corrupted the code that is currently running on that board.

SO, I’ll have to make sure I’ve got a working copy of that before I try anything fancy with new code.

Flickr photos

The latest photos are up HERE

SEO Powered By SEOPressor