Week 3 : Adding a microphone

We are thinking that we could take the experiment into the realms of “playback / record” by adding a mic to the set up.

We are thinking that we could take the experiment into the realms of “playback / record” by adding a mic to the set up. There are several types of microphones to choose from, Martin started to use a 3 pinned MAX4466 mic, Phil used a 5 pinned Ada Fruit MAX9814 . Martin succinctly states:

“A microphone produces an analogue signal whereas the Pico needs a digital signal to work with. The RP2040 processor has four ‘analogue to digital’ converters, three of which are available on the Pico. An analogue to digital converter, ADC, converts the analogue signal to a digital signal that can be read by the Pico. The Pico ADC’s are 12 bit, returns a value between 0 and 4095. However CircuitPython is written to work across a number of devices and returns a 16 bit value, 0 – 65535”.

With these ranges in mind, Phil wrote the code to convert the mic signal into a range that displays a circle using vectorIO with a variable radius. Previously using circuitPython’s “displayIO shapes“, Phil found that it was difficult to change the size of a circle “on the fly” once a shape object had been created with displayIO. One of the great features of vectorIO is that “radius” is a mutable attribute (the value can be changed “on the fly”), so with a screen of 240 x 240 pixels, Phil placed the circle object in the centre of the screen & converted the mic input range to 0-120 px. After experimentation of what the actual values were for his MAX9814 Mic, Phil discovered that the “minimum” (at rest) was around 24,000 and the peak value was around 36000.

The code below is a very handy “mapping” function in python, we use it all the time in projects to convert a value from one range to the corresponding value in another range!

def mapFromTo(v, oldMin, oldMax, newMin, newMax):
   #v = passed value (should be inside the oldMin/oldMax range!)
   newV = (v-oldMin)/(oldMax-oldMin)*(newMax-newMin)+newMin
   return newV

Download Martin’s Week 3 pdf here

You can also download the zip of all the files needed for this week’s experiment here.

Week 2 – making & adding a speaker!

We love a bit of sound! So, we’ve decided to add a speaker to the Pico set up…

We love a bit of sound! So, we’ve decided to add a speaker to the Pico set up… But with the added fun of trying to make one from scratch!Martin’s DIY Speaker

Martin used some re-cycled motors for the insulated copper wire for the guts of a DIY Speaker & has had success! (all be it quiet, but, this project is about testing, trying, proof of concept etc)…

DIY Speaker!

For the full documentation, & Step By Step Guide on how to make a speaker from a cup & some old motor / electronic parts, download “week 2” pdf sheets, with code & materials lists etc.Phil’s Set up uses a bought speaker & Ada Fruit Amplifier

Week 1 : Pico & OLEd + 2 buttons…

We started with a #raspberryPi #Pico & 240 x 240px OLED.

We started with a #raspberryPi #Pico & 240 x 240px OLED. Having worked with these as a base for the DinkyOSC we thought it would be a good place to start. We’ve added 2 buttons to the set up & control BMPs with adafruit_imageload & displayio . Below is a photo of the initial setup & we’ve included a PDF of the set up etc. here.

Raspberry Pi Pico + OLED screen / electronics buttons on prototyping breadboard.
Raspberry pi Pico + OLEd + Buttons + Breadboard

Pi Wars 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.

Below are some photos from the day.