08 Jun 2013, 13:03

What does this inside of a dead Fitbit One look like? This:

#“What does this inside of a dead Fitbit One look like? This:”

After my Fitbit One took a swim in a full washing machine cycle, it died. Many attempts with rice and pampers and warm air over a few days failed to bring it back. The utterly fantastic customer support people in Fitbit then offered me a free replacement! The only tiny downside is that they don’t deliver to Ireland so I needed to use a Parcel Motel address. It just arrived yesterday so I thought I may as well have a look inside the dead one.

It’s bloody well glued together so it took a while. I could instantly see that there was no hope that it would have recovered. Horrible green corrosion on many places on the motherboard.

2013-06-07 17.08.52

The main CPU/MCU is a ST Microelectonics ARM M3 (STM32L151QCH6) running at 32 MHz with 256KB flash. Same one as the Nike Fuelband, interestingly enough. I figure its built-in USB interface is a real selling point.

The LiPo battery is the smallest I’ve ever seen and I hope I can salvage it. Also the tiny buzzer motor might be usable somewhere.

2013-06-07 17.08.41

The Nordic Semiconductor nRF8001 IC is very interesting. It’s a full-blown single-chip Bluetooth 4.0 BLE (Low Energy) solution. I’ve been looking around for hobbyist BLE chips/dev-boards recently but they are too expensive. I’d love to see BLE used in home automation setups.

Our experience with tracking down a lost Fitbit inside the house using BLE sync from my phone to my wife’s Fitbit has made me a big fan of the technology! It would never ever have been found without being able to send alarms and triangulating in on where the lost device was. I eventually found it behind the lining inside a travel case in the airing cupboard after it had fallen from my wife’s armband in the middle of the night as she grabbed new bedclothes for one of the children. The last time something went missing in the airing cupboard, we lost a Nintendo DS for a year.

I’d love to see the next Fitbit have all the functionality of the One but also be 100% waterproof. Maybe simple capacitive touch instead of a button? That and the fact that the sleep timer has zero intelligence around auto-turn-off are the only criticisms I can make of an otherwise brilliant device. The recent update allows it to sync directly with my SGS4 so travelling will no longer be a “dark period” for up-to-date tracking.

Do yourself a favour, buy one and shock yourself when you realise just how inactive you really are.

 

07 Jun 2013, 16:59

Is the 10 Lidl Soldering Iron worth it? I think so.

#“Is the \u008010 Lidl Soldering Iron worth it? I think so.”

I grabbed one of the Lidl Soldering Iron Kits yesterday in Dungarvan. Video below with my thoughts. Apologies for some of the stuff being off camera.

httpv://youtu.be/UrQyGAgDACo

Overall, at 10 it is totally worth a punt if you don’t have an iron already.

Regarding the non-standard tips, it turns out there are compatible replacements out there. This seller on eBay has some. Also, Farnell do them for 1.15 each, but with the usual proviso that it’s a minimum 20 order with them, so you’ll need to find some other stuff to buy on the site. Shouldn’t be hard :-)

Maybe next time around, Lidl could go with standard tips, dump the “burning tips” and include some parts to do a simple project.

As I mentioned in the video, a huge part of my DIY and electronics gear comes from Lidl and Aldi. I think there is a real opportunity for one/both of them to do a lot more in the Maker area. An Arduino Start Kit for maybe 19.99 would fly out the door once word-of-mouth got started. I predict a 3D Printer “Thursday Special Offer” sometime around 2016.

05 Jun 2013, 08:27

Connecting an Arduino to Raspberry Pi for the best of both worlds

#“Connecting an Arduino to Raspberry Pi for the best of both worlds”

Rather than struggle with the very basic unprotected IO pins on the Raspberry Pi and the lack of real-time performance in Linux, the ideal setup for many real-world-interfacing projects is Raspberry Pi + Arduino.

After pricing a multitude of combinations of microcontroller boards and Wifi adapters, I found that the Raspberry Pi + USB Wifi + Arduino is the absolute best value for money if you need both wireless internet access and easy sensor data handling. (Note: I’ll be investigating the Beaglebone Black soon to see how it compares).

2013-06-05 07.32.44

There are four basic ways to connect Arduino to Raspberry Pi:

  1. Buy an add-on board like the Gertboard which has an Arduino compatible IC on it. Pricey.
  2. Plug a standard Arduino like an Uno or Nano into the USB port of the RPi. This is by far the easiest method and minimises wiring and hassle. However it requires the more expensive Arduinos.
  3. Use a USB to Serial adapter with a cheaper/smaller Arduino like a Pro Mini or a self-made Shrimp. This is the best DIY option and has the same advantage of method 2 that you can power the Arduino/Shrimp from USB. For a Model B RPi, I’d recommend this route.
  4. Use the Serial Pins on the Raspberry Pi to connect to a cheaper/smaller Aruduino like a Pro Mini or a self-made Shrimp. This is theoretically the cheapest method but by far the most hassle. This is also the best method if you are using the cheaper Raspberry Pi Model A and its single USB port is being used for Wifi.
I won’t go into the details of 1 since I haven’t done it. 2 and 3 are plug n play and require no instructions. 4 is the awkward one, so here are some notes to save you the hassle I went through.

The basic steps are identical to those described here. In hardware terms You connect the 3.3V/GND/TX/RX pins on the Raspberry Pi via a level converter to 5V/GND/RX/TX pins on an Arduino. Alternatively you buy a 3.3V Arduino and avoid the need for a level converter. I powered the Arduino separately to avoid overloading the RPi pins (this seems to be causing intermittent issues with RPi booting tho).

RPi software changes involve commenting out this line in /etc/inittab with a #

T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
and removing the following parts of the one line in /boot/cmdline.txt
console=ttyAMA0,115200 kgdboc=ttyAMA0,115200
You also need to create a link to the serial port so that the Arduino IDE recognises it:
sudo ln -s /dev/ttyAMA0 /dev/ttyUSB9
That last step has to be done after every reboot. I should find a way to make it permanent.

Unfortunately this still isn’t enough to be able to program the Arduino from the IDE running on the RPi. We need to be able to toggle the reset pin on the Arduino to initiate programming. Normally that’s done by the USB-Serial adapters or the USB-Serial chip on the more expensive Arduinos. To do this in our setup requires following the instructions herewhere one of the Arduino tools is wrapped in a script which does the pin toggling at exactly the right moment. In summary:

  1. Connect Pin 11 (GPIO 17) of the RPi to the DTR Pin on the Arduino Pro Mini via the level converter
  2. Run the following commands to download and configure avrdude-rpi:

sudo apt-get update
sudo apt-get install python-dev
sudo apt-get install python-rpi.gpio
wget https://raw.github.com/deanmao/avrdude-rpi/master/autoreset
wget https://raw.github.com/deanmao/avrdude-rpi/master/avrdude-autoreset
sudo cp autoreset /usr/bin
sudo cp avrdude-autoreset /usr/bin
sudo mv /usr/bin/avrdude /usr/bin/avrdude-original
sudo ln -s /usr/bin/avrdude-autoreset /usr/bin/avrdude
sudo chmod 755 /usr/bin/avrdude-autoreset
sudo chmod 755 /usr/bin/autoreset

I was getting a warning about “Channel already in use” from /usr/bin/autoreset so I added this to the end of the file:

PIO.cleanup()
Note you must run the Arduino IDE as root from now on. i.e. in LXTerminal:
sudo arduino
If you haven’t already, reboot the RPi to make the earlier steps kick in. You should now be able to program whatever you like on to the Arduino using the IDE running on the Raspberry Pi. I even have this running headless by connecting to the RPi across the network using the Windows Remote Desktop Connection tool.

2013-06-05-084448_1920x1080_scrot

Any questions, pop them in the comments.

01 Jun 2013, 14:52

Replacing a broken Samsung Google Nexus S screen - a total doddle.

#“Replacing a broken Samsung Google Nexus S screen - a total doddle.”

My Dad put a big crack is his Nexus S screen a good while back so I promptly ordered a replacement from eBay. I finally got the chance to fit it this morning and was thrilled that I didn’t manage to completely screw it up.

2013-06-01 12.38.10

A few useful notes:

  1. There are two major types of Nexus S. His is an i9023
  2. Apparently there are also two different types of i9023 screen which are not interchangeable. Luckily the one I ordered just worked.
  3. It’s really easy to take the phone apart
    1. Pop the back off
    2. Remove a few screws
    3. Remove the inside back, popping off the snap-connectors as you go
    4. Be careful popping out the buzzer
  4. You remove the screen+digitizer module by applying lots of heat with a hairdryer. Use a plastic knife or plastic phone tool to apply leverage from the side and work your way around. Eventually it’ll separate.
This video shows how to do it for the other Nexus S model but the steps seem almost identical.

The only bit that had me worried was the adhesive. It was pretty much ruined by taking the screen off. I went to the local DIY store an bought a selection of double sided tapes and contact adhesives.

I the end I used some ALDI thin-ish double-sized foam tape to connect the top and bottom parts where the earpiece and buttons are. I then used simple Unibond no-thickness double-sided tape to cover the back of the screen. Together they joined the screen to the main body of the phone perfectly.

Then it was just a quick reverse process of clicking back on the connectors and putting screws in. It worked perfectly first time. And I had no parts left over!

 

22 May 2013, 08:20

Wearable tech, fitness, health and the 'Quantified Self'

#“Wearable tech, fitness, health and the \“Quantified Self\“”

Nice quick intro by iJustine into this entire Quantified Self area. The section about using all of the data for predictive prevention of problems really caught my attention.

httpv://www.youtube.com/watch?v=pjKA0-PSA9k

I’ve obviously been into the whole SoLoMo thing since first getting my hands on an N95-8GB in 2007 and I’ve been generating lots and lots of location data since then. But location is really only step zero. It gets far more interesting the more things you measure, which is why I also tried my first fitness tracking app on the N95 back then too.

Now I spend my day with a Fitbit One connected to my t-shirt; manually entering my weight, body/visceral fat, BMI, muscle from Omron Karadascan to Google Docs; having every run/walk tracked by RunKeeper or Endomondo; and, from this week, having an array of sensors on my desk measuring temperature, humidity and light. The latter set will soon be stored live to the web. My SGS4 has a barometric pressure sensor too and will be the “base-station” for all my experiments in this area.

One bit I’m missing is heart monitoring. I have an ancient chest-strap monitor from Lidl but it has no computer interface and is very uncomfortable. iJustine showed off an Adidas smart-bra which seems to have the functionality I need. Perfect for my moobs. Now I just need to find the male equivalent (or buy one and modify it :-) ). Alternatively I could try making one with some conductive cloth and an Arduino or will I end up in DSP filter hell? A fingertip sensor like this might be fine for some scenarios but you’re hardly going to wear it 24x7. Any other suggestions?

The only way you can improve is by measuring. I think we’re in for a very interesting couple of years and I can’t wait to see what people come up with.

UPDATE 1: According to comments on the Sparkfun site, that Pulse Sensor can be used on many parts of the body, including the chest. As I haven’t found any other Open Hardware projects that do heart rate monitoring, I think I’ll take a punt on it for $25.

22 May 2013, 07:08

Separated at birth - Philips VR512 and XBOX One?

#“Separated at birth - Philips VR512 and XBOX One?”

The VR512 cost me around 399 in 1992 in the Philips employee sale. A staggeringly good top-of-the-range VCR that did sterling service for over a decade.

The XBOX One is a mid-range PC with a small hard disk and VR512 inspired case. Oh but it has Skype. Like every PC since 2003.

separated_at_birth

19 May 2013, 18:40

Check out Scratch for Arduino S4A. Easier electronics for kids

#“Check out Scratch for Arduino (S4A). Easier electronics for kids”

Whilst I’m a huge fan of the Arduinoinitiative(is “initiative”the right word?), its programming language, Wiring, is still fundamentally C with most of its power but also most of its difficulty.

C was the fifth language I learned after ZX Spectrum BASIC, Forth, Z80 assembler and Fortran (spit). I then spent the next 13 years using little else. But here I am still struggling to read a number from a sensor, add it to an ascii string, send it over a wireless link and then convert that back to a number at the far end. The wireless link bit is trivial using VirtualWire, whilst the pain is all in the int/char/char */char []/String rubbish that would make most kids give up after an hour of hair pulling. And don’t get me started on Null termination.

That’s why I’m very positive about both Modkit and S4A. Modkit is a pay-for in-browser Scratch-like environment and I’m impressed with it, but I’ll blog about that another day. Today is about S4A which came out of a Citilab team in Spain. It’s a modified version of Scratch that can interact with Arduino boards and electronics connected to it. I tested using an Arduino UNO and it worked perfectly.

s4a

Getting started is very easy. You download some code for the Arduino which you put on the board using the usual Arduino IDE. Then you install S4Aon your PC and run it.

There are some basic examplesavailable to learn the core ideas.The examples all come with simple wiring diagrams which are appropriate for anyone with one of the UNO Starter Kits.

It’ll be interesting to see what we can do beyond simple button+led. I’m trying out some of the servo stuff with Oisn this afternoon.

19 May 2013, 15:04

Remote Control implementation for an RC Car - Part 1

#“Remote Control implementation for an RC Car - Part 1”

There are many ways you can add remote control to a project. Off the shelf modules; Bluetooth; 2.4GHz NRF24L01+ transceivers; 433MHz/434Mhz modules or even Infra-red.

remote_control

My plan with our ZL-4 el-cheapo RC car was to use an Elecfreaks Joystick Shield, an Arduino board and theNRF24L01+ modules mainly because [a] the joystick shield has a connector for one and [b] I want to use them in another potentiallycommercialproject and thought it would be a good learning exercise. They are also stunningly cheap at 1.26,includingshipping, for each transceiver.

Unfortunately Idiscovered that the Adafruit Motor Shield on the RC car uses up a ton of the pins on the Arduino and makes it very hard to add theNRF24L01+. In particular it uses the SPI pins which you need to talk to theNRF24L01+.

So I went with Plan B which was the 433Mhz modules. These things are fab. They work in the unregulated ISM band like most weather stations etc and, like the NRF24L01+,are gob-smackingly cheap - 1.97 for the receiver and 2.14 for the transmitter. When I see people creating really simple projects but with 2x 20+ Zigbee modules, I just don’t understand it.

The 433MHz modules main advantage relative to theNRF24L01+ is that they can cover longer distances with a properly setup aerial. The main disadvantages are that they generally need that aerial, they have a very low bit-rate and you have to deal with most of the error correction etc yourself.

What transforms these modules into something pretty spectacular is the VirtualWire library for Arduino. This takes care of all the low-level transmit/receive code and you have to do little more than the equivalent of a print statement. Just think about this. You can send any information you like over hundreds of feet using 4 worth of electronics by simply calling:

vw_send((uint8_t *)msg, strlen(msg));
No Wifi or SMS needed! Of course this is a broadcast message and anyone can pick it up but who cares.

The one thing we do have to figure out is what happens when multiple devices are broadcasting locally. Will they interfere with each other? I know VirtualWire has CRC checking but that’s not much use if every message is corrupt.

For the remote control I have created an extremely simplistic “protocol”. The transmitter sends out the following every 200ms:

XnnnnYnnnnAnBnCnDn
Where Xnnnn is the X-axis of the joystick from 0 to 1024, Ynnnn is the Y-axis of the joystick from 0 to 1024, An is button-A 0 or 1, Bn is button-B 0 or 1, Cn is button-C 0 or 1 and Dn is button-D 0 or 1.

remote_control2

We are now successfully receiving and interpreting those messages on the RC car and doing forward/reverse. The bit we have to figure out is turning, as the car doesn’t have any steering.

More updates in a few days when we crack that nut. And I’ll obviously have to add some sort of “addressing” for the scenario where more that one RC car is being controlled in the house.

16 May 2013, 20:35

Progress so far with a kids 21 self-assemble Remote Control Car

#“Progress so far with a kids \u008021 self-assemble Remote Control Car”

After our CDG security debacle in February, where the French confiscated the kids’ Nerf guns due to their foam-dart plane-downing properties, I promised to find them some treats as replacements.

First up was Sibal, who indicated interest in RC cars. Rather than spending a fortune and discovering she didn’t really like them, I ordered a 21 kit from DX in China. It’s a very simple 4WD, 4-motor, two layer kit with no electronics or controls at all. The idea is that you add an Arudino, some form of motor control and some form of remote control yourself. (Note that brown stuff is a paper coating!)

sku_152992_1

The pics on DX have the motors backwards, so our first session was a complete flop as we tried to attach them and the wheels.

In the second session, we put them all on the right way round and screwed the two layers together. It looked great and we wired some batteries to one motor to make sure it worked ok.

2013-05-09 08.30.31

I then did some reading on the Adafruit Motor Shield clone I also got from DX and connected it onto a Funduino Arduino UNO clone.

sku_138600_1

I installed some of the Adafruit simple test code and then the two of us wired up the 4 motors. All of them spun. In random directions :-) A quick re-wiring and they all spun slowly the same way. After re-reading the code and trying a few different things, I got it running full speed. It’s pretty quick.

sku_150802_1

Then disaster struck a few days later as some overenthusiastickids drove it at full speed into a wall and shattered the lower plastic layer. Tons of metal brackets and epoxy resin later and it was stronger, stiffer and better than ever.

car01

Last night we focused on bling and added some Lego and a teddy.

car02

I didn’t like using 8 rechargeable AA batteries and they took up a lot of space so I investigated proper RC Car batteries. HobbyKing seems to be the best site online for this kind of stuff so I ordered a 2200mAH Turnigy battery and charger from their UK store. I used an old PC ATX PSU to provide 12V to the charger.

car03

Due to HobbyKing’s high delivery charges outside of the UK, I used Parcel Motel for the first time. Great service which provides you with a UK address and a collection location. Shipment from the UK last Friday arrived in Topaz on the Bandon Rd, opposite Dunnes on Wednesday.

As LiPo batteries can be killed by over-discharging, I’ve also ordered a low-battery alarm from their HK store. And finally I grabbed some of the right XT-60 connectors from an eBay seller in Donegal. I’ll report back on battery life.

Next up is a remote control. We’re starting with an Elecfreaks Joystick Shield.

sku_140957_1

It’s very simple to program and has a connector for an NRF24L01 2.4GZ Transceiver. I’ll have to solder the other transceiver on to the motorshield as it doesn’t expose expansion pins at all. Then I’ll create a simple directional control protocol to run over that link.

sku_150867_3

Once that’s done, we’re going to investigate line-following code and ultrasonic obstacle detector code.

So far she loves it and her main questions is whether it’ll be faster than Fionn’s i-racer.

Whilst the cost of all the parts is adding up to be more than just buying a full RC kit, the great thing here is that once she tires of the car, we have a ton of re-usable tools/parts to build whatever we want next.

16 May 2013, 08:11

Using NFC to connect your #SGS4 phone to your car's Bluetooth

#“Using NFC to connect your #SGS4 phone to your car’s Bluetooth”

I’ve been wanting to play with NFC for ages so when I got an SGS4 recently, my chance finally came. I ordered a pack of 10 stickers from Shop4NFC.com in China for $8.99 and they arrived about a week later.

To try them out, I installed the NFC Task Launcher and Tasker Apps. The former enables you to do things like change Wifi settings, volume, display, sync email or even Tweet when it detects a configured NFC sticker. One of the most common use cases is for people to have a sticker at work which puts the phone on mute when you lay the phone on top of it.

Tasker is a general automation app that is not reliant on NFC and can do a ton of different complex things based on context and actions. The reason I installed it is that it can do more complex stuff with Bluetooth than NFC Task Launcher.

I was really disappointed to discover that Bluetooth on the SGS4 is as buggy and glitchy as every other Android phone I’ve owned. Google’s announcement at I/O yesterday that they are going to improve things this year doesn’t convince me. They’ve had 4 years to get it right. The fact that they broke access to Wiimotes etc in 4.2 tells you just how bad they are at Bluetooth.

The place where this causes me the most grief is in the car. All I want is for the bloody phone to auto-connect over A2DP to my Lidl Car stereo when the car is on so I can play my podcasts and listen to music. In theory the SGS4 can do this but simply fails to, 9 times out of 10. HTC’s Android was similarly bad. AOSP/Cyanogen in some versions worked perfectly but it was a crapshoot whether any version would work or not.

nfc

So I thought NFC might solve this. Rather than letting Android itself auto-connect, use Tasker to force a connection. And whaddya know, it seems to work. I tap the phone off the sticker after I turn on the ignition and it connects over Bluetooth to the car stereo. It’s only failed once in 10 and I’m pretty sure that’s because I didn’t hold the phone to the sticker long enough.

Actually, that’s really the only downside of NFC that I’ve seen so far. A swipe or momentary tap is not good enough, it requires a very distinct touch and hold for a moment before the tag powers up and sends its ID info to the phone. You can tell by the audio cue on the SGS4 whether it worked or not.

Now I need to find uses for the other 9 stickers. Suggestions?