February 28, 2018

Electronics for Performing Engineering Operations

This is a NVQ course (7582), covering a wide range of topics.

I’m disappointed by the amount and quality of supporting material (a book published in 2012 – Grimwood, will be a little dated by now even if it was current when published). Courses are using circuit examples based on NE555 and 7805 type voltage regulators – These are 45 year old components and do not provide a good starting point for students entering the workforce in 2020.

The posts here are not answers to assessment questions, but provide background information which will help you with the assessments.

Please provide your feedback on the topics which you would like to see discussed and explained in more detail.

I’ve worked in designing prototype electronics (mainly radio-frequency circuits), including small production runs of up to 500 units for evaluation. I’m familiar with both the design, and manual/automated assembly and test. More recently, I’ve been working in ASIC/Integrated circuit design.

Comments (0)

December 29, 2016

Microbit Neopixel Christmas Tree

OK, so you’ve got your micro:bit RGB christmas tree from Andrew Gale’s kickstarter project. Its all soldered up ready to go as per his instructions but you’re not quite sure how to proceed.

First, use some croc-clip wires to connect the pads on the christmas tree to the pads with holes on the micro:bit edge connector. It is important to get the order right, and to avoid connecting also to the small pads between the main pads on the micro:bit. It doesn’t matter which colours you use, but normally 3V would be red, and 0V would be black.

  • Pin 0 to SOUND
  • Pin 2 to LED
  • 3V to 3V
  • GND to GND

Now you need some software. For a quick-start take this file directly from GitHub. Right click here and save-as (the file should be called tree.hex). Now plug your micro:bit into your PC, and copy the hex file to what looks like a flash storage device on your micro:bit. The yellow light should flash on the micro:bit as the file is transferred, this will take a couple of seconds. Now the program will start, and although the micro:bit display remains blank, the tree will have sound and light.

You can see the program (which is written in python) here on GitHub. We import both the neopixel module and the music module. These add extra functionality to the basic micro:bit, and they’re described here.

First, we initialise a neopixel on pin 2. This can drive several of the intelligent LEDs. They work in series over a single wire, and can be set to light each of Red, Green and Blue to different brightness. I am using 155 for each colour in turn which is a moderate brighness (255 is really too bright to look at safely).

Before starting to light the LEDs, we play the NYAN theme (non-blocking, so the program continues to run whilst the tune plays in the background).

We then cycle through all 5 LEDs and all 3 primary colours. Then we change the tune, and repeat.

Comments (0)

October 29, 2016

Data Logging with a microbit

Here is an example of how the BBC micro:bit can be used as a data logger. I was specifically interested in capturing the voltage of a LiPo battery as it discharged into a fixed load (so I could determine the capacity). I’ve also made a video of how this arrangement can be used to monitor the voltage on a supercap as it charges and discharges in a circuit.

Test Setup

The microbit has 6 inputs which can be used as Analogue to Digital inputs, including pins[0..2]. These sample voltages from 0V to 3.3V, returning the results as an integer from 0 to 1023. It is important that the inputs are not taken above the supply rail (as discussed on Electronics stack-exchange here) so I have used a series resistor (6k8 Ω, since that was the first I found). I use a 10k Ω potentiometer to adjust the full-scale reading to the maximum voltage that I need at any particular time.

Data Logger circuit

The source code can be found on github. There are two python scripts, one for the microbit which takes readings and sends them over the USB serial port when either the voltage changes or a couple of minutes passes. This is a trade-off between generating lots of data and capturing fast moving events. I have one LED flashing rapidly to give me some confidence that it’s not crashed and two set up to show a voltage readout as two analogue indicators.

On a windows PC (provided you have the mbed serial port driver) it should be easy enough to use a serial terminal application to save the data to a file. Since I’m using Windows 10 and the serial drivers are not always reliable, I use crouton on my chromebook (an Ubuntu chroot environment) where I can run python. Running the simple_log.py (as root) will guess the port name, dump the data to a file and copy it to the screen.

Here is a graph of the data captured in the video.

SuperCap charge profile

 

The charge phase is very rapid and it also shows that after running for a few minutes the unit seems to turn off (and the voltage stabilises again). This shows how it can sometimes be useful to monitor a circuit for minutes or hours to catch interesting events.

The noise on the plot is an artifact of my sampling algorithm, which captures positive peaks in noise, but tends to avoid negative noise peaks.  If I was using this again, I might re-think that sampling strategy.

 

Comments (0)