Kegboard-particle: Easy wifi keg controller board with Particle Photon/Electron

Hello everyone!

Finally found a little time for Kegbot, and I wanted to share a work-in-progress, something I’ve wanted to tackle for a long time: Kegbot firmware for Particle devices.

If you’re familiar with Arduino, Particle’s boards are superior in virtually every way, for about the same price — and they include onboard wifi and an innovative development environment. Since we no longer develop Kegbot kits, and since USB support in Android is quite poor, I’m hoping this will become a great path forward for future Kegbotters.

Though it’s a very early work in progress, here’s what works now:

  • Reads and totalizes flow sensor inputs (up to 4).
  • Serial port and TCP streaming interfaces.
  • Simple human-readable output stream - no need to parse binary messages.
  • Flash and update firmware through the cloud (thanks particle!)

Here’s what’s left to do:

  • Support in the kegbot-android app. You should be able to plug in an IP address and use it as a backend.

If you’re feeling adventurous, or would like to help, have at it! Cheers…

3 Likes

This is great!

Any plans to add flow controls (relays) or user authentication (RFID, etc) any time soon.

I am overloaded with other commitments, but I’d like to help. Is there anything you’d find especially helpful?

Thanks

1 Like

Both should be easy! The Particle relay shield / kit in particular should make this a breeze. And the community around these devices is every bit as robust as Arduino, while I don’t have a lot of cycles to build new firmware features, I’m sure someone could drop in RFID support without too much effort.

I’d love to get some intrepid early testers on this board, finding any bugs with core flow sensing and of course improving the firmware/protocol. USB was “the” way to build a kegboard circa 2010, when other options were out of reach cost-wise. But Google/Android have never given USB host more than “novelty” support (so tablet options suck), and now that quality hobbyist network microcontrollers like Particle’s are available it’s really the only way forward. Not to mention all the other applications it opens up!

1 Like

So is buying a Particle Photon for $19 all I should need to buy get started?

Also, do you know if one of these “Shield shields” would allow use of a kegboard with the Photon?

I wholeheartedly agree. I am interested in seeing the UI (Android or other) becoming less tightly coupled to the sensors/controller so that it is more flexible and configuration defined and dynamic.

Yes, photon is great and highly recommended. I think it even comes with a nice little breadboard and power cable. Particle is really a delight in so many ways.

Re shield shield - maybe! I think that’s its primary selling point, on the other hand the firmware would have to be designed for that (pin mapping etc). Maybe they make an emulation layer or something. To be honest I don’t have a ton of interest of carrying “arduino-isms” over, but don’t let that stop you from tinkering!

This is great. Looking to add a 2 tap setup and this looks like the way to go with the beta app. One question, can a one-wire temp sensor still work?

Just like RFID, temperature support needs to be ported. Otherwise I see no obstacles in supporting it!

2 Likes

Since you are still early in the particle implementation, I have a few suggestions that would be easier to implement before you code all the features.

  1. Since you’ve moved from binary to text data, consider using JSON so that data can be a little better structured and parsed with standard libraries (Particle uses this for its messages, I think)

  2. Document the full new protocol (relays, rfid, temp, etc) so that it might be easier for some of us to help you and to port the protocol to the old pycore (which perhaps only I am interested in) or make test tools

  3. Document any public Particle functions like meterTicks and resetMeter.

  4. Add timestamps to messages as it is helpful for monitoring, logging and historical purposes.

Thanks!

Hi John - great suggestions. In fact I would warmly welcome help / a PR to achieve some of them.

I was leaning towards a simplistic line-oriented protocol along the lines of:

<Command> [key1=value1] [[key2=value2] ... ]

I’m a little ambivalent about adding JSON semantics on top of this, but I suppose it’s not a big tax & resolves some ambiguity. Sure.

Definitely +1 to well-documenting the protocol. Bit ad-hoc right now.

+1

Sounds good to me. I think Particle.publish does this automatically, but for the other channels it would be helpful.

BTW I just pushed some experimental, poorly tested/documented thermo sensor support, but it does work. Check 'er out: GitHub - Kegbot/kegboard-particle at mikey/thermo-support

thanks for the help!

Yes, that’s right. As with certain arduinos, more is possible; it’s all a matter of interrupt support. I somewhat arbitrarily started with 4 on photon because I wanted to leave I/O room for other stuff (relays, sensor, etc).

Also, if you are thinking of using the Particle relay board, it looks to me like it’s controls are bound to D0…D3, so you might want to consider moving the meter pins while everything is still in these early stages.

2 Likes

This sounds awesome. I’ve had so much trouble with OTG cables going bad and the app losing connectivity to the kegboard, that I want to try this out, but I want to confirm the wiring before burning out any of my components. How do you wire the flow sensor to the GPIO? Do you just need a 2.2k resistor between FLOW_A and 5V?

After reading the schematics for the kegboard some more, and trying it out, it all worked. After a day of using it, I think it is working pretty well. A couple things I’ve noticed with the particle kegboard:

  • It seems a little bit laggy between a pour starting and it registering on the tablet. This may be expected with the TCP service, or just a side effect of it. I’m not sure how the app is polling the particle service.
  • Calibration may be an issue. After one test pour, I had to adjust my calibration from 2.4 to 4.0, but it is still off by nearly 30%. I’ll keep playing with it and see if I can get it dialed in properly.
  • Wake on pour does not work.

Hey Mike, this looks great! Particle photon is on the way, and the cloud-based ecosystem looks quite exciting.

Is there a particular flow sensor you’d recommend for use with the photon? I’m interested in measuring flow for two taps.

Anything that the KBPM or Arduino boards support should work. I’m using the stock FT-330 sensor with the Photon.

2 Likes

We’re also trying to implement the Particle kegboard. We have the flow meters printing ticks to the Particle web console, and it seems you can plug in the hostname and port in the Kegerator settings of the Android app. But, we’re worried that the particle won’t get good wifi signal inside the kegerator.

Does the particle work with the tablet app with the OTG cable? If so, how do you get it setup to do that? I can’t seem to find a way.

I’ve ordered myself a Particle and am awaiting its arrival. Just a question to those that have already constructed their kegbot this way, did you use a pull resistor when attaching your flow meters to the particle, and if so what value. I can’t find a recommendation from my manufacturer on mine (bought of alibaba) and was just going to start at 2.2k.

edit: flow meters purchased off alibaba, particle purchased direct from manufacturer.

I just got a couple particle boards in- I love them already. I see you started adding the onewire temp support, but it isn’t outputted with the data. I’m assuming it has to be added to the data block on the particle, and then the android app has to be modded to expect it?

Also, just to be clear, even with the particle, the data flow is sensor->particle->wifi->tablet->kegbot server?

Since this removes the need for the usb/OTG setup, I’m thinking about trying my hand at an iOS app. Thoughts?

My thanks to all of the pioneering, beer-loving, technologist that have taken the lead on starting this work. I have read through many of the forum post and have enjoyed seeing the challenges, ideas, solutions.

It is time for my own build. I have a dual tap kegorator [partially] full of home-brew beer. Very tasty. I also have family and friends that are also enjoying my beer. I am in the process of ramping up production and the KEGBOT / PHOTON / NEXUS 7 TABLET solution looks like a great solution for keeping tabs on things.

My question: Can one of you kind people point me to the best overview diagram of what hardware pieces to buy and configure for a two tap solution using the flow-meters, photon, kegboards (needed?), Arduino Duemilanove (needed?), cabling, and tablet (such as an Asus Nexus 7 tablet - for which I have an extra and would live to use). I will also want to add the one-wire temperature sensors which looks like they interface very nicely with the photon boards.

Thanks in advance for pointers.