Aquarium controller


I’m working on a prototype aquarium controller and fish feeder, I keep updating this post with the progress. As of now the project is built using Node.js and Johnny-Five and has the following features:

  • Automatic fish feeding with 8 slots
  • Water level monitor
  • Light scheduler
  • Motion activate night lights
  • Temperature sensor

Current Hardware:

  • Arduino Uno R3
  • Raspberry pi +Wifi
  • PIR motion sensor
  • Sonar sensor
  • Continuous Servo


I’m working on an enclosure for all the components that can be mounted to the top of the aquarium.

Foosball Scoreboard using node and Johnny-Five


We are quite competitive when it comes to foosball at the office, we try to mentally keep track of scores and wins over a few weeks span but that never works out. We wanted a method of tracking points that din’t involve us writing it down.

This is when we came up with the idea of building a mobile website that we would use on our phones to track game scores and stats.

Being an amateur hardware hacker, I decided to take it a step further and automate the scoring with an Arduino (To be replaced with a raspberry pi on final version) to send and receive information from the table to web page scoreboard, I used the Socket.IO library and Johnny-five library. It allowed me to capture events from the Arduino sensors mounted on the table and send them in real time to the scoreboard and also form the scoreboard back to the Arduino.


Server to Arduino communication

Using the Johnny-Five library, when the ball goes down the goals it brakes the laser and triggers a switch that lets the server know that a point was scored.

Server/Client communication

We are using to send information from the server in real time to the scoreboard web page.


Counting points

Counting PointsTo count the point a pair of lasers and photo resistors wired to an Arduino where used as buttons to trigger a function in my application to add points for each team. When the ball cuts the laser it interrupts a switch and Johnny-five on the server records the change of state and triggers a goal!



The project is still ongoing but currently on hold as other priorities have taken over but work on this should resume shortly.

Raspberry Pi tweet temperature


I wrote a small python script to tweet my aquariums temperature so that i can monitor it as I raise the temperature slowly to 86°F to fight an ich outbreak :-( .

Updated the code, had to add the temperature tuple in a new variable using srt(temp). Code is now working and running on my Raspberry pi.

Tutorials used to write this Raspberry twitter tutorialDS1820B tutorial

[cc lang=’python’ ]

#!/usr/bin/env python
import os
import sys
import tweepy
import glob
import time
CONSUMER_KEY = ‘secret’
ACCESS_KEY = ‘secret’
ACCESS_SECRET = ‘secret’
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)
api = tweepy.API(auth)

cmd = ‘/opt/vc/bin/vcgencmd measure_temp’
line = os.popen(cmd).readline().strip()
temp = line.split(‘=’)[1].split(“‘”)[0]
os.system(‘modprobe w1-gpio’)
os.system(‘modprobe w1-therm’)

base_dir = ‘/sys/bus/w1/devices/’
device_folder = glob.glob(base_dir + ’28*’)[0]
device_file = device_folder + ‘/w1_slave’

def read_temp_raw():
f = open(device_file, ‘r’)
lines = f.readlines()
return lines

def read_temp():
lines = read_temp_raw()
while lines[0].strip()[-3:] != ‘YES’:
lines = read_temp_raw()
equals_pos = lines[1].find(‘t=’)
if equals_pos != -1:
temp_string = lines[1][equals_pos+2:]
temp_c = float(temp_string) / 1000.0
temp_f = temp_c * 9.0 / 5.0 + 32.0
return temp_c, temp_f

while True:
localtime = time.asctime( time.localtime(time.time()) )
tempvar= str(read_temp())
tweetmytemp = tempvar+” “+localtime+” @sebastienb”


#tweets Time, temp and @myuser every hour

A few days with the Fitbit Flex

Friday May 17th, I picked up a Fitbit Flex from Target. I had one in my Amazon shopping cart for over a month now waiting for it to be in stock. Being a little busy this week, I missed out on ordering and they were now out of stock. Getting started with the Fitbit Flex was very simple; from taking it out of the packaging it took about 20 minutes to get a full charge and sync it with my phone. From there it, was ready to go on my arm.

First Test

To test out its accuracy, I took it on a walk with my dog, Dex, and RunKeeper on my phone. After the walk, both RunKeeper and the Fitbit had different values as for how many calories were burned and the distance traveled but they were close enough. I will continue logging the stats from both RunKeeper and Fitbit and update this post on friday.

fitbit walk screenshot Run Keeper screenshot


Sleep Monitoring

Setting the Fitbit in sleep mode is fairly easy, tap a few repetitive times until the 2 sets of lights alternate and your in sleep mode. When you wake up, do the same and you are out of sleep mode. On the iPhone and computer you get a graph showing details of your sleep; how long you slept, how long and when you were agitated, and the time you went to bed and got out of bed.

2013-05-18 17.44.18

Social Aspect

A lot of friends now have one of the few fitness trackers out there but unfortunately when I did a search for friends on facebook that also use the Fitbit results showed that my friends where using those other devices (Nike Fuel Band and Jawbone Up). This factor might be a good reason for me not to switch to the Jawbone Up but hopefully they will come out with one that syncs wirelessly.

Fb friends using Fitbit

Battery Life

The Fitbit lasted a full 6 days on a full charge even with me checking it a lot more then I should with regular use I gave me an extra 24 hours over the estimated 5 days. Thats one of the advantages of Bluetooth 4.0, it uses very little battery. Charging the device with the included charging cable takes less then 30 minutes so its easy to put it to charge while I’m working on my desk.

Charging cable for fitb bit flex




  • Meal input library seems to find what I need and let’s me input what’s missing. So far only thing missing as a can of Fanta soda.
  • The silent alarm feature is great and wakes me up quickly and is less of a shock then my phone.
  • Sleep monitoring is good as I’m sure I don’t get enough sleep and would like to improve on this.
  • Step tracking with calories burned and distance were pretty close when compared to RunKeeper which uses GPS
  • Wireless Syncing the main reason why I went the Fitbit instead of the Jawbone Up.
  • The new web dashboard looks and works great and it seems that they are adding new features to it.



  • At some point I checked the app and my calories burned for the day went down to 15 from the 2000 it was a few hours earlier then after a while it came back up to where it should have been.
  • While taking a shower the lights blinked as if i had tapped it but it wasn’t the case. Not sure if the water drops were interpreted as taps or if my hand hit something in the shower by mistake.
  • After showers a little water stays inside the band where the Fitbit slips in. It doesn’t affect the usage of the flex but I try to wipe it after or take it off before taking a shower.


Wrap up

When I purchased the Fitbit i was still on the fence about getting it or the jawbone up but now I’m sure that the fit bit works better for me. I really dont see my self taking off the Jawbone up to plug it in to sync, for a company that specializes in bluetooth headsets you would think that they would have the lead in wireless syncing. My only issue with it for now is that everyone that I know who has a fitness band is either with jawbone or with Nike so I haven;t been able to test the social aspect of the Fitbit.

Getting started with the Raspberry Pi

The Raspberry Pi is a cheap underpowered computer that you can buy for $35 if you are willing to wait a little or about $46 -50 on Amazon and get it the next day. The specs of this small computer are pretty weak, the unit i’m currently using is the version B board and comes with 512mb ram, an ARM 700mhz GPU, network port, two usb ports, GPIO port, audio out port an HDMI port which carries both video and sound and an SD card slot for the bios and operating system. People use these devices in their personal projects to build arcades, home automation systems, robots and other interesting projects which require little processing power.

I got this unit to build a home automation system similar to the Belkin Weemo system but at a fraction of the cost. I plan to wire it up to a 8 relay board which will in turn control some wireless power switches.





Bamboo iPad stylus

Yesterday I purchased the Bamboo Stylus for iPad. I’ve seen it being used with the Paper53 iPad app in their demo video and it seemed a lot better then my previous stylus which would stick to the screen. The bamboo stylus works very y well with the iPads screen, if you are used to drawing you might need some adjusting to the way the different apps process the strokes. I’ve been using the stylus with the bamboo paper app and I must say its very useful.

For now I’ve been using it to sketch random characters and also taking notes mostly in the free Bamboo paper app.  One complaint about the pen is that the rubber tip is very fragile, my pen fell and the tip hit the ground first and cracked open I had to go replace it at the store because even though Bamboo sells replacements they are out of stock.


  • Heavy and good construction
  • Smooth tip (unlike the cheap ones that stick to the screen)
  • Bamboo paper app works well with the pen


  • Tip doesn’t seem to last long, mine broke after falling once and i’ve seen many posts online about others complaining about how long they last.
  • Replacement tips are currently out of stock on Bamboo’s website
  • Bamboo Paper app has a limited free version but for all the features its an extra $1.99
  • Bamboo app doesn’t have enough primary colors. (no red , no yellow!)


DIY Spidertrax dolly

After seing this DIY on how to build a Spider Trax Dolly, I decided to give it a try and build one for my d7000. The finished product did not cost more then $100 and performed prety well. Most of the parts were available in local stores and the plate ordered from B&H online. I haven’t had time yet to take it out for a real test run but i’ve shot some test footage at home with my dog dex and his toys.