Thursday, March 29, 2012

Blow it!

Hey guys!
Just thought it may be a good idea to make a little video for you:
(Again, maybe the last time, sorry for my bad English... ;)

cya!

Welcome home!

Good morning!
I've finally put the electronics into its housing:
I removed the sockets on the relay board and soldered in the cables directly. Then I made those brown bridges to simplify phase supply. Eventually I hot glued the arduino and the board in their respective places and made a hole in the top cover to grant access to the usb connector. What a fun with a screwdriver and a scalpel... :)
I also opened the washing machine, removed the supply cable and the hoses and tried to identify the different parts. Heating, pump, motor and solenoid valve were easy to find, how I predicted. However theres this red thing:
It almost must be the level sensor, since theres only one hose going to it. But damn, all those cables?! Further investigation will be necessary. And theres a wire coming out the drum I've no idea what it could be.
And unfortunately, there are tons of white cables in that machine, without any labels of course. I spent hours and hours over those damn schematics without really finding out what I could safely bridge without killing the electronics and thought that I'll move further when I see it. Nope. White wires. 
For the moment, everything is only super provisionally and in an experimental state, I try to not damage anything so if the beer brewing really shouldn't work I can still wash my clothes with it. So I now disconnect everything and control every component myself. To replace a solenoid valve or an other small part would not be the bad like the whole electronics. So I bought a fault current switch and made a cable with a switch and two sockets and I'll start testing today part after part. 
I also pulled out the motor and searched the interwebz for a method to hook it up. Well.
There are two red wires for the speedometer, a blue and a white for the rotor, a brown and a green for the spool and two black I've no idea. :) So I went to a friends top secret quadricopter drone laboratory and hooked my motor to a adjustable AC power supply. The phase to one end of the spool, the other end bridged to one end of the rotor and its other end to neutral. A deep breathe, 50V and it works! 100V, 150V, 200V - like a charm! So I ordered some TRIAC thingy to regulate the speed of the motor. I'll build two of them with potentiometers into my electronics box for two speeds, one for normal brewing and the other for spinning, controlled by two relays. I wonder if that is going to work... :)
I'll try to be back soon for results on the other parts. 
Although I know about the dangers of playing around with 230VAC and try to work as safe as possible, like with a fault current switch, fuses and good isolation, theres still a risk. 
So if I don't come back here, you know I died for the good cause and I hope you'll celebrate me as beer hero! ;)

Monday, March 26, 2012

Manpower


There it is! It took only tons of manpower of three real men and it almost flew up those four floors!
And look how it smiles ready to become a beer brewing machine!
I spoke with some electricians and nobody really knows yet how I'll make the motor turn how I want. I'll open it and do some real washing machine brain surgery... :)

Wednesday, March 21, 2012

Schemes

Good morning!
The electronics part is ready so far, I'm thinking about its housing, and I'll get the machine this Thursday. In the meantime I've been studying the schemes I retrieved.
Unfortunately, they're not really complete...
Some interesting facts:
  • I expected different voltages, like 5V, 12V and 230V for the different parts. Nope. 100% 230V.
  • The program selector is most likely a pure electromechanical device. 
  • It switches pins on the motor control board on and off.
  • The level measurement is done with a pressure switch in a small tube and knows 4 states, 0, Level I, II and III.
  • The heating is pretty powerful in my opinion, 1950W.
  • It's a 230V AC single phase motor with a speedometer.
  • It seems like there are six different spinning speeds possible .
  • There are several safety devices like thermostats, motor protection switch, over tension switch, foam switch, cover lock switch...
Some reflections about that:
  • I think it's pretty comfortable that everything is directly in 230V, so I can hook up the pump, the electro valve and the heating directly to my relay board.
  • I'd love to keep the motor controller doing its work, because there are good things built in, like smooth run up, overcharge control and imbalance control.
  • I'll have to bridge some of the securities to keep it working and I hope that I don't grill it by trying out which and when.
  • I hope to be able to use only two relays for the motor, one for normal brewing, about 30t/min, and the second for spin drying. There are buttons labeled 700t/min and variomatic spin dry, that should reduce the revolutions to 700t/min instead of 1000t/min and run it up relatively smooth.
  • I've no idea yet, how the different speeds are achieved. If it's made with resistors I wouldn't care to mess around with it directly, without the controller. If it's done trough frequency transformation or other sorcery I'll be knee deep in... well, you got the point.
If somebody out there coincidentally already had to control such a motor, feel free to teach me in that witchcraft. 
But for now, wish me luck, those machines are heavy and I've to bring it down  from the third floor and back up to the fourth, without an escalator, of course...

Thursday, March 15, 2012

POSIX hero

Good morning my thirsty friends!
It's been a long time, well, 10 days, since my last entry. I'm sorry for that, although I really made big progress, there wasn't much thrilling things to tell. I'll do that all in once, today in this post. It's going to be pretty technical and dry, so if you skip this one I'll understand... :)
By browsing on some forums I found a software called "Mash-it" from a german hobby brewer. (Thank you, Dunkelbrauer!) It's written in Java, and although everybody knows that Java is never the solution ;) and he doesn't use the same hardware as me, I was happy to find that. He implemented a possibility to drive the hardware over command line tools. The software expects a temperature sensor and a heater and you can add a mixer. For the heater and the mixer you've to be able to send on and off commands over command line, and you need a command to make your hardware print their switch state and the temperature to the systems standard output. So far so good, as I was already able to send for example 1on over the arduinos serial monitor to switch on the LED 1 on my arduino, send a 1get and receive a 1 for on or a 0 for off as state of each of the eight outputs and send temp to make the arduino print the current temperature. So I only had to find a program which sends those commands over serial to my arduino and was accessible trough command line, which must be an easy step, I thought.
Well, one can be quite wrong.
After some googling I tried to do that with "screen". Pretty easy, you type screen /dev/cu.usbmodem621 in your terminal and you've a session open where you can send end receive data from the arduino. But theres no way to make a single command send temp and retrieve the data back, which is what I'd need for Mash-it. And even worse, every time you open a screen session, it resets and reboots the arduino which makes all outputs blink uncontrolled for a moment, absolutely not usable. At this moment I was far from knowing that you can cut the connection on the solder pads called reset-en on the arduino to prevent it from resetting on every serial access, I thought it was an issue with screen.
Back to google and arduino.cc I found popen(). But you can't read back data from serial with that neighter, basically the same problem like before. Than came the magic word: POSIX. I really thought: thats it! as I found "arduino-serial". But long story made short: I didn't get it to work. It sent data and sometimes received something but very very shaky and unreliable. And worst of all it lost the carriage return on its way trough serial, which is elementary for the input parsing I do on the arduino.
Well damn it, I'll work trough POSIX. And thats why it took me 10 days for my next entry here. :)
I first had to see, that my C was still not on a usable level, because I didn't understand anything in the tutorials and howtos for POSIX and serial communication. So, let's do it, once again: "Learn C on a Mac" by Dave Mark. That's where you want to start your programming career. So after a whole day spent in learning C again, shit became serious. I started writing my own little C serial program, called "mylittleserial.c". If somebody's interested to get it just say. Step by step I worked my way trough all that stuff. Opening a serial port and write to it is relatively easy, although you wont believe how many damn parameters you can (and must) set. I became almost crazy with that old prehistorical modem initialization stuff... But reading data back from the serial port is a whole oder story. You really have to read byte after byte and time and parse that shit correctly or you'll get unpredictable results. You can't imagine how long I tinkered around until I found out that I need to wait two seconds after booting the arduino before I can talk with him. And as it became slowly stable, I encountered the problem that after a temp command it didn't accept anything else and I had to reset it. Imagine, you can turn on and off every LED ten times in a row like a charm, but ask once for the temperature and you're done. And all that because of a f€@&ing = instead of a >. But then, tuesday evening the breakthrough. Mash-it has a manual hardware control build in and it worked! It turned my LEDs on and off and read the temperature!
That definitively made one future beer brewer happy! :)
Last thing I had to fix was the hard coded port. I had to enter the usb port on which the arduino hung manually in the source code before compiling and I didn't want to give it as a parameter on every program run so the program needs to find the arduino by himself. I do that by searching /dev for cu.usbmodem and after some hacking around it now works perfectly.
Here's a picture of the hardware simulation of mash-it running my arduino.

Sorry again for the boring post, but maybe there's people out there which encounters the same problems as me and now they know where to get help. And I'm confident that the next post will rock more... :)
Cya buddies, thx for the attention!

Monday, March 5, 2012

Big step forward

Hi out there!
I've made a lot of progress lately and it is time to bring you up to date. I worked my way trough the tutorials of the sparkfun kit to understand the principles of arduino programming. By the way I soldered the relays on the board. It definitively would have been funny for a pro to watch me doing that, I've never done that before...

The next challenge was to get the DS18B20, the 1-wire temperature sensor, working. I don't really like it to use foreign code in my projects when I'm not 100% sure what it does, which is often the case when you implement huge libraries which are simply to huge to work trough and understand everything. So I've been pretty glad to find this link on the arduino.cc playground. A simple piece of good commented code and I was easily able to get temperatures on my arduinos serial monitor. It works amazingly good, by just holding the sensor between two fingers I see the temperature changing almost instantly. On the picture below, the sensor is the black thing with three pins on the left of the red LED, wired to pin 14, ground and supply voltage on the arduino. On the screen's left are some temperature readouts on the serial monitor and on it's right a bit of sheepdogs code. Thank you buddy, wherever you are!
That was already a good bunch of work done.
My next goal was to be able to switch on and off eight digital outputs, read their state and get the temperature trough serial data communication between my mac and the arduino. With that I'd be able to switch on and off the heating or the pump from within a program. This tutorial helped me a lot. 
Although it is pretty easy to read and write data from and to the serial port, I had to see that my C was pretty rusty. But once I found a bit back to the syntax I was able to filter entered data and remote turn on and off ports. By typing 1on on the serial monitor the arduino now turns on a LED or a relay, 1off turns it off again and 1get sends my either an one or a 0 depending on the ports state. I then added sheepdogs code, after some minor changes to fit my needs and by typing temp on the serial monitor it now sends me back the temperature. I just had a little issue with the sensor sending me 85 degrees on the first request but I fixed that by adding a counter. In the picture below you can see my test setup with eight LEDs instead of the relays, the temperature sensor, some code on the screens background and the temperature and a state readout on the serial monitor.
 Well, that seems like a big step forward direction beer for me! Next step will be to write a program to manage the brewing. I'll soon be back here and post about my progress, cya fellows!