[IDEA] Monitor Tap List at Bar

Hey guys,

I am working on a project (which, I’ll post here once completed) and was wondering if you all could possibly offer some insight.

I just want to make sure I’m not over-complicating it or falling pray to the “if all you have is a hammer…” issue.

I volunteer at a local startup micro-brewery doing website design and general IT work. They have a big slatted board (with space for 21 slats) that shows all their currently tapped beers. When they replace a beer, they take one of the slats down, and put a new one up. However, because it’s a smaller place with already a BIG demand in town, they’re constantly rotating beers.

The issue is, the tap list isn’t online! We’d really like to implement this! Plus, it’s a small crew working there (3 people), so having them update the website on a regular basis would not end well and I’m not there often enough to update the list for the website to be accurate.

The owner would like this to be as hands off for them as possible, especially because on a busy night, the bartender has NO time to update the website if something changes.

I proposed a barcode scanner, which the owner likes, but, he’d honestly like a “zero setup” situation where there is no chance of a mistake if things were to get busy (which, they often do).

My idea is this:
Use :spark: + RF reader(s) and RF tags for the slats! When a certain board goes up, the reader knows that board is present based on the tag’s ID and I can then write some code to update the website accordingly (that’s the easy part).

Can you guys think of any issues with this? Or any other solutions?

Thanks in advance!


The only issue I can think of off the top of my head is that RFID readers have pretty crummy range. SparkFun has a good video on their RFID readers and range. You’re looking at 2-3" for their most powerful reader and RFID tag. However, if the slats can be close to their readers, it would be a fun project to work on! (I’m a little jealous, actually!)

1 Like

That’s a fun idea! I know exactly what you’re talking about with the slats. I’ve seen similar ones at local micro brews. However, I think you could simplify it greatly.

21 slots is a lot, but I think this would still work…

On each slot, you put two conductive pads that connect with two conductive pads on each slat that slides into a slot. So when a slat is in a slot, a circuit is made. Make the conductive pads big so there’s more room for error if the slat doesn’t get slid into the slot all the way. On each slat, put a different value resistor. Then when a slat is in the slot, you just take a voltage reading to see which slat/beer it is. Then every once in a while, scan all the slots and send the data to the cloud! The pub workers wouldn’t have to do anything different. They just slide slats in like they always do.

You’d need an analog pin for each slot. 21 slots would take a few cores unless you figured out a way to take a lot more analog readings with some other IC and relay that to one core. Some of these other guys might have more input on an IC that has 21 or more analog inputs.


@wgbartley , I considered this! I’ve been given a budget of ~100 bucks to make this work (but, honestly, I’ll throw in my own money, too if it’ll work!).

The RC522 (which @peekay123 has been doing an AWESOME job porting the libraries to :spark:!) is pretty cheep, and if I ordered a bunch from China, I could allow each slat to get a reader within budget, I think.

We have a routing tool, so we can easily make some room on the back of the board to allow the readers to fit!

The RC522 uses SPI. From what I understand, I can use multiple SPI devices on a single arduino / :spark:, but can I chain up to 21 of them together?!

@Hypnopompia , that is a great idea.

Ideally, I’d like to use just one core. I’ll do some research on seeing if I can use an IC to make that work.

1 Like

Hi @austinpe,

Cool idea! I just wanted to share a link to kegbot - https://kegbot.org/

I think they might have software / circuits and stuff that might help get you started! :smile:



@Dave , that’s really cool. I think all the beers still need to be manually entered, though. However, I do like those flowmeters… I’ve book marked that page.

As per @Hypnopompia idea: I wonder if I could use eeproms on a digital pin instead of a resistor load … then use a shift register to be able to fit it all onto one core? Thoughts?

edit: I guess it wouldn’t even have to be an eeprom, just a way to be able to digitally separate a circuit from another circuit. I could just do a comparison database, that way the info doesn’t have to be ON the board itself, just have a unique identifier.

@austinpe, what is the longest distance from the Spark to the last keg? One possible solution is to use 1-wire eeproms (Maxim) where each have a unique serial number to identify them. With 1-wire you can power AND read the data with just two wires (data/power, gnd). You would put one on each keg with a set of contacts like @Hypnopompia suggested. That way ALL devices can be “discovered” over 2 wires! :smile:


I was in the MIDDLE of editing my last post! I just found some 1wire stuff.
Here’s my edit:

1wire! I have found both the iButton and the DS2431 EEPROM. I’m going to go with the DS2431 for now as it’s cheaper and expandable for other possible uses.

Here are some useful resources I’ve found on it/1-wire thus far:

There seems to be some arduino libraries already available, so I was hoping that @peekay123 could point me to some resources to porting arduino -> spark.

1 Like

@austinpe, porting is a lot like black magic and it’s not easy to describe. If you find a good arduino library, I’ll gladly port it for you. I remember reading a topic about using multiple 18B20 temperature sensors and having code to “discover” them. There could be some good info there. :smile:

It’s not “black magic”. Magic isn’t real. Porting is more of trial-error-bang-head-on-keyboard-to-continue-lather-rinse-repeat.


@wgbartley That’s what he said. Magic. :slight_smile:

Here is the thread that @peekay123 mentioned:

The Spark is working on an “official” one-wire library, but Dave from Spark has this in a gist while they are working on it.


@wgbartley, you forgot the slay-the-chicken-wait-for-an-eclipse-cross-your-fingers-and-hope-the-stars-align part! :wink:


@Hypnopompia’s resistor idea sounds pretty doable to me. This is a great idea for accomplishing the goal on the cheap.You could use a multiplexer to handle readings from many sources using few pins on the :spark:, for example, this breakout board:

Analog/Digital MUX Breakout

With a couple of those, you could read up to 32 sources, while using only 5 control pins for addressing. You’d just need a little work to select between one breakout board or the other, but it should be simple enough.


@dougal, that is an excellent suggestion! I believe the biggest challenge regardless of which identification “device” is used will be wire length that causes voltage drop, noise, capacitance and slew rate issues, especially at 3.3V.


@dougal - I like that idea! I have already ordered and recieved the OneWIre eeproms though, so we’ll see if I can get those to work…

Alright, I got the my EEPROMs in …

Using a combination of:


and the code on the last post of here:

I attempted to read the device serial on my arduino… to no avail :frowning:

I have the DS2431 pin 1 going to ground, pin 2 going to arduino ds(2) with a 2.2k (I also tried 4.7k) pull-up to 5v

I keep receiving a “No Device Found” returned in the Serial feedback

Reading the arduino page on the matter, apparently there is both parasitic power and normal power mode. Normalrequires the 5v pin and parasite just uses the digital pin … I’ve tried both configurations.

@peekay123 – would it be too much to ask to see if you could take a look at the code in that second link and see if it’s spark-portable. Maybe I might have more luck on the spark platform? The library seems to have read/read of the eeprom included, which is great!

edit: after trying three different sketches on the arduino, the issue is definitely that the eeprom is not being found by the arduino when the “ds.search(addr)” returns nothing. I’m really not sure what this command does…

@austinpe, which arduino are you using and which version of the IDE?

You need to be using the lastest OneWire library and in the code listed on the arduino forum, I would change all “byte” types to “uint8_t”. Then give it a shot. :smile:

@peekay123 I have an arduino uno. I’m not sure which revision, but it’s probably a few years old. I had to dig it up from an old project from at least 2 years ago. As for the IDE, I’m using 1.0.5-r2.

I loaded the library you linked to and have the code from that forum post.

I tried it both with byte and with uint8_t (I just replaced every instance of byte with uint8_t) and I still get “no device found”…

Should I be using the 5v pin to drive it, or just use the digital pin to power the device? I guess I may want to try the 3.3v pin. According to the datasheet it’s tolerate from 2.8V to 5.25V …so I don’t think I’ve fried them or anything.

Also, I’m not sure what value of pull-up resistor I need as some sources were saying 4.7k and some were saying 2.2k


edit: When I check the voltage drop across pin1 and pin2 of the DS2431 I get 0v when I do not have pin2 (IOpin) connected to a voltage source, even when the arduino is actively looking for a device. But, even when there is voltage, I still get “no device found”

@austinpe, I always have an arduino handy to test stuff :wink: I would power the device with 5V to start with and use a 2.2K pull-up as they suggest a “strong” pull-up. This is because the pull-up voltage AND the I/O pin voltage must be the same. So going to 3.3V for pull-up will not work on the arduino but would be ok on the Spark since I/O and pull-up would be 3.3V.

The DS2431 is powered via its data pin, oddly enough! So the pull-up also supplies power. Change the setup() in the code to this:

void setup(void)
  while (!Serial.available());
  boolean present = ds.reset();
  Serial.print("1-wire device present: ");

The ds.reset() should return a 1/TRUE if a device is found on the bus. Notice that I added code that requires you to hit any key on the serial console for setup() to continue to give you time to start the console. Run that and see what you get. :smile: