Progress so far with a kids €21 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 Sibéal, 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 over enthusiastic kids 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.

 

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?

 

Controlling an i-racer RC car using a Wii Balance Board and @Raspberry_Pi

I love watching ideas bounce back and forward between people on Twitter and see them grow. The best for me recently started when The Verge posted a story about an OpenSource Android App which basically turned a Wii Balance Board into a Withings weighing scales, including RunKeeper and Fitbit integration. I retweeted it and it was picked up by Joe Desbonnet. He realised you could also do some interesting things with the Balance Board and a Raspberry Pi and started hacking. Which of course made me realise I could control the i-racer with it!

Here’s a wee video of it in action:

Apologies for the mobile interference in the audio. I was using my new SGS4 to SSH to the Raspberry Pi to kick off the Python code. The ConnectBot guys really need to fix the microscopic font on screens like the SGS4!

The car isn’t very fast in the video as the Lego added a lot of weight and I hardcoded the speed to 50%. We’ll try again next weekend using a lighter shell, full speed and tarmac instead of cobblelock.

Technical Nitty Gritty (not too Gritty!)

My initial experiments with the Balance Board did not go well. Eventually I discovered that the version of the cwiid Wii library that is available on Raspberry Pi (and Ubuntu etc) is not able to deal with the Balance Board. See this bug. I applied the patch and re-built my own deb files. To use them, just unzip them on the raspberry pi and install like so:

wget https://github.com/conoro/iracer-controllers/raw/master/iracer_balance_board/cwiid_for_balance_board.zip
unzip cwiid_for_balance_board.zip
sudo dpkg -i *.deb

The rest of the time was just spent tweaking the numbers so that I could interpret someone leaning in various directions irrespective of their weight. It’s still not great but works for me, a 7yo and a 6yo.

All the old i-racer Bluetooth code carried over unchanged from our Cheese Controlled Car. Follow the instructions there for installing various Bluetooth bits and bobs on the Raspberry Pi.

I was very surprised that I could talk to both the i-racer and the Balance Board over the same $2 Bluetooth adapter. I was sure I’d end up having to use two adapters.

You can, as ever, grab the code from Github. The only changes you need to make in the code are to set the Bluetooth MAC addresses of both the Balance Board and the i-racer.

Sidenote: The Android App was a dead end. It doesn’t work on Android 4.2 because Google decided to upgrade their broken Bluetooth stack and actually managed to make it worse.

Any questions, leave a comment.

Only if you really need it: Building those cwiid libraries yourself

sudo nano /etc/apt/sources.list

Add the following line:

deb-src http://archive.raspbian.org/raspbian wheezy main contrib non-free rpi

Then do the following:

mkdir ~/build
cd build
apt-get source python-cwiid
apt-get build-dep python-cwiid
cd cwiid-0.6.00+svn201/

Then edit these three files and add the changes from https://launchpadlibrarian.net/115501163/balanceboard.patch (or run “patch” if you are familiar with that)

nano libcwiid/cwiid_internal.h
nano libcwiid/process.c
nano libcwiid/thread.c
dpkg-source --commit
dpkg-buildpackage -us -uc
cd ..
sudo apt-get remove python-cwiid
sudo dpkg -i *.deb

Fun and games with LiPo batteries and cheap Android Tablets

The replacement LiPo battery arrived for my daughter’s Eken T02A ultra-cheap Android tablet yesterday. Only 2 weeks from China which isn’t bad.

As I mentioned before, the Eken’s battery life is catastrophic  Sometimes less than 45 mins. Even at idle, it dies in no time at all. I’m guessing one of its two cells isn’t actually functional.

The eBay replacement quotes 3500mAh which I’ll take with a big grain of salt. But at least it was bigger and heavier than the 2x “2000mAh” that were in the Eken.

$T2eC16hHJIQE9qUHu0VFBRZTd8Hccw~~60_12

Swapping out seemed to be a doddle, just two wires to solder. Most of the eBay batteries come with a PCM (Protection Circuit Module) built-in. This ensures that the battery never completely drains and also doesn’t get overcharged. Both are lethal for LiPo batteries.

I charged the Eken up with the new battery, which took forever on USB. But I saw this as a good thing. Then I pulled the power and tried to boot. Zip. Nada. Not even a flicker.

I started getting paranoid that the 2x batteries in the Eken were actually wired to give 7.4V and not 3.7V. But some multi-metering confirmed 3.7V on the originals. I wired them back in and the Eken booted fine. Weird. When I checked the new one disconnected from the Eken on the multimeter, it reported 3.7V too. But when it was connected to the Eken it said 0.8V.

Then I had a brainwave. I tested the connections on the battery side of the PCM. Aha, 3.7V. So something weird was happening with the PCM. My worry was that is was actually doing it’s job and the battery couldn’t supply enough current to power the Eken.

But deep intake of breath and I swapped the PCM from the old battery and put it on the new one. Result! Eken booted and battery did not explode or melt.

I’ve been unable to figure out if all PCMs are generic for a particular voltage or if they are specific to a battery type. I’m hoping the former. Anyone know? I’d hate for something to go wrong with this one.

And now for the really good news. 2.5hrs mixed usage with the new battery and we’re still at 64%!

 

An evening in the company of the delightful Mr Samsung Galaxy S4

I’m sure you’re dying to know how I’m getting on with the S4. How many of you struggled to sleep last night with the anticipation?

Where to start? That screen, OMFG that screen. 5″ of bright full 1080p HD. I played the classic Big Buck Bunny 1080p video and everything was crisper than crisp. I haven’t used it in bright sunlight yet but I’m sure it’s as crap as all modern phones.

How does the phone look? I couldn’t give two hoots. I buy phones as tools, not fashion accessories. Having said that, I wouldn’t be seen dead with a white one ;-)

gal_03

The lightness of the S4 can be disconcerting when the buzzer gives haptic feedback but I’ll happily take lightness over a brick in my pocket any day. Oddly, the phone doesn’t feel big at all. In some ways it feels smaller than the HTC Sensation.

Whilst I always hated HTC Sense and far prefer the Stock AOSP Android experience, I don’t find TouchWiz that objectionable. Given that I spend 95% of my time on a phone inside apps, it doesn’t really affect me that much. It still has the powerful system-wide sharing features of Android and the still excellent (but now very cluttered) notification bar.

Of course it comes with a ton of Samsung junk Apps, just like HTC. I tried them all (Hub, Fitness, Story Book etc etc) but just can’t see the point of using single-vendor apps when I can use third-party ones from Google, Endomondo, Evernote or Amazon and bring everything with me if I switch to another vendor in the future.

Games, as you’d expect are blazingly fast and look gorgeous. I did find one or two that crapped out at launch tho. I’d love to know why.

I’ve read a lot of negativity about the “gimmick” features involving hand swipes and eye tracking but I was surprised to find that I really liked both.

By tracking the location of your eye, it can auto-scroll web-pages etc when it notices your head tilt. I was easily able to start, stop and rewind a web-page using it. The big down side is that it only seems to work in Samsung apps. I’d love to see this in Twitter apps in particular.

The hand-waving is more gimmicky and allows you to scroll through photo albums etc. I just liked the ability to check the lock-screen for messages/missed-calls by waving my hand over the phone on my desk.

I’m looking forward to trying out Bluetooth 4.0 on my Fitbit. I don’t think the sync is currently working but they said on Twitter that they are going to test this week. I also don’t know if Android finally has BLE support to avoid big battery drain on connected devices. I’m a big fan of the idea of NFC for payments so I’ll give that a go when I have a chance.

Another gimmicky thing that I like is the IR blaster built into the headphone socket. My eldest daughter thought it was pointless but I liked being able to change channel/volume on the TV without hunting for the remote.

One annoyance, not specific to the Galaxy is the term “16GB”. This is total storage so you only start out with 9GB user storage, which I have already filled. Hence the absolute need for an SD card slot. I have a 32GB microSD on the way from Amazon. Side-note: This is a UHS-1 card which has 48Mbs throughput in certain cameras. Standard Class 10 SD is only 10Mbs. So I’d love to know if Samsung has implemented a UHS interface on the S4 or if it’s normal SD.

A big word of warning on the Dropbox integration. I just discovered that 4GB+ of the storage used on the phone was because it decided to auto-sync everything from Dropbox. Everything! Eventually I ran out of storage on the phone and it stopped syncing. To avoid this, disable the “DocumentSync” feature in Settings->Accounts->Cloud. Stupid stupid default Samsung, what were you thinking?

The phone is LTE and it should be fun to check out the download speeds the next time I’m in London. Given that I’m in Old Chapel, I can’t even get GPRS without major arm-waving. I’m looking forward to the 30Mbs that Pat Rabbitte has personally guaranteed we’ll all have, as a minimum, by 2015.

And now, back to reality.

I haven’t had much chance to try out the camera. But the few initial pics were superb. I’ll definitely be giving 1080p 30fps video a try out this week. Here’s a quick example in bad light in my office:

20130428_201032

A few other notes. The charger is 2 Amp and a useful compact size. The charger cable useless at a metre too short. The phone uses microSIMs so make sure you leave the shop the right kind.

I’ll try out some of the more obscure features in the next few weeks and then promptly forget about them.

Vodafone will force you to “upgrade” to Red Essentials at a minimum if you are on an older cheaper plan. So I’m now paying €5 a month extra for 500MB a month less data. You stay classy Vodafone.

One final note to Samsung. It would be a huge help if you’d do a phone-specific Samsung-branded sports armband, particularly since you now have this sports app. I’m really shooting in the dark with ordering on Amazon.

Look, you can’t really go wrong with most mid to high end Android phones nowadays. If you get the S4 or the One or the Z or the Nexus4 or the whatever,  you’ll probably be more than happy. The S4 packs an amazing raft of features into a pleasantly small package. I think I’m going to be happy with it for the next two years.

 

My Smartphone evolution from N95-8GB to Samsung Galaxy S4 #SGS4

smartphones

My first actual “Smartphone” was a Nokia N70 but it has the dubious pleasure of being the only phone I ever lost. The one that really got me using Apps and understanding the importance of SoLoMo was the classic N95-8GB which I loved despite its numerous flaws. It was also the most I ever spent on a phone.

When I realised that Android would be an unstoppable juggernaut, I got a HTC G1 back in Nov 2008, shortly after it was released. Still a fine phone and I do love that slidey keyboard.

I followed that with the HTC Desire which was many people’s first Android phone and still a firm favourite with lots of them. Our 13 yo has had it for the past 2 years and the only thing he dislikes even now is the lack of storage to install Apps.

I bought an Orange San Francisco (ZTE Blade) for my Dad as a test intro to Android. He took to it no problem and now has a Nexus S. Our 11 yo has had the Blade for the past year. A shockingly solid piece of kit for something that cost £99 without contract.

In Aug 2011 I was chuffed to learn I had won a HTC Sensation from Vodafone. That’s what I’ve been using until today. It was and is a superb piece of hardware let down by pretty awful software from HTC and some really ropey build quality. It is also unfortunately not that popular with the creators of custom ROMs and I’ve never had a ROM which works 100% reliably with all the features. Bluetooth is a particular pain in the ass. But the Cyanogenmod ROMs still beat anything HTC themselves released.

And then we get to 2013. It’s currently a three horse race for most people between the HTC One, the Sony Experia Z and the Samsung Galaxy S4. On paper based on raw specs, the S4 wins. The other two are better looking phones and apparently are better built. I don’t trust Sony in general with maintaining products and they always overprice, so the Z is out. Loyalty should have me buying the HTC One but three drawbacks have forced me into the arms of Samsung for the first time.

The first, and worst, is that you cannot ever replace the battery in the One. This isn’t like the iPhone where it’s awkward and requires tools. You have to physically destroy the HTC One to get at the battery. In a world where people are starting to return to the idea of repairability in products and owning things for longer, this is a disastrous decision by HTC. I have had spare batteries in my pocket for my phones since N95-8GB days, I can’t go back to worrying about my phone running out of charge.

Add to that the lack of an SD Card slot and a weirdly de-specced 4MP camera and I’m afraid HTC will be sold for spare change to someone like Microsoft before the end of the year.

So SGS4 it is. Hands-on in the shop was a very impressive experience. But I haven’t even turned it on at home yet. More when I do.

Your prayers answered, Old Chapel temperature server now online

I must get 20 emails a day asking the same question: “Conor, what temperature is it, right now, outside your office window?”. Thankfully, after literally several minutes work, you have your answer.

Courtesy of an Arduino Nano, Ethernet adapter and Sparkfun temperature breakout board, I can exclusively reveal the temperature is 12.44°C and 54.39°F i.e. about 2C higher than reality.

To get something more accurate I’ll need to put the sensor away from the building, away from the ground, out of direct sunlight and with good air flow. Then I’ll auto-post the values to Open Weather Map and COSM.

DSCF2602

I was genuinely surprised on Sunday at the level of interest in the Arduino web-server I mentioned. I think a mixture of the tiny cost and 8-bit nature of the whole thing intrigued people. It was also trivial to put together with some sample code. The only difficulty I’ve found with Arduino in general is handling floating point values easily.

nano2

Of course it doesn’t really make sense to have low-powered nodes being read by anyone. As several people pointed out on Sunday, a DDoS (heck, even a DoS) attack would be ridiculously easy. The nodes should either be reporting to central server(s) or queried on a regular basis by a small number of systems. That’s phase 2 for my little side project and it’s a bit more complex than temperature. More updates in a few weeks.

 

What the inside of an €88 Android Tablet looks like

My daughter’s Eken T02 is still going strong after nearly a year but it still has the same two problems as ever. [a] the accuracy of the touch screen is awful and [b] it barely lasts 45mins on battery.

I don’t think I can do anything about the first problem but I decided last week to sort out the second one. Particularly considering Scribblenauts is now fiiiiiiinally available on Android (currently requires a US VPN, Market Enabler, Amazon App Store and a US virtual credit card. Slick ;-p )

IMG_20130421_151828

I popped it open quite easily by removing 4 screws and a few plastic tabs. It’s surprisingly neat inside but has a really weird smell!

Obviously the batteries are garbage based on how long they last so I ordered a replacement on eBay. It’s a “3500mAh” unit with the usual proviso that Chinese mAh tend to be a bit different from the mAh the rest of the world measures in. It’s also the usual China story where they’ll arrive at some indeterminate point in the next few weeks. Should only take a minute to swap them. Fingers crossed it sorts the problem out.

I’ll let ye know how it goes.