Show Posts
Pages: [1]
1  Community / Gigs and Collaborations / Re: URGENT - Bar Owner Needs Help On iPad Kegmate on: March 17, 2011, 09:33:25 am
I am working on an arduino powered beer bottle filler. It is made to have all of your beer lines come into a valve block, and then fill the bottle with whichever beer you want.

I could supply the beer hardware for $8-$10,000 and you can get someone else to write your card reading software.

doug
2  Community / Gigs and Collaborations / Re: PCB layout in the Bay Area on: March 17, 2011, 09:26:37 am
Download a program called Eagle. It is a pcb cad program. In one part you draw your schematic, using a library of symbols, then you go to board layout and place the components and route the traces. (although it has an autoroute function,i prefer to hand route my traces.)

Eagle has a free version that limits you to a board size of approximately 3"x4" and only 2 layers. Commercial licenses can be purchased to make bigger boards.

Check out Adafruit for her eagle library of commonly used parts.

It takes a while to learn, and can be time consuming, but it does a good job and can export files to pcb making companies. Or you can print your own with the toner transfer method.

doug
3  Using Arduino / Networking, Protocols, and Devices / Re: i2c arduino slave(ry) on: March 01, 2011, 09:38:46 pm
thanks, you're right, i hadn't tried to compile it yet. i tend to have to go over things to sort out the syntax. I am not a programmer, and Arduino is my first experience with c++. I usually manage to get things working, and when i do i invariably learn something. When i am away from it for a while, i get rusty.

i will try out your suggestions and get back.

doug
4  Using Arduino / Networking, Protocols, and Devices / Re: i2c arduino slave(ry) on: March 01, 2011, 02:01:09 pm
Ok, me again.

Here is my hardware setup:

On the left i have an arduino controller i made with LCD, pushbutons, i2c bus, i2c clock and i2c eeprom. i want to use this as my master.

On the right is my slaveduino, taking it's power from i2c bus with a couple of mpx4250 pressure sensors on analog pins and some darlington drivers on digital outputs with protection diodes to i can operate solenoids without blowing everything up.

if it all works out, maybe i could share the eagle files to make the pc boards...


doug

(if i consider my time worth anything it would have been cheaper to buy arduinos, but i am stubborn)

5  Using Arduino / Networking, Protocols, and Devices / i2c arduino slave(ry) on: March 01, 2011, 01:29:40 pm
I was going to try to continue a thread from the old system, but it looks like i must start a new one.


I have been playing with i2c multiplexers with some success, and want to use a slave arduino as an intelligent multiplexer/ io system.

Typically with mcp 23008 you send a "command byte"  to either read or write a specific register, and then if writing, send a byte (or bytes) to write; or if reading, request a byte (or bytes) to get your answer.


I want to have some basic commands to ask my slave to read values (either the result of it's calculations or input readings).

I also want to be able to pass values to the slave to tell it what to do (maybe write to outputs, or run a predetermined subroutine)

I understand that in the setup i must put: Wire.onReceive(receiveEvent); which interrupts and runs receiveEvent when somebody on the i2c bus is trying to send the slave something.


(As an aside, i noticed in most examples, void receiveEvent(int howMany) without any further reference to howMany . Is that just sloppy that they left provision for howMany, but didn't use it, or is it required?)



What i did was to have receiveEvent read the first value as a Register, and read the rest into an array  data[] which keeps collecting until the transmitter stops transmitting.

The writing routines seem simple in that, i can use switch /case based on the Register sent and decide where to write the data (i may need to work out global variables for that...)


Quote
void receiveEvent(int howMany)
{
  int data[];
  byte beer;
  byte i=0;
  byte Register = Wire.receive();
  while( Wire.available()) // loop through all incoming data
  {
    data= Wire.receive();
    i++;
  }
  Wire.endTransmission();
  switch(Register()){
  case 0x00:  // write a/d 0
    digitalWrite(A0, data[0]);
    break;
  case 0x01:  // write a/d 1
    digitalWrite(A1, data[0]);
    break;




I am concerned about the reading routines. If i had a case statement for the reading routine that recognizes the master is looking for something. i need to find the easiest way to send it. if the master were to follow it's write with a read request: Wire.requestFrom(address, bytes); then the slave would jump into Wire.onRequest(requestEvent); subroutine .

can i
1. not have a Wire.onRequest(requestEvent); so that the next statement in my case executes and sends the data back.

2. set a flag that tells the requestEvent which register was requested, and what data to send.

3. send the data automatically, and set my master up with a Wire.onRequest(requestEvent); to jump out and receive the data.

thanks for the help
doug
6  Forum 2005-2010 (read only) / Interfacing / Re: Bootloader burning hardware? on: January 15, 2010, 12:54:17 pm
I want to try to program the bootloader on a mac (osx10.5, ibookG4)

Is it possible to get one of those usb to parallel cables, and then attach the cheap and cheerful parallel port isp writer from arduino website. (db25 connector and 3 resistors)

Will i then be able to run this with the Arduino IDE.

I am ok if this is slow, since i won't often need to burn the bootloader.
thanks
doug

P.S. i want to try this partly because i am cheap, and partly because i like using technology in ways it wasn't intended to be used.
7  Forum 2005-2010 (read only) / Interfacing / Re: interfacing with mcp23018 io expander via i2c on: January 03, 2010, 07:17:10 pm
thanks

i have spent months trying to figure this out. i only read the open drain part recently, and with your explanation have been able to make it work.

i put a pullup resistor on the output pin, and an led between output pin and ground, and it works. I set the output resistor to limit the current through the led, and bob's your uncle.

thanks
doug
8  Forum 2005-2010 (read only) / Interfacing / interfacing with mcp23018 io expander via i2c on: December 29, 2009, 12:00:48 am
hello

i am having a confusing problem.

i am trying to get a 16 bit io expander chip to work with i2c.

When i send the output pin (olat) binary 1, i would expect it to have +vdd, and 0; n/c.

instead, 1= nc/ and 0= gnd

in the setup  of my code, i set IOCON as 0x00 to select bank 1, i set IODIR = 0x00 as an output, and have even tried GPPU = 0xff for internal pullup resistor.

the really strange thing is that i have used the sister chip, mcp23008 which is similar but only 1 8 bit bank.


the only difference i can see is that the datasheet specifies the outputs as open drain. i don't understand what that means.

any ideas, thanks
doug
Pages: [1]