Align holes in your project box without measuring – no special tools required.

In a previous post I described how to align holes without measuring. My original alignment tool was laser cut, but due to lockdown I’ve had to devise a simpler way to acheive the same accuracy using readily available materials – this time I use BluTac and an old milk carton.

Holes for the 3.5mm sockets are exactly in the right place.
Circuit board and project box
We can see where holes should be, but only from the inside.
Cut a piece out of an old plastic milk carton, to fit inside the box
Fold the plastic and add a thin layer of BluTac (other colours are available)
Press the plastic strip and BluTac onto the sockets to make an impression
Carefully remove the plastic strip
Position a bradawl in the centre of each hole and push through both layers of plastic
Holes punched through correctly
Re-attach the BluTac in EXACTLY the same impressions you made previously. Accuracy depends upon it.
Carefully insert the circuit board into the project box
Ensure the circuit board is in the correct postion, and press the strip onto outside of the box
Use the bradawl to mark the drill centres

Yes it’s just that simple. This method worked first time for me. If you are unsure, drill the -holes a bit smaller and file them out to be in the correct place. A 4 minute video of this process is here.

Check out my videos for accurately marking other types of hole without measuring –
USB-micro oval cut-out (as described in a previous post here)
Pin-hole (ideal for a recessed reset button)
Pinhole on the lid to show the recessed LED of Wemos D1-mini

Wemos D1 mini GPIO test board

Visualise Active Ports

Sometimes it’s useful to know the activity on the GPIO pins of your microcontroller. This little monitor board is designed specifically for the Wemos D1 mini and has a LED on each GPIO pin to help you visualise what is happening on inputs and outputs.

This monitor is quite useful for checking DC levels and slower pulses such as when controlling servos, relays, etc. For faster pusles it’s best to use a ‘scope or logic analyser.

Microcontroller boards other than the D1 mini can be accommodated by either re-designing the layout for the extra pins, or using extension leads to monitor those pins you are interested in.

LEDs can be disconnected by removing the jumper links, so as not to interfere with other functions. All LED series resistors deliberately have a high value to minimise loading the GPIO pins. The white LEDs drew less than 500 microamps each when used with a 1K series resistor, and they were still quite bright.

General view showing breakout header sockets, header pins, and jumpers.

The monitor can also act as a small breakout board, extending the Wemos header pins to 2 sockets and 2 pins per GPIO line. This can be handy when developing your project, as Dupont extension leads could be used to connect the monitor board to your PCB.

Wemos D1 mini and the breakout test board.

Construction is simple – besides the header pins and sockets, there are just a dozen SMD resistors and LEDs, mounted on a prototyping board. The underside of the board is where the connections were made, linking pins with single strands taken from a length of scrap multistrand wire.

Underside showng the link wires and SMD resistors.

The video shows the board with jumpers installed for all 9 GPIO ports (D0 to D8). Due to high value series resistors, the LEDs do not interfere with program uploading, and if you install the RX and TX jumpers you can watch the LEDs giving a satisfying twinkle with the upload activity.

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!

A wi-fi and touch controlled NeoPixel ring using the Wemos D1 Mini ESP8266 module.

This project describes an easy way to control a strip or ring of WS2812 LEDs via a web page. It was originally based on the Arduino FastLED library.

Although the FastLed library code gives us a great example of how to control NeoPixel rings and strips, it doesn’t provide for user interaction. So it was decided to add the ability to control the device by wi-fi, and also have a touch switch for local control.

Materials required
A Wemos D1 Mini module was used as it consisted of a low-cost ESP8266 wifi chip and antenna, and it can be programmed by the familiar Arduino software. The Wemos module sits in a socket which is soldered to a matrix circuit board. This allows the module to be swapped out if needed, and also makes it easier to connect the touch-switch and neopixel wires.

A touch switch module was chosen rather than a discrete push-switch as it can be hidden behind the acrylic case and should also provide more reliable switching. The 100 x100 x 25mm square case was laser cut from 3mm acrylic, and was designed using the makercase on-line designer. This is the quickest software for making simple boxes. An extra 100mm square piece was cut for the front, with two circular cuts to accommodate the neopixel ring so it can lie flush with the front surface. Later, the touch-switch hole was cut so the sensor sits behind only one thickness of acrylic.

Laser cut acrylic case

The components fitted easily inside the box – it has plenty of room for a battery pack if you wanted to make it totally portable.

The touch switch sits in a rectangular cut-out.
Here is a view before the centre cover is glued on.

Software overview. The project uses websockets so that any web browsers connected can control (and be controlled) by the device. The touch-switch also controls the software and the settings are communicated to all connected browsers via websockets in real time.

User settings are stored in an object, derived from the ‘userDataClass’. This object stores settings for the brightness, colour, active pattern, demo pattern, provides functions for brightness gamma correction, etc.

The touch-switch code decides whether the switch received a tap or long press. A tap changes the pattern and a long press increases/decreases the brightness. Debouncing the switch was achieved by using a 32 bit integer and bit-shifting each switch reading into it. This method has both the advantage of being able to check for a steady switch state, and to discriminate between a short or long press. A future article will explain exactly how this is done.

Here’s a video of it working.