A Model Lighthouse

Designed and built at the Sheffield Hackspace using an arduino and bits and pieces of things that you might find lying around in your own home…

Here’s the setup:

An arduino (pro mini) for controlling the SG-90 servo motor
An ESP8266 for wifi access and neopixel control
A piece of gutter and downpipe for the main body
A plastic dome sourced from a solar powered garden lamp
An Aldi’s peanut butter jam jar lid (crucial)
Other bits and bobs scrounged from various unwanted poundland items

If you think this is cool wait until you see the boats!

Making a kit knife

Since moving into the Portland Works in January 2015 I have had a desire to learn more about knife making. Obviously there is a long tradition of knife making in Sheffield generally, and more specifically at the Portland Works (https://www.sheffieldhackspace.org.uk/585) so it felt fitting to start exploring this new interest at the hackspace.

Fast forward 18 months and I’d still not made any progress but a few minutes spent in our neighbors workshop (http://stuartmitchellknives.com/) during one of the Portland Works open days inspired me further and I went home that day and ordered a piece of tool steel with the firm intention of getting moving. However life got in the way yet again and a temporary pause was once again placed on my project.

When I did finally think I had some quality time to spend on knife making I pulled out the piece of steel I had brought and looked at it. Something was nagging at me. Some advice I had been given was “Start small”. Great advice for any new endeavor of course, but more specifically I’d been advised to make a knife from a kit instead of a piece of steel. The reason being is that finishing a knife off, attaching and shaping the handles essentially, is quite a challenge in itself so the first time you do it it probably isn’t the best idea to attach them to a piece of steel you have spent hours working on and then mess it up!! Much better to learn your lessons on a blade you haven’t got so much time invested in.

I’m going to say right now that this is Part 1 of a 2 part blog, this detailing how to assemble the handle on a kit knife, the second part will be how to make the knife blade itself. Right. There, I’ve said it so I have committed to part 2 now. Anyway… On with the build.

The knife kit itself is pretty simple. You get a blade, two pieces of material for the handle (in my case olive wood), a couple of liners to go between the blade and the handle material (optional but can add strength and a nice visual contrast), two bolts for securing the handle to the blade and a metal tube for passing a lanyard through.

Once you have assembled all the parts you need for the build it’s time to get making! The first step is to drill the fixing holes for the bolts and the lanyard tube through the scales (handle material) and the liners (if using). These holes need to line up perfectly, and be at exactly 90 degrees, so I clamped the handle of the blade to both my wooden scale and the liner and then used the drill press to go through the existing hole in the blade handle (after measuring it of course). Once complete I attached the bolt through the hole I had just made to make sure that it couldn’t slip out of alignment as I drilled the next two holes, one for the second bolt and the other for the thong tube.

Before removing the bolts and clamps I marked the liner material around the edge of the blade, so I could cut it out on the bandsaw, making sure I also noted which side of the blade it belonged to. I then removed the bolts and clamp, removed the liner, then placed the bolts through the handle scale and blade again so I could mark up the wood for cutting. Once complete for one side I flipped the knife over and repeated the drilling / marking process again.

The next job was to roughly cut the handle shapes out. As I previously mentioned I used the bandsaw at the hackspace to do this but this could easily be done with any handsaw, or even files and wood rasps.

There are a number of different bolts / pins / fasteners that you can get to secure the scales onto the knife handle so this next step my not be necessary but I had to countersink the heads of my bolts into the handle so I used a larger drill bit (sized to the bolt head) to drill about halfway into the wood giving me a stepped hole. I actually hacked together a step drill bit to do this to give me a nice flat shelf at the base of the hole but just countersinking would work just fine.

At this stage the handle scales are almost ready to attach to the knife blade, however it will make life much easier to precisely finish the blade end of the scales first. Once attached to the knife it would be very difficult to get abrasives to the end of the scales without ruining the finish of the knife so this is best done now. To make sure the ends were symmetrical I attached them together using the bolts I had used earlier, and that will be used to eventually permanently attached the handle to the blade.  I used the belt sander in the hackspace to do the shaping, but again rasps, files and sandpaper would work fine.

Now its finally time to attach the scales to the knife. In addition to the bolts that connect the two halves of the scales a two-part epoxy is used to glue all the parts together. Due to the rather short working time of the epoxy, typically around five minutes, it is definitely best to dry fit all of the parts together to check for a good fit. Once you are happy everything will fit wrap the sharp part of the blade with masking tape, and then mix up the epoxy and attach the all parts together, ensuring that everything, including the bolts, gets a good coating of epoxy and then apply clamps (trying not to let the epoxy squeeze out get on the clamps or you’ll glue them to the knife as well!!). As I mentioned earlier the working time of the epoxy is approximately five minutes, but its advisable to leave the clamps on for at least 24 hours to ensure the epoxy is fully cured.

Once the epoxy is fully cured the clamps can be removed and the shaping of the handle can being. The first job is cut the bolts flush to the wood. You have to take care while doing this not to overheat the bolts as it can affect the strength of the epoxy, so I chose to cut these off with a hacksaw instead of grinding them off on the belt sander.

From there I used a wood rasp to remove the bulk of the material until I got close to the profile of the blade, then switched to files to get the wood closely profiled to the metal.

I then switched to the belt sander again to remove some of the width from the handle, rocking the blade left and right slightly to give it a curved profile for a nice feel in the hand. It is important to do this shaping over the metal platen on the belt sander as this will ensure that the metal bolts are ground away at the same rate as the soft wood on the handle.

To finish the handle I used small strips of sandpaper, starting at around 120 grit and then moving up to 400 grit, and pulled them around the handle until I had a nice smooth finish, paying close attention to the bolts making sure they were nicely polished.

The final step is then to add a finish to the handle, I chose boiled linseed oil which I applied with a cloth in several coats, rubbing off the excess between coats. The kit I purchased also included a leather sheath that I need to put together so I will include that in a blog post soon.

Make a hedgehog house for your garden

We’re getting toward hedgehogs’ hibernation season, so Sarah built a hedgehog house for her garden, and wrote up her process for others to follow. It’s a fun weekend project; if you make one, we’d love to hear about it. Of course, we have all the tools you need in the hackspace, for all members to use. Call in to one of our open sessions to take a look.

Use a hand saw to cut a 6” diameter pipe to min 30cm.  (Electric saws will melt, not cut the plastic.)  File the edge smooth.  This is the entrance tunnel that will prevent foxes/badgers etc fishing the hedgehogs out of the house.

Sarah's Hedgehog house 1

Balance a 30L storage box on the end of the pipe and draw around the end of the pipe with a marker pen.

Sarah's Hedgehog house 3Sarah's Hedgehog house 2





Use a dremel or similar on a slow setting  to cut out inside of the pen line.

Sarah's Hedgehog house 4

File smooth the inside and outside of the cut edge.   Use the marker pen to measure out 3cm points along both long sides, under the overhang.

Sarah's Hedgehog house 5

Drill ventilation holes through each pen mark on both sides.

Sarah's Hedgehog house 6Sarah's Hedgehog house 7






Unscrew the nut and remove the washers from the 90 bend pipe.  Place against the short end of the box, near the top edge and draw around the inside of the washer. Use a hole bit to drill out the same size hole as the pipe.  Put the washer on the pipe and nut.  Fasten the pipe to the box.

Sarah's Hedgehog house 8Sarah's Hedgehog house 9






Drill 6 drainage holes in the bottom of the box

Sarah's Hedgehog house 10

Push the large pipe into the big hole in the box.  Put the lid on.

Sarah's Hedgehog house 11

Locate the box in a quiet area of the garden, with the pipe pointing away from prevailing winds / the north / east.  Cover with leaves, but do not fill with anything.  Apparently, hedgehogs prefer to find their own bedding.  Make sure there are holes in your & your neighbours’ garden fence/hedge/wall/gate so they can get into your garden.  They will roam 1-2 kilometres a night looking for food so access is important.

One the box is installed, do not disturb.  Clean annually in early Oct with cleaner used for bird cages.

Sarah's Hedgehog house 12

Programming the ATtiny85 using an Arduino UNO

By Richard M Langner

This article describes how you can use an Arduino UNO to program a bare ATtiny85 micro-controller chip. I will show you how to program the ATtiny85 with the ‘Blink’ sketch. These are the steps –

  1. Connect the UNO to the ATtiny breadboard and connect the 10uF capacitor
  2. Configure the Arduino as an In-circuit Serial Programmer (ISP)
  3. Insert the ATtiny85 into the breadboard
  4. Configure the IDE for the ATtiny85
  5. Modify and upload the ‘blink’ sketch to the ATtiny85

1. Connect the UNO to the ATtiny85 breadboard and connect the 10uF capacitor
Connect the UNO to the breadboard as shown below. If you intended to keep the breadboard and UNO solely for programming, I recommend using an 8 pin socket for the ATtiny85 – this will ensure you insert the chip in the correct place each time on the breadboard.
Don’t insert the ATtiny85 in the socket yet – you must first configure the UNO to act as a programmer.

Pin connections:

  • ATtiny Pin 2 to Arduino Pin 13
  • ATtiny Pin 1 to Arduino Pin 12
  • ATtiny Pin 0 to Arduino Pin 11
  • ATtiny Reset Pin to Arduino Pin 10
  • ATtiny Pin 2 to 150Ω resistor, resistor to LED anode, LED cathode to GND (not shown here).
  • 10uF capacitor connects between GND (-) and RESET (+)

(Click on the images to get a clearer image.)

Uno as an ISP

2. Configure the Arduino as an In-circuit Serial Programmer (ISP)

Select the Arduino UNO board

and open the ISP sketch.

Next you should upload the ISP example to the UNO board. Ensure you have selected the correct COM port.

Congratulations! Your UNO is configured as a programmer.

You’re now ready to program the ATtiny85 with the ‘Blink’ sketch. You will need to connect an LED to display the blink. Connect a 150 Ohm resistor to the physical pin2 on the chip. The other end of the resistor should connect to the LED anode (its long leg), and the LED cathode connects to GND.

3. Insert the ATtiny85 into the breadboard

Remove the power by unplugging the USB cable. Taking care, insert the ATtiny chip into the breadboard socket the correct way around. Re-connect the USB cable.

4. Configure the IDE for the ATtiny85

Configure the IDE as follows –

  • Board  =  ATtiny85
  • Processor  =  ATtiny85
  • Clock speed  =  8MHz

2016-10-01_00037 2016-10-01_00038

Set the programmer ‘Arduino as ISP’

If the ATtiny85 is new, it will require the fuses to be set.  Among other things, fuses set the CPU speed. The fuses only need to be set once for each chip. To do this, select the ‘Burn bootloader’ option.


5. Modify and upload the ‘blink’ sketch to the ATtiny85

Open the example sketch ‘Blink’ and change the LED’s digital pin number to 3 on all the sketch lines (this is because the ATtiny85 does not have a pin13. Note that physical pin2 on the chip is digital pin3 on the ATtiny85). The code should look like this –

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin 3 as an output.
  pinMode(3, OUTPUT);

// the loop function runs over and over again forever
void loop() {
  digitalWrite(3, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);              // wait for a second
  digitalWrite(3, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);              // wait for a second

Finally upload the ‘Blink’ sketch to the ATtiny85.

That’s it! The blink program should now flash the LED.

The UNO is now set up as a programmer and so further ATtiny85 chips may be programmed by simply plugging them into the breadboard and uploading your code to them.

Richard Langner
With thanks to OJ for his help in defining the procedure.
This is my first post here, so please let me know if there is anything missing or incorrect.

Bookcase with clock stand

One of my own projects this time: a bookcase with an upright to hold a favourite clock. I didn’t want to drive nails into my (rented, plasterboard) walls and can always use extra shelf space, so I came up with this as a woodworking project. I’m a complete beginner at woodworking, so I learned a lot making this and had a lot of help from other hackspace members. It’s not perfect, but it does its job and I still have all my fingers so I’m calling it a success. At least, until I start work on version 2…

Want to learn some woodwork, or any of the other crafts and skills that our members get up to? Come along to your local hackspace!

A few recent snapshots

A few of the things we’ve been up to in the hackspace over the past week or two: Sewable arduinos (floras) and crochet, woodworking on the new lathe, silverwork on the jewellery bench, soldering up some electronics projects, painting the walls for our cellar expansion while planning the next builds, and lots of coding, writing and chatter.

Want to meet a friendly group of makers, whether to work on your own projects or as a beginner to learn new skills? Call in to one of our open sessions to see the workshop, say hi, and learn about how the group works.

At our latest Monday open session:

Lots going on at our latest open session: lasercutting shadowbox art, testing a pancake laser-engraving machine, making cosplay armour, and building a wireless arduino project. Got an idea? Make it with us! Come to one of our open sessions to see the workshop, chat, and join in!



Nixie clock prototype

Lasercut nixie clock prototype

This caught my eye at yesterday’s Open Hackspace session: Alex wired up the nixie clock he’s been prototyping, and got it mounted in a lasercut case. As good at it looks here, the phone camera doesn’t do it justice!

Other projects being worked on yesterday included a pedal-powered phone/GPS charger for an upcoming cycling holiday (which now works perfectly!), an improved bed for the lasercutter, some wooden shelf units, a network-controlled table lamp/sensor package, and the usual mix of teaching, swapping ideas, and terrible jokes.

What do you want to make? Turn up to one of our open sessions, or get in touch by email, and see what your local Hackspace can do for you!

Hacking De-bounce and Rotary Encoders

Prototype console interface for embedded projects

Prototype console interface for embedded projects

At the UK Makerfair during a brief lul the conversation turned to rotary encoders, simply as I had ordered a paw full from china for one of my many projects that simmer along in the background. The picture here shows the initial prototype that I used for this article. The feedback about rotary encoders that I received was that they were terrible and to be avoided. Principally as the switch contacts were very noisy and produced way too much bounce. I was still interested in using them firstly as having done embedded stuff for years bounce is something I consider trivial and fixable, secondly as they make a really cool, easy and feature full user interface using the minimum of pins.

De-bounce circuits

De-bounce circuits

The circuits I most commonly use for de-bouncing simple switch contacts are shown in the picture here. I ran this up in Kicad for the article. Something worthy of note is that Arduino’s and a number of other micro controllers have internal pull-ups that you could use. Do not use these when de-bouncing your inputs. They vary very widely in effective resistance value and the results will be massively variable when used with the same external components. Indeed a quick search of the internet shows a range of circuits and values mostly with a string of comments along the lines of someone found a different value or combination to work better. What is happening here, and why so much variability of what should be a trivial, bread and butter type, of interface circuit.

No de-bounce

No de-bounce

Time to dig out the Bitscope I bought from Pimoroni a while back and capture some waveforms. It will work as a capable enough DSO for this investigation. On the left is the A output of the rotary encoder from the previous picture set-up as a switch with pull-up as per the schematic above. The value of the pull-up resistor in this case is 10K Ohms a fairly typical pull-up value. The large nice square pulses are the outputs from the encoder and the very narrow horrible pulses are the switch noise and bounce. This looks reasonably what I would have expected although the switch looks to be more noisy than bouncy. I spun the input shaft quickly by hand to get enough pulses into shot and it is noticeable that the rubbish pulses produced are proportional to the speed of spin. The other thing that is noticeable is the duration of the pulse are quite short. With a standard press button you can not move your finger that quick and a de-bounce period in software of around 10mS is not uncommon. In this case though, if you did this it is clear that you would be missing a lot of steps from the encoder. Each one of those noise pulses is a full logic value in height and will trigger an interrupt, giving you a wildly incorrect count and wasting a whole shed full of precious processing cycles. I can see why you might think they were to be avoided if you had not de-bounced them in any way.

100nF De-bounce Capacitor

100nF De-bounce Capacitor

Adding a 100nF capacitor as per the above schematics produces the results below. This produces a very large reduction in the height of the noise pulses but they are still large enough to trigger some interrupts, the amount of processor time we waste though is reduced. The number of incorrect counts is also reduced but there are still some present. Also look at what is happening to the corner of the rising edge of the pulses that we want to work with. They are no longer square and are being rounded off. So a big improvement but still not as good as we would like. In a simple switch this rounding etc is not a problem. We are working with a rotary encoder though and the relative position of the edges in each channel is important to us. Where an edge curves too much it becomes unclear where the micro controllers input will decide it has switched from logic 0 to logic 1. If we got such a big improvement for adding in 100nF, will adding in some more be helpful?

200nF De-bounce capacitor

200nF De-bounce capacitor

So lets add in another 100nF capacitor in parallel across the one we put in last time. Taking the total up to 200nF. Yes the noise is reduced much further and we could probably work with that at a push. But look at the state of the rising edges. As we increase the capacitance we increase the loss of definition of the rising edge and consequently our ability to correctly resolve the direction of the encoder. The faster the encoder is turned the more problematic this becomes as the curve remains the same width but the width of the pulse we are relying on has become narrower. We could have kept the capacitance value the same but increased the resistance to say 20K and we would get exactly the same result. The RC network that is cleaning up our signal has a time constant that is proportional to the ratio of the resistance and capacitance that makes up the circuit. It is this time constant that is low pass filtering the pulses and giving us the effects we can see on the scope. Bearing this in mind if we check out the Atmel AVR data sheet, as this is the most popular micro-controller in the Arduino series, we see that the internal pull-ups have a value of between 20K and 50K. So a massive variation in the pull-up value and consequently a massive variation in the de-bounce action and on our pulse edges is produced by this, hence why de-bounce circuits that use the internal pull ups are to be avoided. We need results that are consistent.

For a simple press button a simple RC network as shown in the above works great as it is a very slow logic signal, but what can we do to recover nice square edges on our fast, encoder signal pulses, and get rid of the noise pulses. The answer is to use a Schmitt Trigger which increases the level at which a rising edge will be consider to have switched from low to high and reduces the level at which a falling edge will have switched from high to low. This circuit will ignore the noise pulses that we have reduced in height leaving us with a clean pulse train and nice square edges from our encoder. Check out the linked wikipedia article, ignore the over complicated mathy explanations and control theory waffle look closely at the wave form diagrams at the top right of their page. What is more this circuit is so useful that it comes already built in to a number of inexpensive logic gates. You don’t need to make one.

Unfortunately I don’t currently have the parts to hand to show the fully processed pulse train but the procedure is to add in a Schmitt Trigger logic gate (ie a 74LVT14 or similar)  as per the diagram above, pick the pull up resistor value for your chosen application 10K is good for most applications, looking at our scope waveforms you may want to go to somewhere conveniently around 20K. Then starting with a small capacitance for the de-bounce capacitor increase it until all your noise pulses on the output of the schmitt gate have gone. Using your scope to see when this happens. Once you have achieved this you know what the correct values are and can pick the nearest off the shelf value to use every time and get repeatable results. What’s more you will not be wasting any precious processor cycles on clever de-bounce code and unnecessary interrupts.

Take away points from this are:-

  • Do not use the internal pull-ups with de-bounce circuits it is a false economy.
  • Simple RC circuits are plenty good enough for simple push buttons and switches.
  • You need a logic gate with a schmitt trigger input to clean up the faster logic pulse trains from rotary encoders.
  • You can do a lot of electronics and get an intuitive grasp of what is happening by laying on a scope and laying off the math.
  • Clean up your signals before trying to code them clean, crap in equals crap out.
  • Rotary encoders are great if you know how to work with them.