Friday, December 16, 2022

Vector cut lines from scanned images

'Tis the season and it's another round of ornament making with the laser cutter.  This year's edition features custom names of recipients cutout and placed in a wintery scene filled with reindeer antlers, snowflakes and trees. Those decorations look nice but are practically there to hold the name since it spans across 3" of empty space.



I made the ornamental shape pretty quickly in Illustrator with a few circle. The snowflake, trees and antlers were all royalty-free vector shapes that I further manipulated through stacking. I liberally used the Pathfinder > Unite tool to combine vector lines to create continuous cut lines so nothing fell off.

Adding the names was a straightforward process beginning with selection of font. I went over to Fontsquirrel and chose a few script fonts that had connected letters. This was important so I didn't have to manually create connection points for letters that weren't connected to anything. Great Vibes, Allura and Hello Almeida worked for me but I had to test them each since each name had different amounts of ascenders and descenders that would obscure their shape.

I manually adjusted the size and the shape as little as possible using Selection then Type > Create Outlines. This let me enlarge the actual text shape (Object > Path > Offset Path) since I was concerned certain thinner letters would be too fragile with the 1/8" ply I was using. Pathfinder > Unite finalized the outline shape and I resized further to fit. Then, select the name and the inner ring shape and use Pathfinder > Minus Front to create a compound shape. If too much is subtracted try rearranging the stacked layers so the name is on top.


Each ornament only took around 3 minutes to cut which was quite the time savings from last year's elaborate multi-layered bottle holder ornament. However, while I was working on the ornaments I realized I needed an activity for my Takeaway Makeaway club in the Makerspace. Since the laser cutter was already on I gave them some scrap paper and sharpies and had them design takeaway medallions.

Once they finished their drawings I sent them through our scanner via document feeder which handily sends me a PDF of scanned images. I copied a pic and dropped it into Illustrator. Since each image had a unique shape I needed to create custom cut lines quickly for each image. I used Image Trace (usually Black and White logo since they were monocolour) and expanded the selection to create editable vectors. I left the image on an Engrave layer and held down the Option key while dragging to create a copy of the image on a Cut layer.

I locked the Engrave layer and used Pathfinder > Unite to find the outside and then Offset Path to make a larger outline. This is the same method I would use to create cutout stickers using the Cricut though I think their proprietary software may do this as well. I exported the Engrave and Cut layers separately to avoid any duplication of lines and had a quick takeaway done in an hour or so!

Wednesday, November 23, 2022

littleBits and some hot air

I recently dished out some littleBits for a lunchtime Takeaway Makeaway. It's a great club activity, especially when coupled with challenge cards that students can work independently on. The first few are always quite simple, getting them used to what bits they have available to them, and then progressing further up with multiple ways to solve a problem.
I noticed that one of the bits had some scotch tape on it and looking closer at it I saw one of the SMDs had fallen off and I had taped it to the bit so I didn't lose it. Rather than crudely soldering it back on I thought it was the perfect opportunity to try hot air soldering using a hot air rework station. The pads looked okay and there was actually enough room to solder it but here was an opportunity to try something new!
The "before" pic with lonely capacitor fallen off.


I had actually done some research on hot air stations a while back and have the Hakko FR-810B wishlisted but it's a tad pricey (well over $1000 CAD!). Cheaper options exist, such as this Toolour version that was recommended to me. Once I started looking into it a bit more I saw a basic version that seemed to be clones of a model labelled 858D. I don't know if it started out as a commercial product or just a generic clone, but it's a pretty simple device. It has a ceramic heating element in a handheld wand, with fan control and an adjustable digital readout of temperature.
Note the temperature reading with the wand in holder. Does this mean there's no standby mode and is continuously heating?

These type of heating stations can handle 400-1000 watts so it made sense to open it up before plugging it in to check some basic safety features. The 858D clones have a history of mismatched PCB designs, mis-coloured wires and questionable grounding. There were four areas to review:

#1: Check continuity of power plug
Put your multimeter in continuity mode and do a check of the power cord. This is a component that is mass-produced and used in many different electronics so it's probably not specifically made for the high loads of hot air. Check that the hot, neutral and ground wires are properly labelled (if applicable) on the plug and are not shorted against each other. Do the same for the power input plug.

#2: Check hot/neutral wires
Wire colours are important to regulate since they carry live electricity and workers may get sloppy if they do not have a load checker on hand. This doesn't mean it's a foolproof system, you should always double-check but it's a good start along with rules of thumb like "one hand in the pocket" rule that says to work one-handed so any potential shock does not across your body. In North America hot wires are black, sometimes red, blue or brown, neutral is white, sometimes grey, and ground wires green. Luckily my 858D had correct colours which I double-checked led to the correct inputs and outputs. Also check that the hot wire is leading to the switch and not the neutral; if it leads directly to the board it can still charge it even if it's switched off.

#3: Check fuses
Fuses are hit and miss since they're being shipped in a variety of conditions. I've received broken fuses, missing fuses, and mismatched fuses. My 858D had the fuse located in the power input plug, and it was correctly laid across the hot wire. Other 858Ds have a separate physical fuse so make sure it's wired correctly.

#4: Check grounding
Grounding adds a layer of safety by providing an alternate method of discharge to the ground instead of through you. Check the path of ground using continuity from each grounding point on the PCB, transformer, and case through the power plug. My 858D case was powder-coated so I had doubts about the continuity through the screws. I filed through the paint on numerous screw points and the mounting screw of the ground wire since it was attached to a standoff from the case. I also checked that the transformer legs were making good contact with the case in case there was a short. All-in-all it was a reasonably well-built device and there wasn't too much work I needed to do, just a lot of double-checking.


Pulsing like a heartbeat


So now it was finally time to power everything up! The capacitor was big enough that I didn't need a microscope so I freehanded it. I tinned the pads with leaded solder because it's what I had though lead-free solder may have a lower melting temperature reducing potential damage. I then applied liberal amounts of flux and set the hot air to 250C. I opted for the smallest nozzle, maybe about 8mm wide, since the littleBit was so small. I started the fan speed really low just to warm up the whole bit so there wouldn't be any thermal shock.
After that it was pretty uneventful...until I discovered what makes littleBits so awesome. The magnets! A wrong nudge one way or the fan blowing a certain angle and the capacitor flew off sticking to the magnetic side. I had to hold it down with tweezers until the surface tension of the molten solder affixed the capacitor enough to the surface. Once done I noticed I had melted the plastic housing a bit but thankfully the mount and the magnets still work.


Thursday, October 13, 2022

Upgrading old iMacs

One of the nice things about the Apple ecosystem is that things really work well when you're current. One of the terrible things about the Apple ecosystem is that if you fall off the supported systems list you're left to wither, stumbling around closed-source code and proprietary hardware with no available parts. 

Our move to student BYOD was almost a decade ago which means we have some old computer lab hardware laying around such as late-2013 21.5" iMacs. If memory serves, they shipped with Mountain Lion which I think was the last OS X that Apple charged to upgrade. Mavericks was released shortly after we acquired the iMacs and the free upgrade was a nice touch. We opted for the wireless Magic Keyboard and Mouse, deciding to go all-in on the sleek aesthetics. It could have been interference, somebody microwaving their lunch, or our cinder block construction, but having 25 pairs of wireless devices in one room wrecked havoc on connections. Countless hours were wasted reconnecting devices and preventing peripherals from connecting to other iMacs.

As time goes on I'm going more and more portable. My current workflow involves a 13" Macbook and an iPad, but I have two external displays when I'm at my desk. (side note: at the time of me writing this Apple has dropped the term "notebook" and has adopted "laptop.") I still think there's a place for desktop computers, specifically permanent workstations/kiosks or terminals requiring a consistent setup, e.g. server monitors or readouts. Then there's the practicality of having a larger display. I think we're all waiting for the final merge of iPad and iMac by having a shell of a desktop with just a keyboard and mouse and you just slide in an iPad to "dock" it.

I guess this is a long way to say I haven't gotten rid of any old iMacs yet. So after yet another Makerspace reorganization I plugged one in, resynced to Meraki and Apple School Manager and ran all the updates. It took the better part of a day just because of how slow everything was running. It was on Catalina and just needed a big macOS update and some app updates but it was running ok. I then decided to compare it's lacklustre performance to a fresh install of Catalina. While it was installing I tried to upgrade to Monterey but realized it had dropped support to these iMacs, even though they were still Intel-based.

Thankfully, OpenCore allows patching of the bootloader to allow macOS installs on non-native hardware. It was a straightforward process to create a USB boot disk with Monterey get it up and running. OpenCore even detects that it's booting from USB and offers to load it into the HD!


So far Monterey seems slightly faster than a clean install of Catalina. But it still wasn't fast enough so I decided to swap in a $20 SSD and 16GBs RAM -- the RAM was double the cost of the SSD! Getting into the iMac was quite the chore. iFixIt had a nice teardown along with colour-coded screw placement which helped immensely in the rebuild. Some notes:

  • using a utility knife with max 3/8" blade length worked well for cutting display adhesive
  • cable connections are very fragile! I may have broken off an antenna connector
  • the logic board can be screwed in but still offset enough to have the ports not-aligned with the rear cutouts. Triple check all plugs are usable before closing it up
  • RAM may be replaceable without removing the logic board but you'll need to be agile enough to release the locking lever by touch alone
  • adhesive strips can be found cheap on Aliexpress


I haven't reattached the display with the adhesive strips yet and am relying on the Alien Tape-like holding power of dollar store painters tape. So far so good, but as expected there's only been a bump in SSD stats with negligible difference in RAM or CPU usage for now.
 



Coincidentally this week Oracle released version 7 of Virtualbox. I use it to run virtual machine instances of Windows and Linux on our Macs. They let me quickly run some legacy Windows software like our digital signage program and laser cutter software. For redundancy I rely on two machines: one running Virtualbox and one dual-booting using Bootcamp. Both work great and have their specific use cases. Anecdotally, the SSD is much faster in Virtualbox.











Friday, September 23, 2022

Managed Apple IDs and User Enrollment

A while back I posted some issues we were having with distributing apps to our Bring Your Own iPad students. The tl;dr is our school would purchase a few apps using our volume discount and then distribute the redemption codes to families. They would redeem the code in the app store and the app would download and they could retain ownership and responsibility to keep it updated.

The migration to Apple School Manager has sunsetted the use of redemption codes and relies entirely on ASM and MDMs to manage devices and users. This presented a logistical problem for us since we want a no-touch policy on BYOD to enforce an air gap from any of our internal networks.

Apple has started up a new online education community that includes teacher education, the Apple Teacher and Coach programs, and also a new forum. This form is interesting because it's education-focussed which hopefully reduces the amount of useless help or rhetoric posted on more public or generic technical forums.

I posted my issue to the Deployment forum and was suggested to look at User Enrollment. The use of federated authentication would play well with our current sync of AD and Google. We do not provide students with their login until Grade 4 though which would make for interesting management in the younger years. I suppose we could provide a simple password for first login then reset all passwords, but this may interrupt app updates down the road.

The siloing of personal data away from corporate data is a great feature and is a hallmark of Apple's push for privacy. Having separate volumes emphasizes the separation of data and how ti cannot be accessed.

I've started testing it with a few user accounts and am hoping for good news for next September!



Wednesday, August 31, 2022

Right to Repair

I try to disconnect from work and social media as much as possible over the summer but like any educator I get bursts of inspiration even on vacation. A long time ago I would collect old electronics, toys and computers for students to dissect. It's pretty satisfying to see kids tearing down devices using hand tools. Some would go to town destructively while others would methodically organize screws or parts. Most kids wanted to diagnose faults and/or combine parts to create frankenstein machines.

I have written previously about the advantages of understanding how things work by taking them apart. Destructive testing and reverse engineering are fantastic skillsets for curious makers that I try my best to foster in my spaces.

Unfortunately, some devices are designed to non-repairable. Companies may wish to protect intellectual property, save money by not supporting repair divisions, encourage planned obsolescence or maintain market capitalization by forcing participation in one ecosystem. Look over to iFixIt for a nice summary of Right to Repair.


This issue came up over summer when my electric toothbrush started acting erratically. It's an unnerving feeling when you get woken up at 3am by a strange buzzing from inside the house. Thankfully this was my second-go-round in dealing with faulty toothbrushes so I clued into the location pretty quick. 

There is already quite the library of resources online interpreting error codes and beeps, teardown steps, and suggested fixes. Most suggestions seem to be replacing the low-cycle factory battery. What I can offer is a few tips that saved me a bit of the time the second time around.

First, opening the devices and removing the board is probably the hardest part. For my Oral-B brush I found using channel lock pliers with a cloth wrapped around the base worked well since the base extended up the sides a bit. I also used the charging base once but I wouldn't really recommend it since it doesn't offer much friction fitting and there's the chance you'll have a broken charger and toothbrush.

My newer Philips brush had base plate that was flush with the bottom of the case making it impossible to use a gripping appliance. I found screwing a bolt with coarse threads into the bottom then pulling it straight out with pliers worked well. The first time around I wrapped some soft tissue around the threads to reduce the tapping in the soft plastic base. You may have to find a bolt width that works for your model, I think mine was around 1/4" or 5/16".

Take care to not break any locking tabs when you slide the board out. The Oral-B board was more difficult to take since you need to finesse motor threads and battery tabs out of the way. Once removed, liberally apply 99% isopropyl alcohol to degrease and expel any moisture. Inspect for any other kind of residue and corrosion. I was lucky that mine didn't have any physical damage, though there was a lot of residue and it was clear water had infiltrated the case.

Removing the batteries was straightforward, just take care to avoiding nicking any wires and be sure to note polarity and tab orientation. I was able to replace my Oral-B with a standard AA NiMH Eneloop but my Philips used a LC18650 3.7v li-ion. If you're soldering tabs onto the batteries make sure to use a wide solder tip to reduce the time you're applying heat. I find the negative terminal harder to solder because of the larger surface area.


This all seems like an awful lot of work for a toothbrush but I think it's an awful waste of work designing a product that a) isn't waterproof for a wet environment and b) isn't user-serviceable to replace a part that has a high failure rate.

Monday, March 28, 2022

Introducing Python with Astro Pi: Mission Zero


Astro Pi is a yearly Python coding challenge offered by the European Space Agency. It challenges students to write a simple Python program that will be run in space on the International Space Station.

It has been run since the first Raspberry Pi computers were sent to the International Space Station in 2015. It's open to European countries and, thankfully, Canada, a total of 25 participating countries. Last year we had 18 teams enter and they all received a nice certificate that had their team name and a map showing where the ISS was flying when their code ran:

As you can imagine there's lots of excitement that their program will not only be run in space, but astronauts may see their message! There are lots of jokes and alien greetings, but there are some minimal requirements:
  • the Python code must run with no errors
  • a humidity reading must be taken and displayed (using SenseHAT)
  • programs are cut off at 30-seconds runtime
Astro Pi uses Trinket.io, an online IDE with a Raspberry Pi and SenseHAT emulator so students can experiment and test their code in one convenient location. Trinket is also iPad and mobile compatible.


The Sense HAT module is quite limited in its scope (you can see the API calls here) but probably most students will be interested in drawing or animating pictures using the 8x8 LEDs. The simplest method would be to colour each individual pixel using a list:
picture = [
   g, b, b, b, b, b, b, g,
   b, g, g, g, g, g, g, b,
   b, g, b, b, g, w, g, g,
   b, g, b, b, g, g, g, g,
   b, g, g, g, s, s, g, g,
   b, g, r, g, g, g, g, g,
   b, g, g, g, g, g, g, b,
   g, b, b, b, b, b, b, g
   ]
This is incredibly tedious, though a spreadsheet with conditional formatting may help students conceptualize their drawings. Even using a pixel art program like pixilart.com with a canvas size of 8x8 would be easier.

Animations would be the next step up for students. Simple code to advance each colour to draw line by line:
r = (255, 0, 0)     # red
o = (255, 127, 0)   # orange
y = (255, 255, 0)   # yellow
g = (0, 255, 0)     # green
b = (0, 0, 255)   # blue
i = (75, 0, 130)     # indigo
v = (148, 0, 211)   # violet
w =(255, 255, 255)  # white
k = (0, 0, 0)       # black

rainbow = [r, o, y, g, b, i, v, w]


while True:
  for y in range(8):
      colour = rainbow[y]
      for x in range(8):
          sense.set_pixel(x, y, colour)
      sleep(0.25)
  for x in range(8):
      colour = rainbow[x]
      for y in range(8):
          sense.set_pixel(x, y, colour)
      sleep(0.25)
  sense.clear()


Monday, February 14, 2022

Wordle with Numbers (Part 2)

 In a previous post I explained how to use conditional highlighting in Numbers to make a Wordle-like game. It's simple enough for middle school students to create and have fun on their own and leaves open lots of extension opportunities. However, there are a few flaws in this clone: cheating can be rampant because each letter is checked immediately and individually so there's no waiting on submitting the entire word. Guesses are not limited to 6 since you can just erase a previous guess. There's no keyboard indicating which letters have been guessed or evaluated. Secret words must be manually updated, limited to one each game only, and cheaters could sneak peeks without anyone knowing.

Most of these issues could be overcome using advanced scripting like macros or visual basic (in Excel) but where's the fun in that? The whole rationale here is to clone something using a spreadsheet product to show students how formulas and spreadsheets work!

To hide the secret word a bit better and to create a word bank we can use a second sheet in Numbers, or a second worksheet in Excel/Google Sheets. Give that second sheet a name like "secret word list" and put a different word on each row, each letter separated into columns. In Column F insert the formula RAND and Numbers will assign a random number between 0 and 1.You can click the Column F menu arrow and sort by this column, thus creating a new random word to appear at the top of the list every time Numbers is open:


Now that we have a randomized word list we can reference the second table by updating our conditional highlighting rules. Back in table 1, open the rules by selecting the game area and clicking Format > Cell > Conditional Highlighting. Update the green rule first by typing in the first few letters of the second table name. When Numbers autofills the name press enter and type "$1$1" to reference the first row and double-check that "Preserve Row" is checked.
Update the remaining rules in a similar manner, referencing the correct columns and rows on the second sheet instead of the current sheet.

Forcing Numbers to check the letters only when an entire is submitted should be accomplishable by using Applescript but I haven't tried it. Also, the mobile app version of Numbers apparently has a Forms feature that creates fillable forms that may allow you to capture a word guess and then calculate the correct letters. You can also probably use text splitting formulas like =LEFT, =RIGHT, and =LEN to split the text into individual columns.

As a final thought, I'm intrigued by the possibilities of numbers in Numbers, ie cloning Nerdle. But this poses an interesting programming challenge where you not only have to provide correct integer placement clues, but also evaluate the validity of the equation! As with most programming solutions there are elegant and inelegant solutions and it's always interesting to see what students come up with.


Sunday, February 13, 2022

Wordle with Numbers

Not Wordle the game with number as in integers (that game has already been made), but Wordle in Numbers the spreadsheet app!

This is one of those trendy projects ala Flappy Bird that will probably get outdated the moment it's published but it's still a nice introduction to spreadsheets, conditional formatting, and logic.

To recap the rules of Wordle:

  • Guess a 5-letter word.
  • White squares indicate unused guesses.
  • Dark grey indicates that letter is not present in the secret word.
  • Yellow indicates the letter is present but in an incorrect position.
  • Green indicates the letter is present in the correct position.
  • You have six guesses to guess the secret word.
Create a new Numbers spreadsheet. Type in a secret word in Row 1. Each letter should be in its own column:

The secret word is on row 1. Rows 2, 3, 4, 5, 6, 7 will contain our guesses. We can resize our playing area to make square cells and colour the borders by selecting our playing area: cell A2 to E7:

We can give rules to cells in spreadsheets. These rules can change data or the formatting of cells. We're going to have Numbers compare our guesses to the secret word and colour the cell if it's right or wrong.
Let's start with unused guesses. Unused guesses should be white. So, select our playing area of cells A2:E7 and click Format > Cell > Conditional Highlighting.
Add a rule that says Cell is blank and Color Fill it white:

Correct letter guesses that are also in the correct column position are coloured green. Highlight the playing area again (cell A2 to E7) and open Conditional Formatting again (Format > Cell > Conditional Highlighting) and add a rule that says Text is then click the cell reference button the Cell Reference button. Click on the number 1 in the first row to select the entire row:
Choose a green fill and make sure "Preserve Row" is selected. The rule should look like this, note the dollar signs that preserved the absolute reference to the cell:

Correct letters but in a wrong position are coloured yellow. So make sure the playing area is selected again and add a rule that says Text is and click the cell reference button the Cell Reference button. Select cell A1 to check against the first letter of the secret word and choose a yellow fill. Make sure "Preserve Row" and "Preserve Column" are selected:

Create five more rules that reference the next cells: B1, C1, D1 and E1. Make sure to enable "Preserve Row" and "Preserve Column" on each rule so it references the correct row and column with absolute references (the dollar sign $).

Now we can create a rule to show a dark grey if the letter guess is incorrect. With the playing area selected create another rules that says Cell is not blank and choose a custom colour fill of a dark grey colour:

Time to test! Enter a word in your playing area, one letter per cell. The cell colour should change to yellow if you have a correct letter. If it doesn’t work, time to debug or fix your code!
Common mistakes:
  • Not applying the rules to all cells in your playing area
  • Not including the "Preserve Row" or "Preserve Column" (the $ signs) in your formula rule, e.g. $A$1
  • Extra spaces or punctuation
If the game is working then it's time to hide the secret word. Do this by right-clicking Row 1 and selecting Hide row

There are a few issues with hiding the secret word this way. Unscrupulous players can unhide the row and cheat very easily. (nevermind that they can cheat by having endless guesses, and they can even check letter by letter and not submit a whole word like real Wordle!). Also, the secret word needs to be changed manually each time you want to play. It would be nice to create a word bank of many words that get randomly selected for a game. That way, the game maker and player would have no knowledge of the word before playing and more than one game can happen. This kind of game can be created using multiple worksheets, and if I'll try to publish those steps in a separate post.


Monday, January 31, 2022

Multitasking on iPad

 Multitasking on iPad has come a long way over the years. It used to be double-tapping the Home button to reveal all open apps was a huge deal. Recent iPadOS versions have introduced huge innovations in gestures, multi-touch awareness, accessibility, mouse control, and many other small improvements to improve multitasking. I'm really looking forward to Universal Control where I can control iPads and external displays from my main Mac, but I'm waiting for it come out of beta on MacOS and iPadOS before I update.

Split View and Slide Over are perhaps two of the most misunderstood multitasking features for me. probably because I can never be bothered to actually learn how they work. There are a couple of ways to invoke both of them.

With an app open, tap the three dots that appear at the top of the screen:


The icons represent Center, Split View and Slide Over:

Choosing Split View lets you select another app. This lets you view both apps together on the screen. Scrolling or tapping in one window will not affect the other.

Use the grey slider in the middle of the screen to resize either window. Pull it completely to either side to exit out of Split View and enlarge the current window to fullscreen.

Slide Over works similarly except it places the current app in a smaller movable window. This may help when you want to have more flexibility in moving the window to different parts of the screen while still allowing input in either app. You can use the three dots at the top to change to Split View, or tapping the Center button will fullscreen the app. Pull the Slide Over window completely to one side to make it disappear.

For either Split View or Slide Over I prefer to use gestures since I find it a bit easier. Pull up from the bottom starting outside the screen to open the dockbar, hold your finger on an app and pull the app onto the screen. Dragging it to one side will open in Split View while holding it more in the center will open it in Slide Over.

Gestures are also very useful when switching between apps. Enable Gestures by going to Settings > General > Gestures. Using Four & Give Finger Swap allows you to "swipe" between open apps using those fingers. I find I use this very often since it's so quick and intuitive.

Recent iPads will also allow dragging and dropping between apps using multitasking. For example, you can drag a photo from Safari into Pages by having Pages open in Split View. Or, selecting some text allows it be dragged into Pages.

If you use a Mac then you can use Sidecar to use your iPad as a secondary display wirelessly. Besides the usual benefits of having another display, Sidecar gives you Touchbar buttons on your iPad even if your Mac doesn't have a physical touchbar! See this support article for more info.