We have some workshops coming up in January/February 2024 in the Aberdeen Art Gallery, thanks to our successful application to the “Creative Funding Programme” from Aberdeen City Council in the summer!
We’ll be running free “drop in” sessions, where you can find out about Microbit s & “break out boards” (adding more inputs & outputs) to make really cool interactive things…
And we’re also running some “inventor” workshops (£45 per person) – but you get to keep £45 worth of kit! (Micro:bits, Breakout boards, sensors, LEDs, wires, breadboards, electronics etc). – Some spaces are sponsored by SRCN Solutions – so if you need financial assistance & would love to come to the workshop, get in touch to secure a sponsored space.
Step By Step PDF of how to build a “Yes/No” custom buttons display with a Raspberry Pi Pico, 2 x Custom Made Buttons & 2x7segment 4 digit LED backbacks
We have uploaded a PDF of the steps to build a “Yes/No” Custom Button + LED Digit displays on a raspberry Pi Pico , with step by step guide on how to make the custom wooden buttons, and the easy implementation of the adafruit_ht16k33 library for the LED Backpacks.
You can also download the zip file of the code here.
Phil’s working on some interactive electronics for a project, and he was asked to create a counter that could show how much money you could make from 20p recycling deposits using CircuitPython & a Tiny2040
Phil’s working on some interactive electronics for a project, and he was asked to create a counter that could show how much money you could make from 20p recycling deposits. The counter + button in a #circuitPython was easy to implement (see other “weekly project” posts for a “how to”) – But playing an MP3 file has become incredibly easy with CircuitPython, having the library / code built in to the system! so no need to add a new library or even extra electronics to your CircuitPython Powered Board of Choice! (We’ve been using the Raspberry Pi #Pico & the Pimoroni #Tiny2040 )
Below is a short video of the Tiny2040 + button + mono speaker counting up when the counter value is sent to a function that converts it to a list of MP3’s to play.
Phil took a while to create an algorithm to create a “sentence” that stitches together the necessary files needed… using small MP3 files saved to the 8mb Tiny2040. The numbers 1 to 20 were recorded, then, 30, 40, 50, 60, 70, 80 & 90. Phil also created with a speech synthesiser, “pence”, “and”, “pound”, “pounds” – which can then create any number up to 999 (Thousands + were unnecessary at the moment!) When it reaches “£100” – a clip saying “you’ve made a lot of money, perhaps donate it to charity?” is spoken, then the counter resets !
The code below is Phil’s “Robust” programming… which works nicely, and can even cope with increments of 5p – but single counts break it (his “logic” should be improved – but the 5 / 10 / 20p increments work!
# SPDX-FileCopyrightText: 2020 Jeff Epler for Adafruit Industries
# Custom Code by Philip Thompson / Digital Maker CIC
# SPDX-License-Identifier: MIT
"""CircuitPython Essentials Audio Out MP3 """
import board
import digitalio
from time import sleep
from audiomp3 import MP3Decoder
try:
from audioio import AudioOut
except ImportError:
try:
from audiopwmio import PWMAudioOut as AudioOut
except ImportError:
pass # not always supported by every board!
button = digitalio.DigitalInOut(board.GP0)
button.switch_to_input(pull=digitalio.Pull.DOWN)
audio = AudioOut(board.A0)
# You have to specify some mp3 file when creating the decoder
mp3 = open("none.mp3", "rb")
decoder = MP3Decoder(mp3)
decoder.file = mp3
audio.play(decoder)
# calculate money from number stuff
def convertArrayToString(a):
return(' '.join(map(str, a)))
def last_digit(num):
if 10 < num < 20: # it's a teen!
return [str(num)+".mp3"]
else:
last_digit_unsigned = abs(num) % 10
return [str(num)+".mp3"] if last_digit_unsigned == 0 else [str(num)[0]+"0.mp3", "5.mp3"]
# used in making a sentence of the value of the number
ppp = ['pence.mp3']
lb = ['pound.mp3']
lbs = ['pounds.mp3']
def numToMoney(v):
if v < 20: # unique "quick returns"
return([(str(v)+".mp3")] + ppp)
elif (v > 9999): # no one will make this much money from recycling!?
return(["too_much.mp3"])
elif (15 < v < 100): # just pence
return(last_digit(v) + ppp)
else:
tupV = str(v)
if len(tupV) == 3:
if (tupV[0] == "1"):
lll = lb
else:
lll = lbs
if (tupV[1] + tupV[2] == "00"): # flat £
return([tupV[0]+".mp3"] + lll)
else:
if tupV[1] != "0": # not a "x pounds tens pence
return([tupV[0]+".mp3"] + lll + ["and.mp3"] + last_digit(int(tupV[1]+tupV[2]))+ppp)
else:
return([tupV[0]+".mp3"] + lll + ["and.mp3"] + ["5.mp3"] + ppp)
else:
if (tupV[1] + tupV[2] + tupV[3] == "000"): # flat £
return([tupV[0]+"0.mp3"] + lbs)
else: # complicated number x pounds y (z) pence
tA = tupV[0] + tupV[1]
tB = tupV[2] + tupV[3]
if (tB == "00"):
s = [tA+".mp3"] + lbs
elif (tB == "05"):
s = [tA+".mp3"] + lbs + ["and.mp3"] + ["5.mp3"] + ppp
else:
s = [tA+".mp3"] + lbs + ["and.mp3"] + last_digit(int(tB)) + ppp
return(s)
# res = arr[::-1] #reversing using list slicing
def money(n):
moneyArray = []
moneyArray.extend(numToMoney(n))
#print(moneyArray)
for w in moneyArray:
decoder.file = open(w, "rb")
audio.play(decoder)
#print("playing", w)
while audio.playing:
sleep(0.1)
counter = 0
while True:
while audio.playing:
pass
if button.value:
counter += 20
money(counter)
sleep(0.3)
if counter > 9999:
counter = 0
The Button is in Pin GP0 & the Speaker Signal Out is in pin A0 … you can’t get simpler! Amazing! MP3 files played with CircuitPython on a Tiny2040 – Done!
Phil is working away on the “Oop Tree” on the Pico, but is getting into “slow progress” with getting to grips with the implementation of how the tree will be affected by various inputs (water, food, light).
So as a “quick show n tell” – he’s put together a quick project using a #pimoroni #tiny2040 microcontroller, again, running the latest version of #circuitPython. Having found a box of old blown Valves (Beautiful objects!) Phil thought he would try to convert them into a useful light, using an RGB led, a button and a sliding potentiometer.
Phil did wire up a classic 4 legged RGB led & got it working, but had some very neat, single “NeoPixels” from Ada Fruit lying around, so soldered some pins onto one & used that, as instead of needing 3 separate pins to control the Red Green & Blue pins, you can do that all through one pin on the NeoPixel. There’s even a handy library to help ease the controls of changing the light colours / intensity.
First, Phil wired the push button into a digital pin (GP7) + Ground, then added a sliding potentiometer (you need 3 connections for this input, a constant 3v, a ground connection, then your “reading” (analogue) connection (A3)). Lastly, phil connected the 3 wires (5v, Gnd + A0) to the NeoPixel. Because you can “chain” NeoPixels, be sure to use the “in” side of the NeoPixel. Phil then drilled a hole into the base of the old Valve, he did this outside (well ventilated) and wore a mask, just in case there are any nasty old chemicals inside the housing or valve itself.
The full code for Phil’s RGB Led can be found here and a wee explanation below:
This project uses a single pushbutton to “cycle through” different states the NeoPixel uses. There is a Dictionary (Dict) that keeps information for LED levels (a “Base” RGB colour + “mix” (potential new levels to be added to the base colour). Each Dict Key is a string that should make the values obvious! The last setting is to make the slider decide what colour the RGB led should be…
Using a few functions Phil wrote for previous projects, you can now pass two tuples (r,g,b) and add them together to return the “mixed” (r,g,b) value – and apply it to the NeoPixel with the simple library method “pixels[0] = (r,g,b)” and “pixels.show()” (to update the NeoPixel).
The slider affects the possible “maximum mix” value by first converting its raw value (130 to 65000+) to 0 & what ever the current maximum value is for that “mix” (stored in the dictionary) this is done for each value (r, g, b). So when the slider is at “0” the maximum possible random number is between 0 & 0 (no new colour added to the base colour!) the higher the slider goes, the more randomness for each Red, Green, Blue “mix” value is possible… so the light starts to flicker within the range of the “base + mix” values…
The Slide setting uses a “wheel” method from Ada Fruit, and we “just” need to map the slide value (again from 130 to 65000+) to 0 & 255. When the slider is moved, it takes its position & passes an RGB value to the Neopixel to cycle from Green to Green over the spectrum. Nice.
Digital Maker CIC recently completed two 5-week driverless car workshops in Aberdeen. Northfield academy’s Science Club & Transition Extreme After School Club each had an exciting and challenging set of workshops for children aged 12+. Digital Maker CIC believes that these workshops are a “first” for the UK. Both projects were funded by Aberdeen City Council’s “U-decide” (participatory budgeting project).
The participants learned about Machine Learning, Engineering & design of the 1:16th scale cars, raspberry Pi terminal commands, to interface with the cars, computers & cloud computing interfaces and driving the remote-controlled cars.
Working in teams of four, the pupils were given tasks of constructing & managing their cars, “training” and improving their driving skills, as the better the car is driven, the better the Machine Learning model will be. The pupils could quickly train & then produce ML models (via cloud computing), giving exciting results, as the cars drove themselves around the 4m2 tracks we use. The pupils quickly learned that the better they drove the cars, the automated driving improved.
The teams also tried to add obstacles (orange cones) into the modelling, creating various results (success & failure), but, with more training & time, the pupils understood that their cars would “get better” with time.
We’d like to thank Northfield Academy & Transition Extreme Sports Ltd for their support & use of space, in order that we could run the workshops. We are working on extending the workshops to Aberdeenshire & eventually have a North East interschools competition for the Driverless Car technology.
If you’d like more information, or want your school to participate in this project, please do get in touch!
Digital Maker CIC had the privilege of being asked to run a robotics challenge workshop for the CDN (College Development Network Scotland) in Dundee & Angus College’s Gardyne campus on Friday 28th of September for over 20 College Lecturers.
Teams from all over Scotland joined us for a fun day, exploring, building & programming robots in order to compete in various challenges once the teams were ready. We gave each team a CamJam robotics kit with minimal worksheets / instructions and spent around 30 mins building the kits, using raspberry Pi Zeros & piTop Ceeds (to control / interface with the robot rover via 5 meter USB cable). the Edinburgh team took the initiative to make their rover wirelessly controlled, downloading & installing software through their own phone (extra points there!)
Once everyone had built & played with their rovers, controlling it via simple on-screen button & programmable interfaces (Custom Adapted Blockly by Digital Maker CIC), we then added a line detection sensor, giving the participants experience in electronics & GPIO use on the Pi Zero. The challenge was to create a line following algorithm using only 1 sensor & the Blockly interface, to get the team’s rover around a line path in the quickest time. There were a lot of different approaches, using repeat loops, “if statements” and more. One of the most elegant solutions was a simple algorithm by West Lothian College.
All teams produced line following algorithms with varying degrees of success, but, all teams were resilient & spent time honing their algorithms, trying various tweaks & fixes based on their observations, critical thinking & experimentation, which was great to see. The fastest line follower was under 1 minute, the longest (complete circuit) was just under 3 minutes.
Some teams managed to start exploring adding an ultrasonic distance sensor (HC SR04) to tackle the minimal maze we had brought along too, but, time had got the better of us, and after 6 hours of playing, experimenting, trying and learning, time was up!
We’d like to thank Kenji Lamb for organising the event & asking Digital Maker CIC to facilitate the workshop. We are planning to run a 2nd CDN Robotics CPD challenge with Kenji in 2019… so if you are interested, or want more information, please do get in touch!
We were asked by the College Development Network to put on a robotics workshop for their CPD provision, so we gladly said YES!
Here’s a link to the course in Dundee & Angus College. They have kindly agreed to host the event at their Gardyne campus, and CDN are looking for college staff keen to exercise their engineering, programming and design skills on the 28th of September.
Digital Maker’s Martin & Phil rolled out the first class of the five week Driverless Car workshop in Northfield Academy yesterday, with 20 pupils ranging from S1 – S6.
An introduction to the areas covered & straight onto building the 1/16th scale cars that are used with the Raspberry Pi & Camera. Everyone was fantastic, really productive, inquisitive, collaborative, it was a real pleasure to work with the Pupils. Also a special mention to science teacher, Mr Hunter, his help & assistance during the 2 hour class was brilliant, thank you so much for a great start to what we hope is a very rewarding & challenging class, which we believe is a first for Aberdeen, and Scotland!
On the 26th of May, Digital-Maker CIC ran a full day event in the University of Strathclyde for families & robotics enthusiasts.
Having been given the blessing of Pi-Wars (thanks Michael Horne & Tim Richardson!) (and a logo!) We put out the call for teams to join us in a friendly competition, using various courses & obstacles. Our entrants mostly consisted of families with little or no experience of making & running robots. We were also honoured to have Danila Deliya join us from London with his amazing robots.
We set up our pi-top Ceed units & obstacle courses, helped by our fantastic volunteers, Kerry Kidd (@RaspiKidd) and Alec-Angus Macdonald (@alecangus). We were then joined at 10am by our participants. Primary School kids, teenagers, mums & dads full of excitement & trepidation, all saying this was the first time they had done something like this…
Martin gave a short intro to the day, what we (Digital Maker CIC) do & got straight into building CamJam EduKit 3 robotics kits we handed out. The teams worked at their own pace & constructed their 2 wheel robots, working from worksheets. Once built, the teams started to test the driving functions they had programmed in Python 3, moving on to adding sensors (line following & ultrasonic “distance sensors”). The rest of the day was filled with testing, coding, testing, more coding, testing and a little bit of fun competition with the worlds most robust balloons. (for the jousting challenge).
The line following course was a hit with a family that had been struggling with a previous course that was too reflective & our set up was prefect, and after some tweaking, their beautiful bot made full circuits around the course.
The “minimal maze” was also a great hit with some of the families with younger kids, as creating & honing an algorithm using our customised Blockly Interface , making them think about distance, time, directions, with exciting & satisfying results.
We thoroughly enjoyed our first adventure in setting up & running a robotics event in Scotland. The feedback we received from the participants was very encouraging. We were told the event was fun, engaging, welcoming & not intimidating at all, sounds like a lot of “growth mindsets” in the house!
We’ll be running a Pi Wars Scotland again next year, having learned a lot this year, we’ll be more visual & confident with the next one, so, eyes peeled for news & application forms.
Thank to everyone that joined us on Saturday 26th May, we couldn’t have done it without you! and, you really helped us with your positive vibes & relaxed approach to all we offered.
Digital Maker CIC have started their 7 week course “Journey to Mars” in Riverbank Primary, Aberdeen.
We have previously run this workshop in St Peter’s, Woodside & Seaton Primary Schools, where pupils get hand on experience of electronics, computer programming, team work, design & engineering tasks, as well as experiencing critical & creative thinking, growth mindset, communication & problem solving.
The 7 weeks consist of, “scene setting”, where we discuss space travel, Scottish geography, NASA Mars exploration history, the solar system & anything the pupils bring up when shown the videos & images we bring. We then build a working Rover, working with CamJam robotics kits & laser cut PTFE chassis, the pupils have to construct & wire their robots from illustrations & trial & error. We love this task, as we see a lot of “Growth Mindset” creeping in, it always starts with “this is too difficult” to “yeah! look at our finished robot!”… emphasis on “trying” and making mistakes is key to our teaching philosophy. A lot of knowledge transfer can come form this task too, where pupils that complete the task early, ask to help others & show pitfalls & tips to complete their robots.
The following weeks, we design & build garages / habitats for our rovers from cardboard & MakeDo construction kits. We then explore making a simple program in a customised Blockly environment on the Raspberry PI to control the robot from a set start point to drive into the base, creating a repeatable algorithm. We learn about coordinates & instructions & what an algorithm is & does.
We then start introducing sensors & electronics to the kit, a line follower, an LED, a distance sensor… with around 4 weeks of deep learning & play / experimentation in using electronics & computer coding to control robotic tasks.
We have learned a lot ourselves when teaching this workshop & would like to thank all the schools that have had us so far, it’s really rewarding to see pupils surprising themselves with what they are capable of & enjoying challenging tasks.