More Particle Internet Button Projects

I posted a few months ago about the Particle Internet Button I’m playing with (link). I’ve created another 2 projects in the mean time.

Adjustable Timer

The first is an adjustable timer. The lights on the Internet Button are used to indicate 30s steps, ranging from 30s to 5min. When it turns on you specify the length of time you want to run it for by either increasing or decreasing the steps. When running the 30s that are currently active flashes. At the end of the time, the Internet Button beeps and flashes red. It can be easily adjusted and reset.

particle timer

Left: select length of time
Right: Timer running

I made this back in November, but actually had a problem with it that I couldn’t figure out. I had intended to post to the Particle forums for help but never got round to it. I had in the mean time uploaded the offending code to Github. I recently reinvestigated the code with the intention of this post, and found that someone else had found my code, and solved my problem, so thanks to Github user mseneshen. Working code can be found here: source


The second project was a set of dice. Playing Catan and having people complain about how there were no 3s rolled in a game gets old, so why not create a set of dice that keep track of this and tell you facts. Apps are available for this, but then the screen turns off and it becomes a hassle. So I wrote some code to mimic a set of dice.

particle dice

Left: Dice being rolled
Right: Dice have been rolled

To roll the dice you gently shake the Internet Button sideways. The code randomly generates two numbers between 1 and 6, adds them, and outputs them by lighting up the appropriate number of LEDs. To make it easier to read, LEDs are colour coded in groups of 3. The Internet Button only has 11 LEDs, so I if a 12 is rolled, the 11th LED changes colour. Because a 1 is never rolled, I could have used that LED, but it seemed less intuitive. Also, because we play Catan, if a 7 is rolled, all the lights go red.

The whole time the dice are running, a tally is kept of how many times each number is rolled. At any time you can click a button and a distribution is published to the console. I might update this later to automatically graph the data and tweet it, but haven’t tried that yet.

When I first tested the code, I was getting reproducible random numbers, so I introduced a seed from one of the analogue pins which appears to have solved that problem. Because it uses an accelerometer to trigger a throw, when it is on it’s side, gravity is enough to trigger a throw and allows me to get thousands of throws without destroying my wrists.

Some plotted results can be seen here, with actual roll percentage (bars) vs statistical roll percentage (dots).

Code is available here: source

Temperature and Altitude

I recently bought an Adafruit BMP180 that I’m trying to get running with the Internet Button. Will post details once it’s active.

Sony Noise-Cancelling Headphone review (MDR-ZX770BN)

I’ve never spent money on headphones. That’s a lie, when I was like 13 I had a R100 Musica voucher which I used to buy a R150 set of headphones. They were great (nope)! I had to replace the headphone jack, and battle trying to solder those stupid coated wires they love to use in headphones. And then I had to do more soldering when the joints to the speaker itself got damaged. Thankfully after my 3rd year in university I got to stay in a room by myself, and was able to upgrade to a ‘decent’ set of speakers.

Anyway, basically I’ve never bothered about decent headphones. I could never warrant spending R1,000+ on a set of headphones, when my speakers cost less than that. Fast-forward several years, I’m earning a good salary. I have a lot of flying coming up. I despise airplane headphones. Emirates are okay, but Etihad, Lufthansa and Swiss Air are still using headphones that came with Walkmans in the 80s. I figure if I’m going to do this, I’m going to do it right. Then, after much searching, I find out that South Africa has a very poor selection when it comes to Noise Cancelling headphones. Like seriously poor. All I could find in East London were Beats (R4,000), and the guy in store wasn’t sure if any of their headphones had noise cancelling. He did show me a headset with a microphone that had noise-cancelling though, that was nice, totally what I was looking for.

These are not acceptable airlines.

So I decide to las it, stick to my ‘newly’ acquired R250 earphones (I got them in 2012, they’re still going strong, I don’t know how). Then I end up in Germany. Then I find out the allowance work pays is actually higher than what we had been paid out. This means I have ‘spare’ cash. They give us a set amount every day regardless of what we do with, if we don’t spend it, we can keep it, I saw it like a bonus. Time to do some shopping.

Man, the selection on offer was amazing. And I’ve found the same thing in the US. Prices were probably a bit cheaper than in SA. But the biggest difference is just sheer volume of choice. I visited the local Media Markt in Sindelfingen, quite a large store to begin with, and they have a wall covered in headphones. Brands I’d never heard of and more models than I’d ever seen before from brands I did know. So now the problem became choice. I limited myself by budget. But I still had a hard time trying to choose.

After much umming and ahhing, some online research, a return visit and a final count of my spare Euros, I settled on the Sony MDR-ZX770BN. And I am mostly happy.

Actual Review starts

I paid just over Euro 200 for a demo unit. It’s a wireless headset with Bluetooth (BT) connectivity, noise-cancelling (NC), a built-in mic and over-ear design (I can’t handle on-ear headphones). It comes with a volume rocker, and music playback control (all on the RHS earpiece). All of which works beautifully with my Android cellphone and tablet and surprisingly my windows based laptop as well.

Although wireless, it does come with a 1.2m audio cable which you can plug in. it has 3.5mm jacks on both ends, so shouldn’t be hard to replace if it gets damaged. While plugged in the battery will still be used for NC. If the battery dies, you can still use the headphones, just without NC functionality.Plugging the headphones in to charge immediately turns off Bluetooth and NC. But you can continue to use the headphones via the 3.5mm jack while charging, sans NC. In this review, the presenter mentions you can’t turn off the NC while listening with the cable. But you can. By just turning off the headphones.

On the left ear you find the 3.5mm plug and micro-USB charging port, along with the power and noise-cancelling buttons. NC is on by default, with the option to turn it off or ‘retune’ it. It has 3 different settings, and when requested will monitor background noise and select the ‘best’ setting.

Noise cancellation is interesting. When not listening to anything, and NC is on, I can hear a slight white-noise. Turning NC off, turns this sound off as well. Now I understand the concept of NC well enough, and don’t have enough experience with other headphones to know whether this is normal or not. It is an obvious noise however, that I will turn off NC off when listening to podcasts in a quiet environment.My only other complaint of any measure is the power button that I find mildly infuriating. It’s a very wide button, but it only works if you press it dead-centre. So often when I go for it on the side of my head, I’ll press down off-centre, and not be met with the customary ping of a successful power-up. Annoying, but not a deal-breaker.

Besides that I’ve been very happy with the headphones. The insulation is not perfect, but does a good initial job of removing background noise. Sound quality met my expectations and volume capability is far beyond what is needed. Honestly the wireless aspect has actually been a bigger thing for me than the NC. The NC is just a bonus that, in the right situation, works a treat.

I’ve done a fair amount of travelling and rough handling of the headphones over the last 6-months, and they’ve taken it like a champ. Just as good today as the day I bought them.

The speakers also have built in NFC connectivity which lets you link your compatible phone to them without any effort on your side. I didn’t initially get this to work, but retrying it now, it couldn’t have been easier.

As to the battery life, I have been happy with it. Only times I’ve been dropped are at home when I’ve just neglected to charge it. Claimed battery life is 19 hours BT on, sans NC, or 13 hours with NC. 24 hours with BT off but NC on. I don’t think I get that, but I did take a demo unit which could have been on the shelf for months.

I do wish there was an easy way to select which device it’d connect to at startup, as it always connects to the previous device. And if I’m not sure what device that is, it requires some scurrying around trying to find my tablet to disconnect it, or open the proper dialogue box on my laptop. The NFC with my phone does negate this to a certain extent, as I can always connect it to my phone immediately.

Sony also sell the same headphones without the NC for about $100 less.

End Review

The next day, in another shop, I tried on a top of the range set of Bose headphones, oh my goodness they were fantastic. Completely insulated sound, and amazing performance. While it made me a bit sad about my new purchase, their 400+ Euro price tag kept them way out of the range of me even considering them. Maybe one day, probably not.

Particle Internet Button with Photon – Web status notifier

After a fun weekend at the Hackaday Super Conference I came out with a few toys. On Sunday I took part in the Particle IoT workshop, where they were kind enough to provide us all with a Particle Internet Button and ran us through setting these up and getting them to do things.

The board is essentially an add-on for the Photon board that can be purchased stand alone. The Photon is what you’re actually programming and includes a Wi-Fi module and runs an ARM Cortex M3 microcontroller. The Internet Button adds an accelerometer, four buttons, a buzzer and 11 RGB LEDs to the mix.Particle Internet Button

It’s powered by USB, and can be setup with just their cellphone app, although I had problems due to the terrible way my internet is setup at home (I have no control over it, yay rental). I ended up using the CLI via USB. This was necessary to give the Photon the Wi-Fi details to connect to the internet.

Once it’s connected to the internet, all the programming takes place wirelessly via Particle’s online IDE. There’re a host of examples and libraries to pull from, so it’s amazingly quick to get a simple program running, pulling data from the accelerometer and making everything flash multiple colours. Particle also has some built-in integration for internet notifications and interactions, being able to control aspects from Particle’s console and elsewhere.

Left: All Green - good Right: white is checking site, red means a site failed - bad

Left: All Green – good
Right: white is checking site, red means a site failed – bad

I didn’t really know what to do with mine, so after playing around with all the examples, I set out to make a notification device to tell me whether my websites are all running or not. I have four websites I’m interested in, they’re all on the same shared hosting package, but separate domains.

This project is nothing amazing, but was fun to do, and I was able to get it working in one afternoon. Most of the time wasted was just due to being out of practice with programming.


  • Polls four separate websites to see if they are running.
  • Shows a green or red light to indicate if the website responded correctly or not. Shows a white/orange light while it is checking it.
  • If a website fails a check, the buzzer tones.
  • Checks all websites every 10min.
  • Can trigger earlier check by pushing button 3
  • If one or more websites have failed a check, you can shake the controller to get it to recheck just the failed websites.

At the moment I don’t get very good information from the website. I basically hosted a plain html page on a subfolder of my websites which contains a string. I then compare the string the Photon loads to what it should be. I want to look into the package a bit more to see what info I can get and differentiate between server not found and other errors.

Online log: left it running overnight. a couple failures. I blurred website address as they're projects I'm still working on. Failure is due to cheap hosting I believe, not the Particle.

Online log: left it running overnight and saw a couple failures. I blurred website address as they’re projects I’m still working on. Failure is due to cheap hosting I believe, not the Particle.

The code isn’t very pretty, I’ve got silly little delays all over the place ’cause it’s working and I’m lazy and a lot of the stuff was imported and copied in. I may update it someday, but you can view it here. I made use of the Internet Button library as well as the HttpClient library (self confessed requiring work, but I can’t complain).

HP Envy 24 Review (with beats)

Having recently relocated, and sold all my worldly possessions, I was once again in the market for a second monitor. Back home I had been working with a Samsung 2333 which had served me faithfully for about 7 years. I amazingly paid about R1500 for it brand new, and since then I have been concerned by the ever increasing costs of LCD monitors.

One thing I’ve enjoyed about the US, is the large refurbishment market. It allows one, with minimal risk, to purchase 2nd hand products that have been through some form of quality and performance check. Generally receiving at least some form of warranty. And thus I ended up purchasing an HP Envy 24 with beats audio.

hpenvy24My only real requirement for the product was that it was at least 23″, full HD (1080p) and had either an HDMI or DVI input. I did a variety of Amazon and E-Bay searches before settling on this product. Originally finding it on E-Bay, I actually purchased it through the retailer’s own website: Refurb4Less.

I paid R1300 for this product, which new retails for well over $200. My only concern when purchasing this was that it had a stated quality of B-, indicating “Minor scratches on the frame, base and screen”. At the price though I was willing to accept this.

LHS with volume | RHS with power button and light up touch buttons

LHS with volume | RHS with power button and light up touch buttons

It arrived quickly, in less than 3 days, and I opened it with trepidation. However after putting the base together, and going over the screen several times, I can’t find any of the reasons it received a B- rating. And I’ve stopped looking, as this way I’m happier with my product :)

The screen includes beats audio speakers along the bottom, and provide marginally better sound than my laptop’s admittedly impressive sound. The screen came with a separate power supply, HDMI, VGA and 3.5mm audio cable.



The screen looks really nice, it’s clean and neat. It doesn’t rotate or lift, but does tilt, which is adequate for my needs. Picture quality is excellent. It boasts an IPS screen with amazing viewing angles, and my only complaints would be because we’re stretching a 1080p resolution across such a large screen. This is not HP’s fault, just the current market.

Plugs - RefurbishedSetup was easy, I plugged it straight into my laptop’s HDMI port, and sound and picture worked straight away. The screen has a form of touch buttons which I’m not a big fan of, but fortunately one only needs to use them once to set up. It has a power button just below the light, as well as a volume scroller on the other side of the screen which is a nice addition.

My only annoyance, is I’ll often leave my laptop playing music in the background and go do something else in the same room. However after 15min the screen goes to sleep, and with it power to the speakers. I know I can prevent this from happening, but then I’ll have to get into a habit of turning the screen off when I actually want to. So for now it just requires a regular mouse shake to keep things running smoothly.

so thin

so thin

The screen is way thinner than I was expecting, and the bezel is also super narrow (especially compared to my old LCD) and I’m really impressed with what I got. Would recommend.

It even has a headphone jack on the LHS of the screen.