HOWTO - Make a BrewPi Fermentation Controller For Cheap

Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum

Help Support Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
Status
Not open for further replies.
I see, use a pro mini as a relay, and since you can get them around $2-3 a pop on eBay (in bulk) that's not to costly either, no modifying the brewpi_avr necessary. Though, how much space would a Bluetooth module require in the brewpi avr itself? And how much room is left?

Good question - the last .hex file I downloaded was 72,501 bytes.

The ATmega328 on my UNO has 32K of flash memory.

Obviously is cant all fit...

So your guess is as good as mine. From a programming stand point, programming the pro-mini as a relay is much easier than trying to decipher someone else's code and make modifications. The source code is on github https://github.com/BrewPi/brewpi-avr and Elco doesnt use the standard Arduino IDE, I believe he uses Atmel Studio.
 
I added an encoder/switch to mine over the weekend. Its wired just like the schematic, an EC12 encoder with 10K pullup resistors and 0.1uf bypass caps. I've got it wired to the arduino as follows - Channel A = Pin 9, Channel B = Pin 9, and the switch is on pin 7, but it doesn't work.

Is there something that needs to be turned on in the Brewpi software to make it work?

It's difficult to make out the wiring from your photo but here's the encoder portion from the BrewPi RevC shield schematic.

Hope it helps

BrewPi Rev.C - Jeff's Rotary Encoder_bb.JPG
 
I'd have to investigate what the RPi has for a Bluetooth stack, but from my admittedly limited experience with Raspbian so far, I'd bet you can treat it like any other transport terminus, just need to know its logical name and plug it in.

The cherry on top of that solution is there are combo wifi/bluetooth dongles running on Raspbian. Don't know how reliable they've proven to be but it's a start...

Cheers!

This looks promising!: https://www.adafruit.com/product/1588 for the arduino and https://www.adafruit.com/products/1327 for the rpi.

The ez-link description says "Linux is not supported at this time" but that doesn't make any sense to me as os compatibility is dependent on the bluetooth module on the rpi end. It looks like the ez-link is just plug and play.

[Edit] or this: https://www.adafruit.com/products/1628 Too bad neither of these are in stock right now.

[Edit] or this: https://www.sparkfun.com/products/12577 These things are expensive, I'm liking atoughram's suggested module.
 
I'd have to assume so, I know that module takes some initialization strings before it will work and thats why I didnt use it on the megaquirt at the time. but if you put a pro mini in between it and the arduino, you could program the pro-mini to initialize the BT and then pass the serial info from the arduino, I dont think the arduino will know the difference.

On the Rpi side, I wonder if a standard BT USB dongle would work?? And like you said, show up in /dev/tty*???

Could be...

This article links to the same bluetooth module that you did. They seem to have it running "plug & play" on the arduino without initialization strings. Is that not the case?
 
It's difficult to make out the wiring from your photo but here's the encoder portion from the BrewPi RevC shield schematic.

Hope it helps

Thanks, Thats exactly how I've got it wired.... I think...

I'll have to take a closer look at it and see where I screwed it up.. :drunk:
 
This article links to the same bluetooth module that you did. They seem to have it running "plug & play" on the arduino without initialization strings. Is that not the case?

Might be - I didnt ever implement the BT module on my megasquirt, and never tried it on the arduino. I bet that there has to be some sort of initialization though, how else would you pair it to another device?

EDIT - After reading that article, they make it look easy dont they?? It's almost worth the three bucks for me to try that out. The BT module I bought doesnt have a fancy breakout board.

IMG_0480.JPG
 
It's difficult to make out the wiring from your photo but here's the encoder portion from the BrewPi RevC shield schematic.

Hope it helps

So... It's not how I had it wired... It's how I thought I had it wired...

Somehow I had transposed Pins 7,8, & 9 to pins 8,9, & 10.

Changed that around and presto! It works! :) :ban:
 
The bluetooth solution looks promising, and it's cheap enough to go ahead and find out what the devilish details turn out to be. Found the Arduino board and a BT4.0 class 2 dongle that's worked on the RPi for $8 total, delivered by Monday by Amazon.

I'm in. We'll see where this particular worm hole leads...

Cheers!
 
Sorry if I missed this in this HUGE thread....

Has anyone figured out a way to use the BrewPi temp logs to send an SMS message if the temp is too high or too low? In my case, I'm more interested in building a second BrewPi to monitor/control my 600 bottle wine cabinet, but I could see this function being useful for monitoring a ferm chamber in case something bad happens.
 
Onewire DS18B20 is a digital element, so why we use it in a analogic port instead digital port? Is it better? Is it possible without losses?

Thks,

Fabiano da Mata
 
Anyone knows in what file/module is difined what port is to be used by onewire sensor and how many bites is difined by the onewire?

Thks again

Fabiano
 
Brewpi uses all the digital ports for other things. Lcd, encoder, actuators, piezo, door sense. The pins can be changed in atmel studio, but it's very easy to break stuff. Some pins can be assigned in pinList.py but this is also unstable in certain situations. Why exactly would you need to change this?
 
Onewire DS18B20 is a digital element, so why we use it in a analogic port instead digital port? Is it better? Is it possible without losses?

What means this?

"Analog" vs "digital" "port" on Arduino is reflection of extended IO pin capability, not necessarily usage. DS18B20 can only be accessed "digitally"...

Cheers!
 
Does anyone know how many amps this setup draws @ 5V? Would 26AWG wire be too small to handle the load?

Also does the Arduino power the Pi or do you need a separate power cord for the Pi?

Thanks
 
The pi powers the arduino.

Well, it can - via the USB connection - but that has proven to cause some folks problems with voltage drop from RPi to Arduino.

And I use 22 gauge hook up wire

That's as low as I'd go.

If powered via its USB port The Uno should draw less than .5A. Indeed it has a polyfuse between the USB connector and the on-board 5V power distribution rated for that current...

Cheers!
 
The arduino can power the pi. But only if the pi is already running. At least that's what I found with the b+. It's not a very reliable way of powering the pi since after a power loss the pi doesn't come back on.
 
The arduino can power the pi. But only if the pi is already running. At least that's what I found with the b+. It's not a very reliable way of powering the pi since after a power loss the pi doesn't come back on.
That's odd. I had the power go out last week for about four hours and everything came back up when the power came back.
 
Is your pi powering your arduino or is your arduino powering your pi
 
fwiw, I'm going to be doing a power survey on my system soon (RPi/AlaMode/Uno R3/2ch Sainsmart relay board/8 DS18B20 probes/6 SF800 meters/4 port usb2 hub/60mm 5vdc bb fan/handful of leds), just waiting on some rather esoteric replacement fuses to arrive for my Tek DVM, just in case. Curious about what the actual demands are.


Random stuff: Ran cat5e to the keezer today to free up a USB port plus gain the quicker response and more reliable communication. With the kids home with spouses et al the house was so full of wifi devices this week the poor Edimax in the "nearly dead wifi zone" of the house was struggling to maintain a heartbeat and went off-line a handful of times. Not good.

Along with the increased bandwidth and much more reliable communication, going hardwired frees a USB slot, which will come in handy in the event I get BrewPi to talk to an Uno over Bluetooth...

Cheers!
 
fwiw, I'm going to be doing a power survey on my system soon (RPi/AlaMode/Uno R3/2ch Sainsmart relay board/8 DS18B20 probes/6 SF800 meters/4 port usb2 hub/60mm 5vdc bb fan/handful of leds), just waiting on some rather esoteric replacement fuses to arrive for my Tek DVM, just in case. Curious about what the actual demands are.


Random stuff: Ran cat5e to the keezer today to free up a USB port plus gain the quicker response and more reliable communication. With the kids home with spouses et al the house was so full of wifi devices this week the poor Edimax in the "nearly dead wifi zone" of the house was struggling to maintain a heartbeat and went off-line a handful of times. Not good.

Along with the increased bandwidth and much more reliable communication, going hardwired frees a USB slot, which will come in handy in the event I get BrewPi to talk to an Uno over Bluetooth...

Cheers!

FYI regarding the bluetooth, did a little digging and I'm confident you can get it to work but you may have baud rate issues that would require recompiling brewpi-avr. I have the compile commands for avrgcc saved somewhere so let me know if you need me to dig them up for you.
 
Need help!

I have the Arduino UNO hooked up to the Raspberry PI and all the wiring appears to be right.

It seems that Brewpi is not communicating to the Arduino UNO. I'm not that great with programming.

I can bring up my web interface, but u can not open the maintenance panel and the script button is blank.

Please help me if you can!
 
Need help!

I have the Arduino UNO hooked up to the Raspberry PI and all the wiring appears to be right.

It seems that Brewpi is not communicating to the Arduino UNO. I'm not that great with programming.

I can bring up my web interface, but u can not open the maintenance panel and the script button is blank.

Please help me if you can!

Can you get a terminal open for you pi?

Try running the updater, that will fix weird problems. Here is the command:

sudo ~/brewpi-tools/updater.py
 
I tried the updater.. It says it can not get the arduino to respond.

It states that it maybe running an older version of Brewpi.

I am using an Arduino Uno R3 and a raspberry pi b+

In the Web interface it says "Live LCD waiting for update from script..."

The "Run Script" button is still blank and I can not open the maintenance panel.

Im sucking at this so far lol
 
I tried the updater.. It says it can not get the arduino to respond.

It states that it maybe running an older version of Brewpi.

I am using an Arduino Uno R3 and a raspberry pi b+

In the Web interface it says "Live LCD waiting for update from script..."

The "Run Script" button is still blank and I can not open the maintenance panel.

Im sucking at this so far lol

First of all, do you have any expereince with the arduino? Can you plug your arduino into another computer that has the arduino IDE and upload the blink sketch from there and confirm that the arduino is working correctly? After you know your arduino is fine you could try this to see if your arduino is showing up on the correct port:
With the arduino disconnected run the command
Code:
ls /dev/tty*
and note the output. Then plug the arduino back into the rpi and run the same command again. There should be one additional result this time, and that is the port that the rpi is assigning your arduino. If it is not ttyACM0 then that may be your problem and you can follow this instruction to fix it: http://docs.brewpi.com/after-install/program-arduino.html

http://docs.brewpi.com/after-install/program-arduino.html
 
i have done all that and still get nothing.

Can you answer the questions about brewpi?

The "Run Script" button is just a blank white box and i can not open the maintenance panel.
 
i have done all that and still get nothing.

Can you answer the questions about brewpi?

The "Run Script" button is just a blank white box and i can not open the maintenance panel.

Well there's your problem right there...

I'm going to assume that you have a USB cable connected between the Arduino and the pi correct?

Is the little LED "On" light illuminated?

ArduinoUno_R3_Front.jpg


If you dont have a LED "On" light, disconnect all of your I/O so that all you're powering is the Arduino board, I wonder if you have a short circuit out in the IO somewhere.
 
The "Run Script" button is just a blank white box and i can not open the maintenance panel.

The run script button wont activate until the pi can see your Arduino.

Until your pi and Arduino start talking, the pi will act like it doesn't exist hence no maintenance panel.

Right now the situation is the pi cannot see the arduino on USB. Until that is fixed, nothing will work.
 
OK! Awesome!

I will try disconnecting everything from the Arduino Uno and connecting it to the PI. As far as i can remember the on led was lit, but maybe there is an issue else where. I will get back to you with the results.

Thanks a lot guys.
 
ok guys,

the on light is definitely on and i have done the updater.

i selected my Arduino UNO version because it says that it cannot connect to the arduino uno.

after running the Brewpi-UNO-revC.hex like the beginning of this post says to.

its starts communicating with the arduino uno then comes up with this:

Warning: Cannot receive version number from Arduino. Your Arduino is either not programmed yet or running a very old version of BrewPi. Arduino will be reset to defaults.

then it goes through a couple of other things and comes up with this:

Warning: Cannot receive version number from Arduino after programming. Something must have gone wrong. Restoring settings/devices settings failed.
 
Just a thought here. Have you tried to power the Arduino off something else? See if it powers off a laptop. Doesn't really help beyond seeing if the Arduino will power up but it is a quick test of it. I am assuming you are powering the Pi off a cell phone type charger. There are lots of them out there with different output capacities. Maybe your power supply is not putting out enough power to run both devices.
 
the on led is offly bright though. i have ran it off my laptop before when i first got the arduino uno to do the blink program for fun.

this is frustrating... i just want it to work like the beginning of this post suggests.
 
the on led is offly bright though. i have ran it off my laptop before when i first got the arduino uno to do the blink program for fun.

this is frustrating... i just want it to work like the beginning of this post suggests.

Lets see if you have infact loaded the hex file unto the arduino. Take the arduino off the pi and plug it into your laptop. Open the arduino IDE and then the serial terminal at 57600 baud. type h{v:1} and send it to the arduino. If you get a bunch of stuff that looks kinda like this
Code:
{"i":3,"t":1,"c":1,"b":1,"f":9,"h":2,"d":0,"p":18,"a":"28B4F75C06000029","j": 0.000},{"i":4,"t":1,"c":1,"b":1,"f":5,"h":2,"d":0,"p":18,"a":"2892C15C06000035","j": 0.000},{"i":5,"t":1,"c":1,"b":1,"f":6,"h":2,"d":0,"p":18,"a":"28B7AF5B0600005D","j": 0.000},{"i":-1,"t":0,"c":1,"b":0,"f":0,"h":1,"d":0,"p":2,"x":1},{"i":2,"t":3,"c":1,"b":1,"f":2,"h":1,"d":0,"p":5,"x":1},{"i":1,"t":3,"c":1,"b":1,"f":3,"h":1,"d":0,"p":6,"x":1},{"i":-1,"t":3,"c":1,"b":1,"f":3,"h":1,"d":0,"p":19,"x":1},{"i":-1,"t":3,"c":1,"b":1,"f":3,"h":1,"d":0,"p":4,"x":1}]
then that means you do infact have the hex file loaded onto the arduino. [EDIT] Rather, if you get any kind of response that looks like json.

If you don't have the hex file installed we can do that manually. Are you running linux or windows on your laptop?
 
my laptop is a mac, so osx

Did you check to see that the hex file is loaded? If not you can try this:
Plug the arduino into your mac, open the arduino ide and find the preferences menu. Check the box Show verbose output during upload.

Upload the blink sketch. In the black output window on the bottom scroll through and find the command that the ide actually used, something like this at the very top of the output:
Code:
/usr/share/arduino/hardware/tools/avrdude -C/usr/share/arduino/hardware/tools/avrdude.conf -v -v -v -v -patmega328p -carduino -P/dev/ttyS0 -b115200 -D -V -Uflash:w:/tmp/build7006147667290905184.tmp/Blink.cpp.hex:i
This is output from a linux machine so yours may look different.

Next download the hex file to your home folder. Then use the command you found above to manually upload the hex file to the arduino, substitute the last part that looks like this /tmp/build7006147667290905184.tmp/Blink.cpp.hex with the path to your hex file that you downloaded.

Here is what my command to manually upload from linux would look like:

Code:
/usr/share/arduino/hardware/tools/avrdude -C/usr/share/arduino/hardware/tools/avrdude.conf -v -v -v -v -patmega328p -carduino -P/dev/ttyACM0 -b115200 -D -V -Uflash:w:/home/kraken/brewpi-uno-revC.hex:i

[EDIT] You run the above command from your terminal, I've forgotten how to access the terminal on a mac and don't know if you are familiar, I think the Terminal app is in /Applications/Utilities
 
Someone earlier in this thread had issues programming the arduino if it previously had a sketch written to it. You may want to reprogram the arduino from the arduino IDE using a blank sketch and then trying again.

Edit: by blank, I mean the bare minimum. I believe this sketch is in the IDE examples.
 
AHAHAHAHAAAHHHAAHAHA!!!

I......GOT......IT......WORKING!!!!!!!!!!!!!!!!!!!!!!

YESSSSSSSSSS!!!

But it took me 3 days to figure it out. it ended up being a script problem on the arduino. I updated the PI, the each up date with sudo ~/brewpi-tools/updater.py. THEN when it asks do you want the PI to automatically update your Arduino I say yes (like I did in the past), but this time when it asked me if I wanted to keep the settings that are on the arduino and the device settings on the arduino. I SELECTED NO. That ended up being it. The other scripts I had on the Arduino must have been the problem.:smack:

ANYWAY its working.

NOW I just need a fridge lol :rocking:


Thanks for all the help guys. It was actually a pretty good beginners programming lesson with troubleshooting and programming.!!
 
AHAHAHAHAAAHHHAAHAHA!!!

I......GOT......IT......WORKING!!!!!!!!!!!!!!!!!!!!!!

YESSSSSSSSSS!!!

But it took me 3 days to figure it out. it ended up being a script problem on the arduino. I updated the PI, the each up date with sudo ~/brewpi-tools/updater.py. THEN when it asks do you want the PI to automatically update your Arduino I say yes (like I did in the past), but this time when it asked me if I wanted to keep the settings that are on the arduino and the device settings on the arduino. I SELECTED NO. That ended up being it. The other scripts I had on the Arduino must have been the problem.:smack:

ANYWAY its working.

NOW I just need a fridge lol :rocking:


Thanks for all the help guys. It was actually a pretty good beginners programming lesson with troubleshooting and programming.!!

out of curiosity, did you ever try this command:
sudo python /home/brewpi/programArduinoFirstTime.py

?
 
Status
Not open for further replies.

Latest posts

Back
Top