Categories
Thinking

Beyond the Kickstarter model for science crowdfunding

In the startup world people pitch ideas quite often in the shorthand of “we are X for Y”, drawing on an existing (and successful) “X” and a new market or audience “Y”. It’s very convenient, while have to be extremely careful not to be sucked in by its simplicity and really equate it with “we are doing everything completely the same as X, just for Y”. One such combination where I consider that very harmful is the topic of science crowdfunding, and the multitude of sites being “Kickstarter for Science”.

The Kickstarter model works very well, when there are things to give away, when the end results are physical products, or can produce something physical related to the project (for example postcards and DVDs for performance and art).  For most of the science projects, that just doesn’t work, quite often there’s nothing really to give away for a wide audience, that would attract enough funding (though will come back to this later). I think the whole model of what do supporters get needs to modified, and on a higher level, have to answer the question of “What is the purpose of all this?”

Laser sign built for the lab
Laser sign built for the lab

To get to some possible answer, first a bit of exploration. One of the first things to see is who could be the beneficiary of the project? The star professors working at big universities, they often have more money from grants than they can spend, probably they are not the first ones to think of. On the other hand, there are smaller colleges with ambitious researchers and students. There science fair students. There are independent scientists, hackerspaces, non-profits. The funds for many of these are a problem, but there are even more common problems I heard so far: lack of knowledge and lack of community/connections. The latter can affect very successful professors as well, in less well connected places (like here in Taiwan).

Another insight I got from watching Zack Braff’s reply to his critics, over his Kickstarter campaign for a new movie project. In that video he mentions what got him onto Kickstarter in the beginning: being able to have a backstage view to awesome projects, by receiving first-hand experience of the makers. That’s what he put at the centre of his campaign too: (paraphrasing) “If you fund me, I’ll be able to show you how a movie is made from beginning to the end, like you’ve never seen it before” (and apparently 46,520 people thinks it’s an awesome idea, myself included). Maybe that backstage view would be motivating to just enough people to support a particular science project that they are interested in?

So to come back to the question of purpose: what if the driving principle was “Promoting and enhancing Open Science“? Would this be a focused enough mission to create a sustainable model?

Fitting this into the previous examples: what if science fair students can get support for their projects: monetary from family and community who has such vested interest in them, but beyond that, the project would also try to connect those students with professors in the field their project is, while providing feedback and education to do their projects in a transparent, responsible, and interesting way. Besides the benefit of getting their projects done, could this create better scientist and more interested public in the long run?

Similarly for independent scientists and professors alike, openness, collaboration, and more transparency could enable them to do better and more science. I feel, as Tim O’Reilly said about writers, for scientists as well the problem is not that someone will steal your idea, but that nobody have heard about what you are doing.

That’s not to say, that scientists should spend all their time promoting their research, but to make it accessible. People should be able to see how a great lab-book looks like, what raw data is, what is a failed experiment and why did it fail, see how long certain things take in the lab, what is the thought process of a discovery. This is of course some overhead – when people are writing things up, they are not doing the experiment. On the other hand, I am a firm believer, that taking some time to think and being “forced” into putting thoughts down into coherent form has an amazing positive benefit on the long run. That’s how real understanding can come about too, and it will make a better scientist, compared to putting short-term efficiency as top priority.

All in all, I think a platform that have a priority list of first Openness, then Collaboration, and finally Funding would work the best for the mission of enabling more people doing more and better science. Some sign of this I can already see from existing places, like the experience of the Serengeti Live project which found collaboration with Zooniverse.

There are a LOT of science crowdfunding websites (as I’ve seen many on a list on Reddit), though many of them are closing down or inactive as founders moved on, like IAmScientist, Petridish. There are others still going on, for example Microryza, which I admire as founded by scientists since they wanted to get funded as well, though I think the reward of nicely formatted report at the end of each funded project falls short its potential.

Who will build something based on this and will it work? I don’t know yet, but I’ll sure do everything I can for Open Science and discovery in the meantime, and work to become a better scientist myself.

Categories
Maker

Smartphone headphone to laptop adapter

My involvement in the Taipei Hackerspace so far had two very beneficial effect on my thinking: first I have much more ideas what new things to create, then I have much higher probability of seeing those projects through to completion. This post is a write-up of a recent project, illustrating both of these points.

About two weeks ago, I have fixed a headphone for a friend: the wire near the jack was broken and needed replacement. It was a relatively straightforward project, but needed a bit of digging into audio wires and jack connections. I was really proud of the result (fixing things have this effect, I highly recommend doing more of that!), and kept thinking if I can come up with any other audio-related project where I can use the knowledge I learned, and this is what I have came up with:

I bring my laptop almost everywhere with me, and started to use my smartphone headset to listen to music since it sounds great and much lighter to bring with me than the large headphones. It also has a built in microphone, so if I can use that, then really don’t need any other equipment to make Skype/Google+ Hangout calls. Those are 4-conductor headphones for Left/Right/Ground/Microphone channels, but computers (PCs) can only use the 3-conductor Left/Right/Ground and Mic/Mic/Ground connectors. Let’s make an adapter so I can break out the audio lines and mic lines to the appropriate laptop connectors!

Hardware setup

The parts needed:

  • 1pc 4-conductor input socket
  • 2pc 3-conductor output jack
  • 1pc 1-signal (mono) audio wire (signal + ground lines), about 15cm per finished adapter
  • 1pc 2-signal (stereo) audio wire (2 signals + ground), same length

The Guanghua Computer Market and its neighbourhood has a lot of electronics stores. The appropriate output 3-conductor jacks were really easy to find, as were the audio cables. Those didn’t look as good as the Bose headphone that I repaired, but it’s good for a prototype. The hardest part was the 4-conductor input socket: they had some that should be mounted on a printed circuit board, and tried that one for the first prototype, but then they found me some better one that I can use with the cables. That was the most expensive part at about 20TWD ($0.70).

Wiring diagram showing the internals of the adaptor
Wiring diagram of the whole cable, M=microphone, G=ground, R=right, L=left

Above is the circuit schematic, probably a bit of a mess, but tried to keep it simple. Then aim of the whole setup is to get the G (ground) + M (mic) lines to one jack (the mono audio, thinner cable), and G + L (left) + R (right) to another (stereo audio, ticker cable).

One complication is that the order of M-G-R-L seems to be the “Apple Way”, that my HTC headphone adopted as well, while others have a more logical (and easier to solder) G-M-R-L series (eg. the Sony PSP headphones as I found searching for it). Thus this adapter would not work for every headphone. Maybe version 3 should have a switch to swap the Mic and Ground lines at the input socket?

Parts for the first version of the adapter
Version 1 of the adapter: 2 pieces of 3-ring jacks, 1 piece 1-line wire (that is signal + ground), 1 piece 2-line wire (2 signal + ground). The input jack is different for the final version, and heatshrink will not be needed.

After all the parts are collected, there’s some micro-surgery. Strip the audio wires carefully, and don’t have to leave much out, just enough to get to the jack electrodes, and such that the thick outside cover fits into the cramp that is there to hold things in place.

For the microphone wire, connect the two output channels (the tip and the 2nd ring), and the ground goes to the base one. For the audio output, the tip is the left channel, the 2nd ring is the right, and the base is ground. The audio wire I got was a bit thick to cramp, but it’s not too bad if the metal cuts into the plastic cover, as long as it doesn’t cut through it.

The output jack image
Soldering one of the output jack

The input socket was quite a bit trickier to solder, because the electrodes were so tiny. They are arranged in a 4 directions, going around clockwise as “tip – 2nd ring – 3rd ring – base”. Had to use some magnifying glass and one spare unsoldered jack to make sure I connect the right things to the right places, but it works – mostly. The hardest part is not to melt the individual wire insulation (they are not enameled wired as inside the manufactured headphones). Also, cramping the two wire together is tougher, had to cut off the sleeve of the socket so the wires fit within the plastic cover of the socket.

Soldering the input socket of the final version
Soldering the input socket of the final version, that’s pretty tight for the two wires, have to make sure not to burn off the plastic cover or them

This second version was done within about 15-20 minutes, though, since I had all most of the research done previously. Had to do some careful inspection that no shorts developed within the device because of the soldering, and then connect everything up.

The final design plugged into a laptop with headphones
The final design together with HTC Butterfly headphones, with the microphone visible on the left

The listening sound quality is pretty good, though I guess it could be improved with better soldering (which includes using a finer tip soldering iron), and more patient cabling work. The mic is pretty nice, my recordings sound much better than before, and it’s convenient to use too. Much less thing to carry around and definitely better than my laptop’s built in mic. This might even get me to make more calls (sorry Mum and Dad that I haven’t been phoning too much lately!)

Taking it further

The electronic markets here in Taiwan are full of gadgets, and I looked but couldn’t really see any commercial adapter that did the same thing. This made me think that maybe it could be interesting to make this into an actual product. First find some local factories that could make it, as I keep hearing my business-related friends manufacturing a lot of things. Then set up a Kickstarter/Indiegogo project with some reasonable (let’s call it hobby-level) financial goal, and see whether people would be interested.

This would need quite a bit of preparation, and what’s putting me off is the simplicity of the project (what’s too simple for Kickstarter?), and that a Chinese factory could rip it off faster then you can say Shenzhen. Still, it might worth it for the experience and contacts, will do some research, and in the meantime keep making stuff that interests me.

Update 8/6: as a commenter pointed out, these things exists already e.g. on Amazon, searching for “smartphone headset pc adapter”. I guess that simplifies the future a bit, have more time for better projects.

Categories
Maker Programming

Electronic check-in at the Taipei Hackerspace

One issue we have frequently at the Taipei Hackerspace is that people don’t know when we are open. Our  basic rule is simple: whenever a keyholder member is in the Hackerspace, anyone/everyone can come. In practice people never really know if anyone’s there.

They could give a call to the space, or even send an email to the mailing list, while the people I know usually end up asking me directly – hey, anyone’s at the space at the moment? Since I don’t always know the answer, the search was on for a better – maybe more technological or hackish solution: let’s build an electronic check-in/out system that will show the current status on out website, so people can check right there.

I had the following idea in the back of my mind for a few weeks and even got the hardware acquired, but one of our co-founder had to call me out by name on the mailing list, a few days ago to swing into action. So now here it is, kinda working, ready for real usage.

The main idea is that in Taipei pretty much everyone has an EasyCard, an 13.56MHz RFID card that is used for all public transport in the city and a lot more. The RC522 card-antenna module seems to be able to read the card pretty well, and all I need to get off it is the the ID number which is pretty straightforward (after digging the Arduino forums for source code).

The project in a nutshell is:

  • Use Arduino Mega with an RC522 board to get the ID number of a given EasyCard
  • Use witches to get whether the person is checking in or out
  • Use LEDs to provide some feedback and basic user interface for the hardware
  • Node.js server to communicate with the Arduino, interface the check-in/out database, and provide API and realtime access to the data
  • Create a bit of interface on the website to display the check-in status

Now let me dig into the different parts in detail.

RFID

The RC522 module has 8 pins, and Arduino can use the SPI library to communicate with it. I used Arduino Mega ADK, because the SPI pins are conveniently accessible, unlike e.g. the Leonardo, for which I would have had to make some new cables or headers. The RC522(pin number)->Mega(pin number) connections are done such that:

  • SA(1) -> SS(53)
  • SCK(2) -> SCK(52)
  • MOSI(3) -> MOSI(51)
  • MISO(4) -> MISO(50)
  • (5) not connected
  • GND(6) -> GND
  • RST(8) -> (any digital pin)
  • +3.3V(8) -> +3.3V
Photo of the electronics
RFID-RC522, with blank card and pins

The source code to talk to the card is from a blog, and originally from a tech shop in China, I guess (based on the big bunch of Simplified Chinese comments).

Switches and Visual Feedback

I wanted to make as simple interface for the card reader as possible. Added this pair of switches and LEDs (the D1 being green, and D2 being red). After the Arduino received a card ID from the reader, the LEDs are blinked to prompt people to press either the Check In or Check Out buttons. If they press either of them, the corresponding LED is blinked very brightly for a bit, and the card ID and check-in/out event is sent to the connected computer via serial connection

The (very basic) circuit for the check-in/out buttons and visual feedback LEDs
The (very basic) circuit for the check-in/out buttons and visual feedback LEDs. “Pins” refer to the Arduino pins used in the current version

If no button press occurs within 10 seconds or so, the reading is discarded and the card reader goes back to listening mode.

Webserver

Node.js is very useful to make quick web services, and its library support is not too bad at all, although it’s not all smooth sailing: their documentation is often scarce at best. Nevertheless it was the fastest one to get things up and running, since I have used before almost all required components.

The server communicates with Arduino via the serialport library. I’m more used to Python’s pyserial, though in this case it was very handy that serialport can emit read events, thus the server can just wait until there’s something to read and run some functions on the incoming data. In my experience, serialport wouldn’t be good for every cornercase I came across in serial-land, but in this setup works beautifully.

I chose SQLite3 to store the data, using the sqlite3 library. There are a bunch of others, had to look around which one is still being developed. This particular library is not too bad, though I found myself fighting the lack of documentation and asynchronicity quite a bit. The resulting code is pretty ugly I’m sure, in some places inefficient because I didn’t know how to get to the result I wanted in a less roundabout way, still it seems to work and that is what matters for a prototype.

First I made a simple REST API to query the currently checked-in people, and later added (real-time) push updates via socket.io, to make it nicer. It’s brilliant that without any polling, all clients can be updated once someone signs in or out.

Since this code is running on a different computer than our main web server, had to play around with the Access-Control-Allow-Origin header, and adjusting the settings of our  router to make it accessible for the web correctly.

Tried to add a pretty-much self-contained script that the front-end can load, and it handles everything, just need an appropriate HTML span or div element to display the information.

Photo showing the circuit used for the check-in system
Hardware setup for checking in/out: Arduino Mega, RFID-RC522 circuit, and some switches and LEDs.

The result is pretty good, as long as the card-reader does not crash. Originally the results were displayed in a table, but wanted to make it more human, so here’s the format I ended up with:

Website screenshot showing two people checked in
Screenshot of the homepage with one particular check-in situation.

There can also be people with no name, they just show up something like “Right now there are three people checked in the Hackerspace: Greg, and two other people.”

It lives!

Here’s a quick demonstration video of how does it work:

So you can check out our website at http://tpehack.no-ip.biz/ for the live results, and drop in if you are in the neighbourhood if there’s anyone in the ‘space.

The whole source code is shared in a Github repository: the Arduino sketch, the server script, and any additional files. I’m sure there are a lot of things that could be improved about it.

Categories
Programming Taiwan

Barometric recording of Typhoon Soulik

It all started a few weeks ago with Sparkfun having “20%-off” day, when I got myself (among other things) a BMP085 barometric pressure sensor. When it arrived, I have soldered some pins on it, and set it up with an Arduino Nano, to have the readings off it easily.

View of the circuit
BMP085 barometric pressure sensor breakout board from Sparkfun

Originally all I wanted is just some laid back pressure recording, so maybe I can use that to predict the weather a bit. “Pressure falls: bad weather comes, pressure rises: things will clear up”. I was recording for about a week, and nothing really noteworthy came out of that.

Then it was the news, that the year’s first typhoon is on the way to Taiwan, and it was supposed to be a big one. Obvious that I will try to record the barometric pressure pattern of its passing, but wanted to make it more interesting and informative. More visual than just the timeseries plot of pressures.

The Japanese Meteorological Agency (JMA) is a good place to watch for information about typhoons. They list path prediction, typhoon properties like strength, wind speeds, and central pressure, have satellite imagery. Putting these together, two days before the typhoon arrived, I set up a script to download the satellite imagery as it became available.

Satellite picture of Typhoon Soulik and location of Taiwan on 2013-07-12 morning
The morning before the typhoon arrived

The JMA publishes usually 2 satellite images in an hour for our North Western Quadrant (at :00 and :30), one of them covers the whole area, the other covers just the top 80% or so, leaving a dark band on the bottom. Nevertheless, matching up the pressure reading with the satellite pictures would be a good little project for this time.

Friday came, the government gave the afternoon off, though it turned out no landfall happened till everyone supposed to be off anyways, just a bit of on-and-off rain. People stocked up on convenience store food (I now have a good supply of instant noodles:) and water, taped over their glass windows, take in their plants and BBQ equipment from outside – well, those who have planned.

Around 10pm the big rain has arrived, here’s a video of how it looked from my window. Went to sleep later, and got woken up around 3:30am by the rain having changed into pretty darn big wind. Here’s another video of the violent part of the typhoon that time in the morning, that doesn’t even really do it justice. The houses around here are pretty tall, and I wonder if they have protected from the wind, or been artificial canyons channeling it. Some things got broken, though not as much as I expected – which is a very good thing.

In the meantime by the power of the Internet I have checked out the pressure reading, how is it going a few miles away in the Taipei Hackerspace, where I have left the barometric pressure sensor (the geolocation is 25.052993,121.516981)

Here’s the entire recording of the approximately 2 days of typhoon. It was pretty okay weather in the start and end of the plot.

Plot of pressure readings
Pressure reading during the passing of Typhoon Soulik, recorded at the Taipei Hackerspace

The readings have been corrected to sea level (from about 20m height, where the Taipei Hackerspace is), should be good within 1hPa or less.

The the pressure was indeed dropping like a rock, and the dip on the graph coincided with the most violent wind that woke me up. According the JMA, the central area of the typhoon had pressures down to 950hPa, which means that core must have passed pretty close to here, having readings below 958hPa, though probably not directly, as it didn’t stay down there for long.

I made a video syncing up the pressure reading and the satellite picture. The red dot on the video marks the recording location. (Watching it in full screen and HD makes it clearer.)

I would wonder what was the flat part in the readings while the typhoon was leaving. Maybe sign of changing direction, by the look of it.

Either way, this was fun to do, and I am glad that only a few people got hurt here, much fewer then even during the less powerful typhoons. Maybe getting people scared a little (like with this “super typhoon” stuff that went on) helps them keep safe? Just don’t use it too often.

Extra material

I put almost all material used here into a gist: the satellite imagery download script, the plotting, the movie frame generation, the movie generation script, and the complete barometric recording. Because this last part is pretty big (5Mb), Github truncated the rest of the scripts. I guess it’s okay to check check it out. Will add the Arduino sketch to read the sensor and the logging script later.

The satellite imagery weighs about 60Mb, so don’t put it online, but if anyone wants them, let me know.

Keep safe!

Categories
Programming

I got my Pebble, now let’s play

Just received my Pebble smartwatch yesterday, a bit more than a year after the Kickstarter campaign has ended. Its pitch is being a watch with e-paper display, Bluetooth communication with Android and iOS, a Cortex-M3 ARM processor, with the ability to run programs that change the watch look (“watchfaces”) or provide extra functionality (“watchapps” ).

I almost forgot about that I have supported it, until my friends on Facebook started to receive theirs, and I run into a person recently wearing one (the red coloured one, mine is gray and that was manufactured later). Even if I’m not really a wristwatch person – haven’t had one for years -, I like watches in general and clever new tech all is always welcome with me. (I wonder if any of these will be  in pocket watch form some day).

Pebble watch showing the time, 2:45
Pebble watch in action. Or just chilling and showing the time anyways.

Setting it up was pretty easy, the Pebble app on Android does pretty much everything. Setting up notifications for emails, Facebook messages, calls and SMS is one of the first thing. Until I get overwhelmed them and will turn them off, probably. The app also sets up such that when my phone downloads a file with the right extension (.pbw), it will automatically sent to the connected Pebble. The updates are pretty easy and quick too. I got a bunch of different watchfaces from My Pebble Faces, an unofficial repository that has much more than the official one. Maxed out around 10 or so, then had to use the app on my phone to remove some of them. Easy, though now really feel it all depends on the phone I use as well, the watch is mostly as clever as the accompanying phone app.

Fooled around with it a bit more, checking the alarms, the automatic Runkeeper integration (pretty neat, if only I could switch from “pace” display to “speed” for the watch), some small watchapps. In the case of watchfaces, I switched back to the original “Text Watch” face, which is pretty neat and unique for non-smart-watches. If only it could be modified to write things like “ten oh seven” for “10:07” instead of “ten seven”, it would feel more natural. There’s a watchface called Words o’Date that does that, except that it also adds the date, making the front look a bit too crowded for me. So keeping the original at the moment.

With this playing around I noticed one possible strength of the display, that almost everything can be animated, and that animation is pretty smooth. [Update: it’s actually e-paper, not e-ink, so my bad, the following comparison is not really valid Thanks for the comment.] From my limited experience with e-ink in the form of reading on my Kindle Touch, Pebble is really agile. Looking in the the Software Development Kit (SDK) documentation, there is a lot of functionality dedicated to animation.

After the whole day of usage I was thinking that when I was young(er), I would start hacking on interesting things right away, would have a lot of ideas, put in loads of effort, oftentimes stay up late to make something new to work. These days it’s less like that, even if I have much more toys lying around waiting to be hacked on. Around dinner time I decided that it cannot continue like that, so before going to sleep, will have my very on watchapp done.

Magic 8-Ball

Didn’t have many ideas, though, and haven’t looked yet too much, just wanted something simple. A Magic 8-Ball came up as a possibility: an app that gives you answers to your yes/no questions. It’s pretty easy in the core: a bunch of stock answers (20 in the original case), a random number generator to choose from them, and display it. Can do just bare text for the first time.

To set up my Linux box for the development, got the latest Pebblekit from Github, which is the SDK and examples and all the tools together. Unfortunately everything inside relies on “python” being Python 2.x, and on my ArchLinux this is not the case. The quickest workaround I found was to use Python’s virtualenv. I have also needed a different version of GCC that compiles for the Pebble’s ARM processor, the arm-none-eabi-gcc, fortunately in the ArchLinux User Repository (AUR). It just took a looooong time to compile. These two steps put me right into business and been able to compile the example watchapps and watchfaces.

I don’t remember much of my C skills (never had that much), that are mostly kept alive just by Arduino programming. Fortunately the Magic 8-Ball is simple enough program that looking at the examples, Stack Overflow, and Github, I could find all the pieces I needed (array of strings, random number generator in C, text display).

The Magic 8-Ball app is showing its result to my question: ask again later.
My first watchapp, the Magic 8-Ball

By around 1am I had a working version, and it’s totally fine. It’s even fun, even if very simple. People can get it directly from its page on My Pebble Faces, and apparently while I was writing this, 3 people already did, sweet!

In the future, I would like to keep up this creative hacking. For the Magic 8-Ball I could include some graphics, maybe neater transitions, make it less an “example” app and more an app. It’s really cool, that so many of the uploaded watchapps and watchfaces on My Pebble Faces also share their source code (50% of the 500 items, can filter for it in the search form), so I can learn from that. How much better Android apps would be if they’d do the same? My code is also on Github, naturally, in the magic8 repo.

For Pebble in general, communicating with the phone over Bluetooth can be very useful, if a useful Android app complements it. Smart clothing and accessories are just going to be more prevalent. There are already “next generation” smartwatches out there, like the Agent, that will be cool in a different way (I haven’t supported yet, they got 10x funding anyways).

Also, I think I should put some effort into compiling Libpebble for my laptop, that would make it possible to cut out the phone as a middleman and make things more future proof.

And as a first priority, I should be getting used to wearing a watch again, it’s been a while.