Browsing Posts tagged low-voltage

Interrupts are go! 16/11/11

Just a few minutes ago, I soldered the last joint to a little ‘flying board’ I’ve built that connects into the original PIC programming board we bought all those months ago.

For reason known only to the Velleman designers, they’d put the main interrupt input pin as an LED output, but this hasn’t stopped me.  That link above takes you straight to the page of said programmer.

I unhooked the resistor feeding the little LED and connected one of the three flying leads (…the other two are +5 volts and ground…) so the new circuit was fully connected.

I then turned it on, and…

IT ONLY WORKED!

Shouts of disbelief as again and again I touched a wire across the two terminals and two LED tell-tales faithfully lit up twice to show me that yes, it had gone into the Interrupt Service Routine (ISR) and yes, it had taken notice and to prove it they lit.

Thankfully, I was fully dressed at the time, so couldn’t do the full “I’m Too Sexy For My Cat” dance routine, but this was probably for the best.  There were mothers and small children walking past, and I wouldn’t really have enjoyed explaining ISR’s and LED’s to our friends in blue ‘down the yard’.  Methinks they wouldn’t have quite understood the intricacies of it all.

So, the next step is to neaten up the code then build the first seven segment display board so when the bike wheel clicks, there’s a display you can refer to.

Of course, at first this will just be numbers that don’t actually mean anything, but very quickly -thanks to the math routines embedded within ‘C’- I’ll be able to make it display in Kilometers.

Then its the small matter of providing a speed output, but as that involves using the timers on the PIC, well, that’s for another day I feel.

In the meantime, the Wardian Household tonight is a happy place, and Heaven knows, we need all of those we can get right now.

More soon.

PIC-ing like crazy. 16/11/11

You may have wondered just what has happened to the much-trumpeted project of a few months ago; namely the Plot Power Project and the electric bikes we were getting all in a fizz about.

Well, Dear Reader, you can wonder no more!

Now the growing season has just about finished and the utter circus that was Allotment Soup is finally out of the way, along with those three major projects, I’ve gone back to the bikes with renewed vigour.

Well, I think its vigour, because once again its keeping me awake at nights.

‘So whats the latest??!!’ You scream.

Well, things have definitely moved on.

Whereas before we were using PIC assembler language (PIC ASM), now we’ve had to move on to ‘C’ for the PIC.

We’ve had to do this because the maths required has just leaped up a notch as we implement the distance traveled and mean speed functions.

For those not in the know, assembler is the real nuts-and-bolts, individual bits and bytes control; ‘C’ allows for more ‘English’ looking and reading code.

For those of a certain age, it looks and reads a little like the BASIC of old so favoured by the BBC B and ZX81 micros but with added refinements.

There were, of course problems with this.

Firstly, getting the ‘C’ compiler to bolt-in to the Microchip Integrated Development Environment (IDE) was a nightmare.

Then, there was the problem that Hi-Tec who produce the compiler have released virtually no how-to manuals, so you’re on your own!

Anyway, I’ll not bore you further dear reader until I have some pretty photos of it in the coming days.

Suffice to say, the other night, I got an LED to flash with a ‘C’ program, so now I just have to get the interrupts working, and we’re away.

So close, and yet so far…

 

The Environment Week Bash Poster.

Simply click once on the image above and select ‘Print’ to your printer, and you have your own poster to put up to display.

We hope to see you then!

A few quick calculations.

Ah, before you click away, we’re not asking you to do them!

No.  I’ve been doing some rough calculations on battery usage, and given that the bike wasn’t really used as much as it could be, and even then wasn’t really being ridden hard in a high gear, I reckon that for the riding that was done -about three quarters of an hour in total- that we ‘added’ another hours’-worth of life into the battery with the bicycle attached. continue reading…

Moving forward.

So, this last couple of weeks really has seen a massive jump forward with the power generation plans.

What had been just that -plans- have now come to fruition.  We can now generate our own power down on The Plots -despite the nights drawing in, meaning that for get-togethers and celebrations, we’ll no longer have to fumble about in the dark with battery-driven torches.

We can simply put the three gazebos up -a very simple job- while its still light, hook up the lamps where we want them and throw the switches.  Ta-Da!  Get cycling!

Last post I mentioned the future developments with the generators -the addition of displays to show time, distance and current speed of cycling.  Also requested is another display to show a read-out of just how many calories have been burned off.  Remembering my visits to various gyms over the years and their exercise cycles, I think our volunteers may be a little surprised -and depressed- at just how few calories are burned off during a session.

Still, onwards and upwards!

Adding simple displays to our bike system may sound easy, but after the hardware is constructed -pretty straight forward- the coding, well, there’s the rub.  The coding will be a ‘challenge’, to say the least!

With all that done, there’s just the job of the ‘iButtons’ so the system can store individual ‘profiles’ of various volunteers.  That really will be a toughie!

Still, if it was easy, it wouldn’t be so much fun!

Sunshine!

Well, the day dawns sunny and bright.  Checking the BBC weather website this morning shows that apart from maybe a little light rain later this afternoon, the day promises clear blue skies.  The temperature may not be up to much, but an extra layer of clothing or two and the promise of a leaf clamp to empty, and I’m sure we’ll not get too cold. continue reading…

Waiting for the paint.

Diane very kindly bought me some ‘proper’ paint the other day with which to paint the new box.

This came as cans of car spray paint -both primer and matt black -the kind used for bumpers and wheels.

Great stuff.  Easy to apply, but a bit of a swine because of the fumes!

I’ve set my kitchen up as a ‘spray booth’ (!!!), having both the windows wide open and the extractor fan on, but even so, when you walk in, a couple of deep breaths, and you’re off ‘playing with the pixies’.

Anyway, the beauty of this stuff is that it only takes minutes to dry, and the finish is really good -much, much better than that awful blackboard paint I had to use.

So, all this is in preparation for tomorrow night’s Bonfire Bash, which we’re all looking forward to.

Loads of great food, loads of good friends, and hopefully loads of light to see by!

Our new ‘Twisted Firestarter’, Barry will be lighting the fire at about 4.00pm, with food hopefully hot and ready to eat for about five-ish.

Hope to see you there!

Direct A – B testing.

2 comments

Sounds complicated, but its not really!

This Saturday marks ‘Bonfire Night’ where all Britain ‘celebrates’ the failure of the ‘Gunpowder Plot’ by Guy Fawkes and his motley crew to blow up the English Houses Of Parliament.

We’ll be ‘celebrating’ with a bonfire of our own and, more importantly, electric lighting.

For this Saturday, I had wanted to show another generator, this time with displays showing time cycled, distance travelled and speed of cycling, but on reflection, this would be a bad move.  Too much to do in too little time and therefore a recipe for certain disaster!

Instead, I’m going to show the first one again, and alongside it another box with everything identical apart from the electronics.  This box will simply be a battery box, connected to identical lights.

To do the test, I’m going to make sure that all the lights are switched on and off at the same time.  The following day, I’m going to check the levels of charge in each battery -the one that just had the lights on and the one with the charging circuit.  This will give me a direct comparison as to just how much charge was put back into the battery, and just as importantly, just how much was taken out by the lights being connected for so long.

So, I’m really sorry to disappoint, but as someone famous once said, ‘A man’s gotta know his limitations.’

Is that it?

Yesterday afternoon and evening, for me, went with a strange sense of anticlimax.

Nearly everything went according to plan!

Amazing and somewhat off-putting.  This is not how things normally go for a ‘Big Switch On’ on a Wardian project.

Things just worked.  Nothing blew up, there were no tell-tale plumes of blue smoke; there were no bad smells of burning silicon; there were no muffled ‘crumps‘ as something big and expensive died.

So, as the title today suggests, I’m sat here, with a slightly dazed feeling.

How could it all have gone so well?!

Yesterday, I got back from that meeting much later than planned -I’d been kept waiting for over an hour, and there were still a couple of soldering jobs to finish -I had to re-solder the 9-pin serial connector, the power switch and the programming switch so that it would all fit in the box.

Diane texted me saying she’d be round imminently, leaving me barely half an hour to finish it all off.

This was how a project ought to go!

But by the time she’d arrived, miraculously, I’d just about done.  While she made herself a cup of tea, I finished it off, screwed the lid down and switched it on.

Flashing lights, and briefly getting on the bike and pedaling to confirm the PWM was working, yes, it was.

Strange!

Diane took the box, the bike holder and the lights over to The Plots in her car while I cycled over.  This was fun, as the back tire is a ‘slick’ (…to reduce noise when pedaling…), and luckily the roads were quite dry.  Had there been any rain in the air, then I’d have been kissing the backside of a bus as the back tried to catch up with the front when I touched the rear brakes.

Claps and cheers as I arrived (…Thanks, Diane!..), and there were quite a few ‘Junior Plotters’ about.  I’d come down on my bike, was there any chance that the we were having a demonstration of the power project?  Yes, there was.

Initial shouts and cries of disbelief were quickly quelled as I explained that Diane had all the bits in her car.

So myself, Sara, John and Gary put up the three gazebos in an ‘L’ shape, then tie-wrapped the legs together where they met.  Junior Plotters were bouncing around, obviously keen for me to set up the bike, so I eventually gave in and set it up.

Then I had an idea.  The recent light frosts have meant that the nasturtiums on the mound have now mostly died back, but they’ve left their seeds.  You may recall that I pickled a jar’s-worth a few weeks ago, and I was keen to get some more for another pickling session.

So, I told the Plot Kids that I’d only let the taller ones have a go on the bike if they picked me enough nasturtium seeds.  Well, they set off as if possessed, eager to bring me as many of them as possible.  Kyle in particular was very anxious to ‘have a go’.

Is this enough?

Is this enough?

Here he is with the bowl.

After a cursory scout round myself; “You missed this one!  And this!”, I finally, ‘reluctantly’ gave in, and we all went over to the bike.

I switched it on, and yes, as Kyle had requested, they could see the blue LEDs!

I got on, started pedaling, and more lights came on -to show that the PWM was working and that charge was being put back in the battery.

The ‘Grown-Ups’ heard all the commotion and came over, and quite soon, quite a crowd had gathered.

Kyle cycling to keep the lights on.

Kyle cycling to keep the lights on.

We were also celebrating Chloe’s birthday, and various cakes and pastries had been brought to share, so we set them up under one of the gazebos, and here you can see the interest is pretty evenly split between the food on the table and the bike.

In the meantime, nearly everybody ‘had a go’, and here’s Gary doing his ten minutes-worth.

Go for it Gary!

Go for it Gary!

John and I had positioned the lights such that three of them were on the pillar where all three gazebos me in the elbow on the ‘L’ shape with the fourth light shining directly down on the bike itself.  Well, it was centre stage!

Also to note was that there were a couple of comments about the height of the saddle, and Diane in particular found it quite painful to be so low because she has problems with her left hip.  So, before the next ‘outing’, a quick-release adjuster for the height adjuster will be bought.

Another comment was the fact that the bike was positioned so it was ‘pointing uphill’ on the driveway.  This was to counteract the fact that the back wheel is slightly raised by the frame in which it sits, so it ended up being fairly level to ride, rather than feeling like you’re going downhill all the time.

All too soon it was going dark.

Now, on a ‘normal’ Plot Day -as much as one ever can be normal, we always treat the dusk with a ‘groan’ for it means that very soon we have to stop work, but yesterday, we couldn’t wait!

People had started to drift off, but there were just enough of us left to put down the gazebos and stow the equipment away ready for its first ‘official’ outing on Saturday for Halloween.

Control box and cables, lit as it goes dark.

Control box and cables, lit as it goes dark.

Here, you can see a final shot before we packed it all up with the plain black control box, surrounded by the lighting cables, bathed by the light of some of the spotlights.

A suggestion was made that for a future version.  I should make the top out of clear perspex so interested people could look inside.

Of course, people are ‘spoiled’ by ‘Star Trek’  and other sci-fi where there are lights behind all the panels, so if I do make a clear lid, I’ll have to make sure there are plenty of flashing tell-tales.

Of course, people will then ask what each LED represents, so I’ll have to get creative with the various functions inside.  Words like ‘plasma flow injectors’ and ‘wave-guides’ will have to be thought up.  ‘Manifold’ will have to come into is somewhere.

Oh, and there’ll be blue LEDs.

I promise.

Yesterday.

…Was utterly manic.

After I’d posted that last post, I carried on.  And on.  And on…

Diane, who’d got business around Sheffield with a meeting over the bees and many other jobs to do kept popping in to see the progress, and I think she was as amazed as I, when every time she came back and asked ‘How’s it going?’ the answer was ‘Fine!’.

Overnight, I’d painted the lid and touched up a few other places that needed it, so the case was just about dry to work on when I came to it.

So, amongst other jobs yesterday, I had to wire up all the lamps with all their power plugs, individual switches and long cables to connect them to the box.  This took forever, and I’d forgotten just how time-consuming and ball-aching wiring can be.

Then came work on the box itself as I wired up the power lead from the bike, then wired up the power outlet plugs and leads for the lights.

Then came the crunch time as I wired up the indicator LEDs on the new display board.

I then sprayed the board black -being careful to mask off the LEDs, then I masked off the top panel with coloured paper dots corresponding to where the LEDS were beneath.

A couple of coats of some excellent black spray Diane had bought, fifteen minutes drying time, then the little dots came off very very carefully with a scalpel to prevent damage to the surrounding still-tacky black paint.

Then I wired up the display board to the main processor board.

Then I wired up the ‘grunt electronics’ mounted on the box’s end cheeks to the processor board.

Then, after checking things though again, I said a quick prayer to whichever Gods may have been listening, and got on the bike.  And pedalled.

And lights lit, and there was definite resistance to my pedalling -meaning the PWM was working.

Well, I couldn’t quite believe it.  It had worked first time!

Anyway, I’d better get off -I have a meeting down in sunny Hillsborough this morning, then I have to come back and finally make sure everything’s ship-shape before Diane comes to pick me up with all the gear to take me down to The Plots.

Today is one of our ‘Junior Plotters’ birthday, and to celebrate we’ll be putting up a gazebo or two, wiring up the new lighting and singing ‘Happy Birthday’ to her this afternoon under the lights of our new, totally green power and lighting system!

Oh, and there’ll be cake as well.

Mmmmmm.  Cake…


SEO Powered By SEOPressor