The case of the missing truck cargo

Introduction

An electronics box prototype to track missing cargo during lorry transport. This was implemented by the Sustainable Living Lab (SL2) at the Raitong Organics Farm in Northeastern Thailand. The whole process from ideation, iterative development, testing and deployment spanned about two weeks, including three days at the Raitong Farm in Thailand.

20171219_155903
Raitong Organics Farm entrance

Image: The Raitong Organics Farm at Sisaket, Thailand

Problem Statement

About 5 out of 750 boxes of packaged rice occasionally goes missing during the weekly 10 hour lorry journey to the sea port in Bangkok. This was affecting the farm’s financial bottomline as well as harming its reputation with clients. Due to strict security measures at the sea port, it was ruled out that the boxes went missing at the port. 

P9440910

Image: Loaded truck with a tarp

It was suspected that the thieves carefully removed the tarp and put it back after removing a few boxes at a location where the truck stopped for a while, somewhere during the lorry journey. The farm needed proof of this.

20171220_103428
The owner of the farm, Bryan

Image: Bryan Hugill, the farm owner, talking about the missing cargo

 

Ideation

SL2 came up with the idea of using a GPS system combined with Radio Frequency Identification (RFID) tracking of tags placed on the boxes. The reason why we chose RFID was that the tags were cheap enough, in the order of a few cents per tag, to be “fire and forget”, and we needed a lot of these. Also, we had to pick the UHF frequency range, which has a detection range of up to 10m, because the usual RFID that we are familiar with, which is in the KHz frequency range,  only had a range of a few centimeters. The cargo truck measured 6m in length, 2.45m in width and 2m in height.

P9440876

Image: The cargo truck

The theory was that once any of the boxes goes out of range of the RFID reader (a couple of metres), it could be assumed that the box was being stolen. Once this happened, a Short Message Service (SMS) alert would be sent out indicating that particular time and location. The mobile GSM system also allowed real time commands to be sent via SMS to the electronics box to ask for updates. In addition, all tracking activity would be logged onto a micro SD card for post-mortem data analysis.

 

Selecting the components

RFID reader

We picked the SparkFun Simultaneous RFID Reader – M6E Nano whose specifications fit our requirements, having a range of 4.5m. Sparkfun has a tutorial on how to use this reader, and even provided an Arduino library, called the “Sparkfun Simultaneous RFID Tag Reader Library”. How useful! We also got a heatsink for the reader since it can get hot pretty fast. It is not recommended to run scanning for more than ten minutes since the reader will auto-shutdown if it reaches 85 deg Cel.  

20171213_153032

Image: the Sparkfun RFID reader using the ThingMagic M6E-Nano chipset

UHF RFID antenna

The UHF antenna was a generic one, which we bought it directly from a RFID technology company in Singapore called Tracknet Id located at Woodlands. Interestingly, this UHF RFID antenna cannot be bought in any physical shop in Singapore, nor is it easy to buy on short notice online, being sold out on the Sparkfun store. The RF cable connections were a little tricky. First there was a 10cm u.FL to SMA adaptor from the reader which has to be connected to a 3m long SMA to TNC RF cable which connects to the antenna. We had to make sure the male and female connectors matched. We managed to get a range of 4.5m for detection of the RFID tags at max power and clear line of sight with no obstruction. We read that UHF RFID is blocked by metal and water, which includes human bodies, so if you put an RFID tag in your hand and cover it, there is a chance that the antenna will not pick it up. There is also a safety distance of 21cm from the antenna during operation according to FCC guidelines due to radiation. UHF antennas also interfere with one another, so make sure that their detection fields do not overlap.   

20171215_125601
The UHF RFID antenna

Image: the UHF RFID antenna

SIM module with GPS

The GSM SIM5320e 3G has both GPS as well as GSM capability. You can make calls and SMSes to this module if you insert a valid prepaid SIM card and hook up a speaker and mic. It can also locate itself using the GPS satellites. So it has two antennas, one for GSM and one for GPS. As with most Arduino compatible accessories, you can search for information about this component online. There is this nifty YouTube video on how it can be used to track stolen vehicles, which is a somewhat similar use case to ours! There is also this helpful starter guide which explains on how you can program the SIM5320 with AT commands directly over the serial port. Best of all, Adafruit has a tutorial and a special library for this component called the ‘Arduino Fona 3G library’! The library is essentially a wrapper around the AT commands and has a bunch of error checking utilities and multi-command routines to make it easier to program the SIM5320. It also converts the raw longitude latitude output of the GPS data which is in something called NMEA format (e.g. 0117.093867 N,10350.701970 E) into Decimal Degrees (e.g. Decimal degrees (DD): 41.40338, 2.17403) which can be directly input into Google Maps. It is interesting to note that the NMEA data also includes velocity (including direction) and time, extremely useful for our use case. We can know how fast the truck is moving or whether it is stationary at any point in time! Coming back to the Fona 3G library, considering that the document for the SIM5320 AT Commands runs into 550 pages, this library removes the need to figure out the AT commands you need by abstracting it into self-explanatory function calls such as getGPS() and getSMS(). Very useful!

A side note about the GPS antenna – it has the interesting property of being magnetic, which means that it sticks easily and securely on the roof of any vehicle. Do note that the antenna has to be oriented correctly to point upwards to the sky for best results. Do also note that in urban areas, it can take anywhere between 5 to 20 min to get a GPS fix from cold start, due to buildings interfering with the signal. At the Raitong farm in Thailand, it was clear open sky, and the first GPS fix came in almost immediately at around 1 min or less. In Singapore, even when positioned near a window, it is not guaranteed that a GPS fix can be obtained at all. If there is no GPS fix within 20 min, you can assume that you need to move to a more open area away from tall buildings.

20171213_114535

Image: It took 15min to get a GPS fix at this open space in between tall buildings

sim5320e module

Image: The GSM SIM5320e 3G module

SD card module

We bought a generic Arduino compatible microSD card reader and used the inbuilt Arduino ‘SD’ library, modifying the ReadWrite example program to suit my needs.

microSD card module

Image: generic micro SD card module

So the resulting block diagram looked like this:-

Raitong_ver1_block_diagram

Image: block diagram

You can see the power calculations for the phone bank batteries in the Appendix at the end of this article. I used SoftwareSerial to communicate with all the components.

20171217_005711
Electronics box

Image: Inside the electronics box

 

Technical challenges

Sparkfun RFID library limitation

After exploring all the examples in the Sparkfun RFID library, I discovered that there was no library function to count the number of unique tags within the antenna’s tracking range. What was happening was that the reader was randomly reading all the tags in random order, so for a particular tag that was nearer to the antenna could be read multiple times while a tag that was further away would only be read once. Since the reader could read up to 150 tags per second, in theory, it should be able read all the tags within the antenna’s range at least once. So I came up with a simple algorithm that would use an array to keep track of the number of unique tags read. If the current tag number is not in the array, it is a new tag, so add it to the array. If it is already in the array, skip this tag and read the next tag. Do this for a few seconds to ensure all tags are read at least once.

Screen Shot 2017-12-17 at 8.23.42 PM

Image: repeated tag number readings

I was not sure if this would work, so I posted my hypothesis to both the Sparkfun forum and Arduino forum. The Sparkfun forum answered one day later and was immediately helpful, even providing the entire implementation of the code for my hypothesis. The Arduino forum replied four days later and was not very helpful but I thanked the person anyway.

In Thailand, I tested the code for 70 tags and lo and behold, all 70 unique tags were read within 10 seconds! Thanks to the open source community!

Screen Shot 2017-12-19 at 11.41.24 AM

Image: screenshot of my question and reply

A side note related to this issue is the difference between EPC and TID numbers for each RFID tag. EPC stands for Electronic Product Code and is a 12 byte number meant to identify the category of product, e.g. a milk carton, eggs, whereas the 20 byte TID or Tag Identification number is a 20 byte number which is truly unique for each RFID tag. The library function created only reads the EPC but not the TID, and there does not seem to be an easy way to read multiple TID tags simultaneously, based on the available functions in the library. Luckily for us, Sparkfun randomises the EPC numbers on their tags, so there is only a 2^96 chance of two tags having the same EPC number, which means the probability is almost 0 (12 bytes x 8 bits = 96 bits), and we can ignore this issue.

UHF RFID blocked

UHF RFID is blocked by metal and water, including human bodies. After testing the UHF RFID detection range with cartons of rice at the Raitong farm, we realised to our disappointment, that the antenna could only detect tags behind a SINGLE box. Anything more than one box placed between the tag and the antenna, and the tag could not be picked up. This is a problem, since the boxes were stacked 8 or 9 high, by 6 wide and 15 in length, and the antenna needed to be able to penetrate at least 6 boxes in order to track all the boxes at the last vertical layer the back of the truck. This was assuming that the boxes would be stolen from the back of the truck since the sides of the truck had metal railings 2m high, whereas the metal railing was only about 0.6m high at the back.

20171220_144144

Image: Testing detection range with the antenna on the chair and RFID tags placed behind the column of boxes.

20171220_154839
Testing the RFID on rice boxes

Images: Testing another configuration with the antenna pointed downwards. Similar results – detection range of only one box.

We found out from Bryan that the rice had 14% moisture, so the water content could be interfering with the signal. Apart from the awful detection range of the antenna, there were also other factors that could complicate things. For example, how and where could we secure the antenna since the boxes were densely packed with no space inbetween? Would the metal flooring and railings of the truck interfere with the signal? Would the human thief be able to block the antenna inadvertently since human bodies block UHF RFID? Also, the detection lobe of the antenna is rather limited. What if the boxes were stolen from the top instead of the back of the truck?

IMG-20171222-WA0005

Image: densely packed boxes. Where to put the antenna?

We decided to scrap the RFID idea, so it was back to the drawing board for us. The next best idea was to install a Raspberry Pi computer with webcam, but we ran out of time to implement this. We resorted to a simple trick – using a tripwire. We would rig a couple of strings over some of the boxes. If any of the boxes were moved, the tripwire would trigger, and an SMS alert sent out indicating the time and location.

The block diagram for the actual deployed box looked like this:-

Raitong_ver2_block_diagram

Image: Block diagram for actual deployed box

P9440937

Image: Setting up the tripwire after removing the RFID reader

 

P9440953
Setting up the tripwire

Image: Tripwire

20171221_202622

Image: Setting up the tripwire

 

Other challenges

Airport security

As with any maker projects concerning lots of electronics and wires, there have been stories of running into problems with security at the airport. We took several precautions against this. We asked the Raitong farm for an official letter stating our order of business and the list of electronic components. And more helpfully, we disassembled everything and separated all components into individual boxes, so giving no excuses of looking like any sort of ‘bomb’. In the end, we had no issues except for forgetting to put the phone bank into hand carry luggage instead of check in, which is a common requirement for all passengers. The airport security did not ask about the big UHF RFID antenna and we did not have to produce our letter from the Raitong farm.

Screen Shot 2017-12-26 at 4.03.03 PM

Image: Official signed letter from Raitong Farm

Prepaid card value

While testing out the SMS system in Thailand between the sim card in the box and the sim card on my phone, I was not able to send or receive SMSes after a few successful times. It took me about an hour to figure how why. The prepaid card came with a value of only 15 baht for SMSes, whereas each SMS cost 3 baht to send out. Luckily for us, the Raitong Thai staff were able to help us quickly top up the card value using their local bank account.

20171221_180020

Image: Thailand SIM card. See the pathetic 15-baht call credit at the bottom right?

Operational deployment

Data logging

The datalog.txt file would record all GPS data at every 30 second interval, including position, speed and time. The log file would also report the status of the tripwire and note where the truck was stationary for more than 3 min.   

Screen Shot 2017-12-17 at 1.19.19 AM

Image: Sample of data logging on the SD card

SMS interactivity

Screenshot_20171221-210313
SMS interactivity

Image: SMS interaction

The system recognises only one command sent via SMS which is “Loc”. It will then send back a status string, including the number of SMSes left, whether the tripwire has activated, the date, time, speed and google maps link to its current location.

The system will automatically send out an SMS alert when the wire has tripped and when the truck has been stationary for more than three minutes.

Conclusion

Screenshot_20171222-160712
Tracked the truck journey

Image: route tracking of the truck journey

No boxes were stolen during this particular journey although we discovered some interesting things. For one, the truck took a longer time than expected – about 14 hours instead of the 10 hours promised by the transport company. We found out that the truck stopped for a long time at certain places, for up to 1 hour. This was not normal.

IMG-20171222-WA0004

Image: top layer of boxes came loose. Picture taken at the sea port.

Also, the tripwire indicated to us that some of the boxes got loose during the journey since the top layer of boxes was not a complete layer. This is good feedback so that it can be ensured that the top layer of boxes should be securely fastened the next time.

P9440947
The SL2 team with Bryan

Image: SL2 staff with Bryan Hugill

Bryan from the Raitong farm was grateful to us for the prototype and attempting to find proof of stolen cargo. We also learnt from this trip about teamwork and improved our technical knowledge.

Future improvements

Tamper proof box

Since the thieves would be able to see the box, they might attempt to tamper with it. The box should be securely locked and is only be able to be opened by a key or password. The box should be permanently sealed and all access to the internal components should be via exposed ports on the outside of the box. This includes charging ports for the phone banks and reading from the SD card.

Raspberry Pi (RasPi) with webcam

We did not have time to implement the next best idea which was to have a Raspberry Pi connected to a webcam. We could set up the RasPi to talk to the Arduino easily, each controlling different components, since the Arduino handles the SIM5320 very well, and the RasPi can handle the data flow from the webcam. The idea would be to add another SMS command to ask the webcam to send a low res image of whatever it sees at the back of the truck. The box could also automatically send out an MMS of the low res pic whenever the truck is stationary for more than X minutes.

APPENDICES

A. Cost breakdown

Item Qty Unit price Total
RFID reader 2 270 540
RFID antenna with RF cable 1 180 180
RFID tags 70 0.28 20
GSM SIM5320e with GPS antenna 1 90 90
Micro SDcard module 1 30 30
Arduino Mega 1 80 80
Power bank 3 25 75
Box enclosure IP65 1 80 60
Total: 1095


B. Power calculations

Note: Each of the following three components is connected to a dedicated 10000mAh power bank with a 2.1A max current draw rating. Each power bank has to last for more than 10 – 12 hours for the truck journey.

RFID reader

It has a peak power draw at 3.6W, or 0.72A at 5V while scanning at max power of 27.0dB. Using a 10000mAh (or 10Ah) power bank with 5V output, the power bank can output 0.72A for 10Ah/0.72 = 13.9 hours. But it will not be scanning continuously due to overheating. So we programmed it such that it scans for max 20s per min, or 20min per hour. So the power can last for 13.9/0.33 = 41.7 hours.

GSM SIM5320e 3G with GPS antenna

Sending SMSes can draw up to 2A from the power bank. This means that the 10Ah power bank can last for 5 hours which translates to 3600 SMSes, assuming each SMS takes 5 sec. In comparison, we would not have hit anywhere near 500 SMSes during the 10-12 hour journey. Assuming 500 SMSes at 5 seconds each, it will draw 2A for 0.7 hours, which is 1.4Ah. The power left from the power bank would be 10Ah – 1.4Ah = 8.6Ah. Assuming 100mA constant current draw for the GPS, which is conservative, the power bank can last for 86 hours.

Arduino Mega with microSD card

Assuming a constant current draw of 200mA, which is conservative, the 10Ah power bank can last for 50 hours.

C. Software code

First version created in Singapore with working SD card, GSM and GPS. See README for all Arduino pin and wiring connections. No RFID. (link)

Actual deployed version with tripwire and SMS interactivity. No RFID. (link)

Useful test program for RFID range testing and tag counting (link)

Useful test program for GSM SIM5320 module, including SMS and GPS (link)

An edgy experience with neon flex LEDs

So recently at work, I was tasked with the acquisition of a neon flex LED system to light up a 6 m long tunnel.

What are neon flex LEDs? They are the modern version of the neon tube technology used in neon lit signs, such as the one below. Instead of using some kind of inert gas, it runs on modern LEDs built to resemble the uniformity and light texture of neon tubes of old.

3028214-inline-i-neon-lady.jpg
Neon tubes of old

I was responsible for figuring out the electrical connections and software configuration. Due to the manufacturing and shipping time and the tight project deadline, I had less than a week to figure all these technical details with no instruction manual. The LED supplier was from China and the project installation was in Thailand. The LED supplier could only communicate in Mandarin. Despite 12 years of formal education in Mandarin, I had a hard time understanding some technical terms in Mandarin as it is not my native language. I also had to advise the Thailand team who was doing the actual installation.

For the above mentioned reasons, I use the description “edgy experience” in the title of this blog article.

The project could not have succeeded with some ameliorating factors. For one, the China LED supplier was very helpful and we managed to build up a close knit working relationship. We communicated daily… in Mandarin. For the Mandarin part, I had the close help of my best friend Google. I used Google translate for technical terms. I also googled for information on how to use the LEDedit program, a free open source software to convert any video file into a .led format which the DMX controller recognises.

The rest of this blog article may sound a little technical, so if you wish, you can skip right to the end of this post for the 30 second video demo of the neon flex LEDs.

For the setup configuration, there are 44 strips of 6 metres each. As for the resolution, due to the limitations of DMX technology, each pixel was 10cm long. So in effect, we had a screen that was 44 x 60 pixels in resolution.

NSM LED strip layout ver 2.0.png
setup configuration of 44 LED strips

Here is the electrical connection diagram that explains the wiring connections:-

NSM LED electrical diagram_6 strips.png
Electrical connection diagram for six strips

This is the DMX controller that we used. It has 8 ports, each of which can support up to 500 pixels. I distributed the pixels across all 8 ports, with an average of 350 pixels per port.

20151024_104655.jpg
The DMX controller

A closeup view of the LED strip with a small sample of the aluminium U channel mounting bracket.

20151024_105256.jpg
closeup view of LED strip

This is the aluminium bracket to secure the strip to a surface. It is held in place by screws placed at the holes. The sides are also somewhat soft and malleable so the grip strength can be adjusted manually.

20151024_105058.jpg
U-channel mounting bracket

This is the LED connector. Designed in a way to waterproof the system. There are three wires – power, ground and data. It is simple and easy to use and connect. We just had to make sure the physical contact was secure and there are no damaged cables. We also used high grade cables for the data line. The lower electrical resistance for good quality wires ensured that the data was transmitted faithfully so that the strips do not flicker and show consistent performance for the animation.

20151023_183849.jpg
LED connector

This is the 12V waterproof power supply. Each power supply could only power two strips due to the high power demand.

20151024_104801.jpg
power supply

These are the pin connectors that join the LED to the connector head shown earlier. We had a bit of problems with loose connections for these and had to do some swapping and testing.

20151023_183922.jpg
pin connector

Below is the test setup I did in my office. I shipped four strips to Singapore to figure them out.

20151027_194547
test setup with four strips

Concurrently as I was testing the LEDs, the Thai contractor was busy building the tunnel structure out of wood.

IMG-20151111-WA0008.jpg
constructing the tunnel

After installing the LEDs, the tunnel looks like this:-

IMG-20151113-WA0004.jpg
final installation

So after I showed the China LED supplier the video of it working, he was rather impressed:-

Screenshot_2015-11-23-13-39-13.png
Praise from the China supplier

And now finally, here is the 30 second video demo of it working:-

Using a microphone as an airflow sensor

I was having problems with overseas shipping for some wind sensors so I tried used a cheap microphone as an airflow sensor instead. It sort of works and I am quite proud of it. At first I hooked up the microphone to an Arduino but it was not able to tell the difference between sound and wind and was too easy to trigger. So I took away the Arduino and fed the mic input directly into Processing and did a real time Fast Fourier Transform analysis to help differentiate a wind versus sound input. A sound input would usually cause a range of frequencies to be picked up whereas an airflow would cause a distinctive shape with the lowest frequency being the loudest, and tapering away with higher frequencies. I also used a smoothing filter by averaging the readings over a certain amount of time. The result can be seen in the video.

The making of the “Neobombe” prototype (electronics)

Neobombe setup at Singapore Maker Faire
Neobombe setup at Singapore Maker Faire

So my group of friends and I exhibited our “Neobombe” prototype at the Singapore Maker Faire last weekend. After submitting our proposal more than two months ago, we managed to scrap together a working prototype. It is far from perfect and has a lot of room for improvement. Given more time and budget, we could make it pretty awesome, but it has to do for now. Four of us from ArtMakesUs were actively involved in this project and I estimate we spent about two man-months doing this project. We worked on it on the side while doing our day jobs. Our expenses added up to about SGD2,000 coming out of our own pockets. I focused on the electronics while the rest of my teammates did the programming and the build. The Neobombe concept was the brainchild of my programming teammate. I helped execute the idea via the hardware electronics, spending the bulk of the budget on the electronics.

This slideshow requires JavaScript.

We had generally positive feedback from the audience during the maker faire. They loved the idea behind the art installation and enjoyed the interactivity – they could see their Enigma-encoded twitter messages being “intercepted” by the Neobombe, and then decrypted live in front of them. The only negative feedback came from some of the audience members who are electronics-trained. They gave feedback that for a hobby project, we probably spent too much money. We should have ordered all our 36 stepper motors and shields from China, from websites such as Taobao and Ali-express. I ordered these components from Adafruit from the USA cos I loved Adafruit’s quality assurance as well as their online forums and extensive documentation. Our former lecturer from LASALLE who dropped by said we went “crazy” on the project budget. No regrets though.

Line diagram
Line diagram

This is the line diagram for the setup. I did a simulation of the actual bombe dial movements rather than the actual mathematical mechanics as encoded in the software algorithm because I didn’t know how to parse the osc data streaming in live from  the Javascript program. The osc data contain the actual movement indication for each individual motor based on the bombe decryption algorithm. To put it in layman terms, the movements of the stepper motors are fake, as in, they resemble actual movements of the dials in the actual bombe machine but are not actually similar. The lay audience wouldn’t be able to tell the difference if you put our Neobombe and the actual bombe side by side but in terms of scientific integrity, they are not the same. There are three rows of 12 steppers. The top row has a fast rotating movement, something like three revolutions per second. Stepper motors are notoriously complicated to control compared to other motor types, like DC or servos. I ran into the problem of not being able to make them move fast enough due to blocking commands when many motors are controlled by one Arduino microcontroller. Even when I used the AccelStepper library which allows for non-blocking commands, I noticed that the more motor shields I stacked on one Arduino, the slower the motor speed. Hence I stacked one motor shield per Arduino for the top row, two for the middle row and three for the bottom row. I don’t think the programmer is too happy with what I did, but if we ever have the chance to work on this project again, I will fix this.

Test setup or electronics
Test setup or electronics

You can see the test setup for the electronics follows the line diagram: two power supplies, two usb hubs, one power distributor board, 11 Arduinos and three rows of stepper motors.

Adafruit shipment package
Adafruit shipment package
12V 12A power supplies
12V 12A power supplies
USB hubs and power distribution board
USB hubs and power distribution board

One note regarding the power supplies and power distribution board, and also for the Arduinos, is that I should have created electronic enclosures for them. Like a black plastic box casing or similar to help protect against accidental short circuits, like, if, for example, someone spilled water on the electronics or touched the positive and negative terminals with wet hands. This step would be a matter of life or death for AC circuits or DC circuits with high voltages. For 12V, the repercussions would be a lot milder, but if this project were a public commercial installation, this precaution would be necessary. You can never predict the behaviour of young children. During the maker faire, we realised that this Neobombe project is pretty incomprehensible to children. How do you explain encryption, Twitter, computers and WWII in simple terms?

mess of wires
mess of wires

There was a horrendous amount of wires. Cable management is important but we weren’t very successful at this. We wanted to expose the cables though. For the raw-looking aesthetic.

jst connectors - 18 x 2-pin power cables + 36 x 4-pin stepper cables
jst connectors – 18 x 2-pin power cables + 36 x 4-pin stepper cables

Soldering the JST connectors took up 20 hours. I actually kept count. It was laborious indeed. But my soldering skills + 1. I was proud that none of the connections broke during the two days of the maker faire. I had my soldering iron on standby just in case. The JST connectors were very useful for fast setup and tear down for the installation. JST stands for Japan Solderless Terminal, named after the company that first made these.

jst connector for stepper motor
jst connector for stepper motor

The ribbon cables helped cut down the mess by a lot, else there would be quadruple the amount of snaking wires lying around.

jst connector for motor shield power
jst connector for motor shield power

These were relatively easier to do compared to the four pin JST connectors for the steppers.

3D sketch of led light strip
3D sketch of led light strip

Our original idea was to have light strips for each motor and we even went so far as to design and 3D print the above model – the mount and casing for the printed circuit board (PCB) light strip. We even spent SGD400 on making 40 of the following PCBs. The PCB (in green) was meant to be slotted into the 3D printed stepper mount (in black) and covered by a translucent casing (shown as transparent).

LED PCB strip
LED PCB strip

But we ran out of time and budget. 3D printing takes up a lot of time. Neither did we have the budget to do a commercial 3D print to save time. But if we had budget, I wouldn’t use the coin cell battery which has to be replaced daily. It doesn’t make sense for a permanent installation. Instead, I would use the Adafruit slip ring with flange. See following image. This cost USD15 though and we need 36 of these.

Adafruit slip ring with flange
Adafruit slip ring with flange

The slip ring allows for rotating LEDs since the wires at the top can be rotated continuously while maintaining contact with the wires coming from the bottom. You can add a proper LED strip with many LEDs, instead of single LEDs, powered by a wall adaptor instead of coin cell batteries.

Rough sketch of frame build
Rough sketch of frame build

If we had more time and budget, we would create a proper rack frame for the motors, Perhaps even do a steampunk look with metal parts and exposed gears. We could also add an alphabet ring to each of the motors since technically, the motors move from alphabet to alphabet, from A to Z. If. If only. A big “if”. Well, we have to leave it as it is for now.

Singapore Maker Faire 2015

The first full-fledged maker faire held in Singapore. Over 10,000 visitors and 200 booths. Graced by the Education Minister and Maker Media CEO Dale Dougherty. Click on any image below to see in slideshow format.

Assembling the Adafruit Cupcade

Adafruit Cupcade
Adafruit Cupcade

Spent about two days assembling the Adafruit Cupcade as a gift for a friend. Some soldering and fiddling around with the command line is required. I ordered the kit online. You have to provide the Raspberry Pi though, more specifically a Model One Revision B. I had an old one lying around that I bought a few years ago so I used that. The kit costs USD120 but the shipping to Singapore cost me USD30. I then installed the Cupcade Linux distribution that supported the NES emulator so I could play games like Mario Brothers, TMNT, Contra, Mega-man, Castlevania etc. Yeah those 8-bit games on the very first Nintendo NES system, the ones that came in cartridges that you had to blow onto sometimes to get it to work. The Cupcade is very cute to look at and you can actually use the knob and buttons, but it is not a serious nor practical gaming platform. More of a nostalgic toy that brings back memories of my childhood.

Electronic parts
Electronic parts

All part of the kit minus the RasPi. An 8-ohm speaker is included, together with a 2.8 inch TFT touch display, an interface breakout board for the knob and buttons and a ribbon cable for the display to the RasPi.

Lasercut parts
Lasercut parts

Also part of the kit. I though the design is very thoughtful and detailed. It was a bit difficult to assemble when you had to align many screws at once but the end result is a clean finished look with no ugly exposed screws or holes.

The TFT display
The TFT display

The display has a resolution of 320 x 240. It is quite low res but it boasts a resistive touch screen, although the touch feature is not used in this setup.

Top half
Top half

The speaker is mounted behind the slits. You can see the suspended nut in the “t” slot held in place by a screw. This method is used to hold the external parts of the frame together.

bottom half
bottom half

The red buttons emulate the A and B buttons on the Nintendo console. The black buttons are the coin slot and 1-player buttons. I improvised using blue tac to secure the RasPi onto the bottom base because I was using the older Model B Revision One. The Revision Two had screw mounts on the RasPi.

Joining top and bottom halves
Joining top and bottom halves

This is what it looks like after connecting all the wires and cables.

back view
back view

You can peep into the insides through the slit behind. There is also a bottom slit for the micro-usb power cord and to access the sd card which sticks out next to the cord.

Project 50plus – deploying sensors

wp_20150515_115952
Human signboards roaming around Suntec during the event

I deployed some sensors for an exhibition called “50plus” targeted at senior citizens above 50 years old that promoted active aging and was held at Singapore’s Suntec convention centre a few weeks ago. It was sponsored by the government and corporate sponsors who showcased their products and services. My company’s project was a huge interactive installation occupying prominent space at the centre of the hall. Users stand in front of a huge screen with a camera looking down on them and see themselves on a virtual beach. The users are able to interact with virtual objects seen on the screen in some kind of augmented reality scenario. Here is a test setup that gives you an idea of what it looks like:-

A test setup during development phase
A test setup during development phase

Here is a description from the actual site itself:-

wp_20150515_111908
Instruction signboard at the actual site
actual site setup
actual site setup

There are three interactive features.  The picnic basket senses if a user lifts the basket up to trigger an animation of flocking birds. I designed the platform for the basket in SketchUp that was then built with wood. The other two features are triggered by the user stepping on certain hidden sensors underneath the vinyl sticker flooring.

Test setup for the sensors
Test setup for the sensors

In the following picture, you can see the two sets of footprints where the sensors are placed under the vinyl sticker printout of a beach.

Actual setup
Actual setup
merlion and raincloud animation
merlion and raincloud animation triggered by floor mat sensors
flocking birds animation triggered by lifting the basket
flocking birds animation triggered by lifting the basket

It is satisfying to see your sensors working and people having fun with the installation. I was glad to be a part of this cool project.

Deploying at Chinaplas 2015, Guangdong, China

I went on a last minute work trip to China at Guangdong city to deploy some Flash apps at Chinaplas 2015. Chinaplas is an annual global trade show  for plastic manufacturers to showcase their products. My company’s client for this tradeshow was Dow.

It was my first trip to China and it was rather memorable. The tradeshow was held at the Pazhou convention centre. It is one of the world’s largest convention centre and this particular building was the size of several aircraft hangers.

Pazhou convention centre
Pazhou convention centre

The Dow booth was one of the nicer booths around. We worked with Kingsmen who did the interior design and build.

Dow booth
Dow booth

The hardest challenge for me for this work assignment was that the computers all used Windows operating system that was in Chinese. I had to put my own laptop side by side with the Dow computers to see the translation.

I wanted to be able to access Google, Youtube and Facebook when I was in China so I got a temporary subscription to a VPN service together with a mobile 3G connection.

We stayed in a low budget hotel right next to a metro train station that was situated near the convention centre. The hotel was comfortable and the staff were friendly and helpful. There was a 24 hour KFC fast food joint next to our hotel which was convenient when we needed an early breakfast or late supper.

Warm Yes hotel
Warm Yes hotel

One of the most memorable moments was listening to a busker right outside our hotel singing Hai3 Kuo4 Tian1 Kong1. It is a song from the 90s sang by a popular Hong Kong band called Beyond, and it was used as a rallying song by the student protestors in Hong Kong earlier this year to protest against China’s oppressive rule. Hong Kong and this part of China speak the same Chinese dialect Cantonese and I suspect that the people here are sympathetic towards the people of Hong Kong.

busker
busker

The most iconic building in Guangdong is Canton Tower standing at over 600m tall. We paid a handsome tourist fee to climb to the top of the tower to enjoy a panoramic view of the city.

Canton Tower
Canton Tower
view from top
view from top

Apart from Canton Tower, there is another popular tourist spot which is the night market at Shang4 Xia4 Jiu3 Lou2 street. It reminded me of Taipei’s Xi Men Ding area. Quite quaint, romantic and enjoyable for a date, with nice food and shops.

pedestrain street
pedestrian street
oyster seller
oyster seller
fried garlic oyster
fried garlic oyster
street snack
street snack
street corner
street corner

Proposal for Singapore maker faire – the “Neobombe”

So some of my friends and I (our group has a name – “Art Makes Us“) decided to take part in the Maker Faire in Singapore this year. It will be held a primary school in Tampines sometime early July.

Here is our project description:

“Neobombe” is a scientific artwork based on the Turing machine featured in the movie “The Imitation Game”. “Neobombe” is a combination of two words, “neo” and “bombe”. The “bombe” is an electromechanical device used by British cryptologists to help decipher German Enigma-machine-encrypted secret messages during World War II. “Neo” means “new”, because our version of the bombe takes on an art perspective. The “Neobombe” replays the World War II scenario of decrypting Enigma encoded messages in the form of Twitter feeds. Users interact with the artwork by tweeting using a specific hashtag and then see how the bombe interprets those messages.

Here’s an image of Turing’s decryption machine from the movie ‘The Imitation Game’:-

2014, THE IMITATION GAME

And here are some concept images of our proposed installation:
neobombe_01

neobombe_02

neobombe_03

neobombe_04

We are using 36 stepper motors to create the rotating gear effect. The motors themselves will set us back by at least S$1,000. Good thing all of us are working and no longer poor students so we can combine our resources to make this. There will be some kind of colour led light on each motor to highlight its mechanical movement and to make it look, well, a little more interesting to see. There will also be sounds created in software by our sound designer in the team. The software is already up and running thanks to our programmer. How it works is that you send a live tweet on Twitter with a hashtag, say, “neobombe” (I checked. This hashtag is unique), and then the program will scan the feed and do a simulated encryption and decryption. Which is invisible except that the motors will spin when the decryption is happening, accompanied by sound effects. Once the message is successfully “decrypted”, the motors will stop spinning, and the actual message will appear in its plain text form on the table from a small projector. When it is decrypting, you will see a jumble of nonsense text on the table instead. By the way, the software actually follows the exact mathematical procedure used in WWII but you can’t see this unfortunately. Well, not literally. But you get the idea. Or at least we hope.

The making of the “yes-no” box

I was given a mysterious job at work from the very top management in my company. I was asked to make a simple communication device that merely says “yes” or “no” with a single button. A longer press means “no” while a short press means “yes”, denoted by a blinking red and green LED respectively. Who it was for was never mentioned. And it was a hush hush, under-the-radar kind of project, a personal, unofficial project, and I was working on it alone. I was guessing it could be for someone with locked-in syndrome like Stephen Hawking, or someone with severe intellectual disability that does not allow him or her to talk. Maybe I should have called it the ‘Stephen Hawking’ communication device, but that would be disrespectful to the scientist.

So I made a prototype first using a breadboard and cardboard casing, to make sure my programming and wiring was correct. I got feedback from that top management guy and then made a final version with a soldered circuit and putting it into a proper black plastic box.

This is what the prototype looks like on the outside:-

Yes-No box prototype
Yes-No box prototype

And this is what it looks like on the inside:-

Inside the prototype
Inside the prototype

So after the prototype was approved. I started soldering the final circuit. Pics of it before mounting it onto the box:-

Top side view of final circuit
Top side view of final circuit
Other view of final circuit
Other view of final circuit

I paid S$50 for a shop to do all the mechanical mounting for me. The shop drilled the holes using a S$400 rotary drill and a S$100 bench drill.

rotary drill
rotary drill
bench drill
bench drill

That $50 was totally worth it cos it would have taken me a whole day to do the holes and I would have done a lousy job of it and the box would turn out ugly.

So the final product looks like this:-

With a grip switch
With a grip switch
Closeup of inside
Closeup of inside

Here’s a short video showing how it works:-