I have been given a scentee which I would like to program to be usable with my Raspberry Pi. This device connects to smartphones via the headphone jack, and needs to be charged seperately, so I don't think I need to draw power off the Pi (though if possible it would be nice-to-have).

An iOS SDK is available on their website but I am having trouble imagining how to rewrite this for RPi usage.

Does anyone have experience in programming a simple peripheral like this to respond to the jack output? The only functions it has are spray a scent and turn on a LED. Below is a picture of what the scentee looks like "in action".

Picture of the Scentee
(source: scentee.com)

  • 2
    The iphone can send data via the jack. It is proprietory protocol but accessible via the SDK. Soo, no luck unless you can reverse engineer the signals, given they are not encrypted or something weird. What the heck is that thing any way. lol
    – Piotr Kula
    Jan 14 '15 at 21:24
  • 4
    @ppumkin It's to make your raspberry pi smell like key lime.
    – goldilocks
    Jan 14 '15 at 23:21

If I where you, I would connect an iPhone to a recording device (with a 3.5 mm cable) and record the signals the app send to the device. Then it would be a simple matter of transferring the signals to the pi and play them there.

  • This is a very interesting suggestion! I'm guessing I'll need quite a sensitive recorder to pick up anything though. Would recording directly into a desktop music software like Audacity do the trick?
    – Alex
    Jan 15 '15 at 10:17
  • It would surprise me if the signal is weak. I would guess it is quite powerful and probably digital. wire it up to a speaker or your headphones and listen to it.
    – Bex
    Jan 15 '15 at 12:55

You will want to examine the device (in the photo it's called a "Scentee") and have a good look at the 3.5mm plug. I suspect its plug may look different from a regular audio plug. Even the "ordinary" earbuds that come with an iPhone use a plug that has more metal "rings" than a standard 3.5mm stereo audio cable. I believe that's because the iPhone earbuds include a microphone. The iPhone's 3.5mm connector probably has some special contacts in it that touch the different metal rings to detect what sort of cable you have plugged into it, and the software may not even send the special signals when a regular audio cable is inserted.

Have a look at How does Square Reader (squareup) device work via earphone jack in Android? and What protocol does a headphone jack use? -- these topics address different scenarios, but I think you might be able to glean some technical details from them.

I suspect you may be able to connect your Scentee device to your Pi, but depending on its plug, you may need to cobble together a special 3.5mm socket and some additional wires and connectors to get the input and output signals to the right places.

As for rewriting the SDK, remember that iOS software tends to be programmed in an Apple-specific software environment, so you may need to make lots of adjustments to fit any of the open-source software environments available on the Pi.

  • Thanks for this. You are right, the jack is indeed a 4-ring kind, but that's fine for me as the plug on the B+ is also a TRRS model. I've been able to get an Android SDK for this device which should be easier to port on Pi than iOS by rewriting all the mobile components. I am quite new to Java however so that still could be quite tricky!
    – Alex
    Jan 19 '15 at 8:34
  • Great! Thank you for the link! It's good to know the B+ uses the TRRS cable, but I would be very surprised if the B+ composite video output signal can be re-purposed to be compatible with the (presumably microphone-like) signal on the Scentee. Jan 19 '15 at 20:59
  • I strongly suspect the "Apple" on that TRRS chart must refer to iPod models that can attach to a TV set for displaying video. Jan 19 '15 at 21:06
  • I understood it more as the description of the audio jack in iPhones. Not very detailed in any case. Do you know of a Java package for RPi to interface with the headphone jack? So far my attempts to get it running only produce errors as the device is not detected as being plugged into the Pi.
    – Alex
    Jan 20 '15 at 9:49
  • Of course both OpenJDK and Oracle Java are easy to get for the Pi but I wouldn't think Java would be a very popular environment to develop in. (The first link spells out some reasons why it's challenging.) I've thought a little more, and you might also look into Android on the Pi. If the environment gives you what you need, more of it might be similar to what the Scentee was coded for. Jan 21 '15 at 22:40

Not the answer you're looking for? Browse other questions tagged or ask your own question.