Go Down

Topic: Cart and Bin Project 60 Shelves (Read 3119 times) previous topic - next topic

Henry_Best


We're not set up for Infrared. That's something to consider though. These are all the same sizes. It'll be a one-size-fits all product.

I was thinking of IR beams on the trolley. 10 rows of 6 columns (or vice versa) = 16 beams. Putting an item into a bin would break 2 crossing beams. Knowing which 2 beams were broken will tell you which bin the item was placed in. A 74HC4067 (16 chanel multiplexer/demultiplexer) would do that for you at the expense of 5 pins on your arduino.

The other method would be some sort of weighing device under each bin. Each item in the bin will add to the weight, until you've got 5 times the weight of one item in the bin. However, the fact that the bins are on a trolley and the items are light, the vibration caused by moving the trolley along will probably cause some inaccuracy in this method.

Henry_Best


I didn't plan on using all 8 pins, but rather five on each IC. I can deal with a 75 digit Hex value. It will certainly not be fun if there is a typo. However, how likely could the wrong LED light up when the right hex value is passed in a chain that long?


As long as your wiring, code and the hex value are all correct, very unlikely. About the only thing that could cause an error is some sort of power glitch.

How are you planning on powering the electronics on the trolley? A long mains lead appears out of the question. ;)

ScottA1

#17
Jul 16, 2013, 06:22 am Last Edit: Jul 16, 2013, 06:27 am by ScottA1 Reason: 1
I think I'm getting closer to my solution. Is there someone who can tell me how I to make pin 13 light up from this example?

Code: [Select]
void setup()

{
pinMode(11, OUTPUT); //DATA
pinMode(8, OUTPUT); //Latch
pinMode(12, OUTPUT); //CLOCK
}

void loop()
{
digitalWrite(8, LOW);
shiftOut (11, 12, MSBFIRST, '13');

digitalWrite(8, HIGH);
digitalWrite(8,LOW);
}

ScottA1



We're not set up for Infrared. That's something to consider though. These are all the same sizes. It'll be a one-size-fits all product.

I was thinking of IR beams on the trolley. 10 rows of 6 columns (or vice versa) = 16 beams. Putting an item into a bin would break 2 crossing beams. Knowing which 2 beams were broken will tell you which bin the item was placed in. A 74HC4067 (16 chanel multiplexer/demultiplexer) would do that for you at the expense of 5 pins on your arduino.

The other method would be some sort of weighing device under each bin. Each item in the bin will add to the weight, until you've got 5 times the weight of one item in the bin. However, the fact that the bins are on a trolley and the items are light, the vibration caused by moving the trolley along will probably cause some inaccuracy in this method.


I'm going to look into this!

ScottA1



I didn't plan on using all 8 pins, but rather five on each IC. I can deal with a 75 digit Hex value. It will certainly not be fun if there is a typo. However, how likely could the wrong LED light up when the right hex value is passed in a chain that long?


As long as your wiring, code and the hex value are all correct, very unlikely. About the only thing that could cause an error is some sort of power glitch.

How are you planning on powering the electronics on the trolley? A long mains lead appears out of the question. ;)


I plan to use a 12 V rechargeable battery.

craigcurtin




I didn't plan on using all 8 pins, but rather five on each IC. I can deal with a 75 digit Hex value. It will certainly not be fun if there is a typo. However, how likely could the wrong LED light up when the right hex value is passed in a chain that long?


As long as your wiring, code and the hex value are all correct, very unlikely. About the only thing that could cause an error is some sort of power glitch.

How are you planning on powering the electronics on the trolley? A long mains lead appears out of the question. ;)


I really think the code is going to be a bit of nightmare to maintain with all those shift registers.

If you looked at the i2c products that i suggested you can logically number them to co-incide with the bins and streamline your code and have it make logical sense

Craig


I plan to use a 12 V rechargeable battery.

ScottA1

#21
Jul 16, 2013, 04:17 pm Last Edit: Jul 16, 2013, 04:23 pm by ScottA1 Reason: 1
It will be ok. At my level this will be hard, but I'm wanting to go through it for the learning curve. I believe I will be looking at I2C or Raspberry Pi for the next project.

ScottA1

#22
Jul 16, 2013, 05:31 pm Last Edit: Jul 16, 2013, 05:36 pm by ScottA1 Reason: 1
Okay, check this out. I was able to work out this solution. Maybe someone can take me to school and tell me why these digits work. Me and a couple of guys were playing with numbers and came up with this.

Code: [Select]

shiftOut (11, 12, LSBFIRST,0x00000080);        \\works the first light on the last shift register
shiftOut (11, 12, LSBFIRST,0x00000040); \\works the second light
shiftOut (11, 12, LSBFIRST,0x00000020); \\works the third light
shiftOut (11, 12, LSBFIRST,0x00000010); \\works the fourth light
shiftOut (11, 12, LSBFIRST,0x000000080);       \\works the fifth light on the first shift register.


So, last is first and first is last. I am relying on the clock on the shift register to move bits to the correct LED. If I can somehow write to each shiftOut method each time we move to the next product, I think I will only need this plus whatever logic statements needed to write to each method. My next step is to change these methods through the serial.

Code: [Select]

void setup()

{
pinMode(11, OUTPUT); //DATA
pinMode(8, OUTPUT); //LATCH
pinMode(12, OUTPUT); //CLOCK
}

void loop()
{
digitalWrite(8, LOW);
shiftOut (11, 12, LSBFIRST,0x00000080); // #59 last shift register
shiftOut (11, 12, LSBFIRST,0x00000040); // #58
shiftOut (11, 12, LSBFIRST,0x00000020); // #57
shiftOut (11, 12, LSBFIRST,0x00000010); // #56
shiftOut (11, 12, LSBFIRST,0x000000080); // #55
shiftOut (11, 12, LSBFIRST,0x000000040); // #54
shiftOut (11, 12, LSBFIRST,0x00000080); // #53
shiftOut (11, 12, LSBFIRST,0x00000040); // #52
shiftOut (11, 12, LSBFIRST,0x00000020); // #51
shiftOut (11, 12, LSBFIRST,0x00000010); // #50
shiftOut (11, 12, LSBFIRST,0x000000080); // #49
shiftOut (11, 12, LSBFIRST,0x000000040); // #48
shiftOut (11, 12, LSBFIRST,0x00000080); // #47
shiftOut (11, 12, LSBFIRST,0x00000040); // #46
shiftOut (11, 12, LSBFIRST,0x00000020); // #45
shiftOut (11, 12, LSBFIRST,0x00000010); // #44
shiftOut (11, 12, LSBFIRST,0x000000080); // #43
shiftOut (11, 12, LSBFIRST,0x000000040); // #42
shiftOut (11, 12, LSBFIRST,0x00000080); // #41
shiftOut (11, 12, LSBFIRST,0x00000040); // #40
shiftOut (11, 12, LSBFIRST,0x00000020); // #39
shiftOut (11, 12, LSBFIRST,0x00000010); // #38
shiftOut (11, 12, LSBFIRST,0x000000080); // #37
shiftOut (11, 12, LSBFIRST,0x000000040); // #36
shiftOut (11, 12, LSBFIRST,0x00000080); // #35
shiftOut (11, 12, LSBFIRST,0x00000040); // #34
shiftOut (11, 12, LSBFIRST,0x00000020); // #33
shiftOut (11, 12, LSBFIRST,0x00000010); // #32
shiftOut (11, 12, LSBFIRST,0x000000080); // #31
shiftOut (11, 12, LSBFIRST,0x000000040); // #30
shiftOut (11, 12, LSBFIRST,0x00000080); // #29
shiftOut (11, 12, LSBFIRST,0x00000040); // #28
shiftOut (11, 12, LSBFIRST,0x00000020); // #27
shiftOut (11, 12, LSBFIRST,0x00000010); // #26
shiftOut (11, 12, LSBFIRST,0x000000080); // #25
shiftOut (11, 12, LSBFIRST,0x000000040); // #24
shiftOut (11, 12, LSBFIRST,0x00000080); // #23
shiftOut (11, 12, LSBFIRST,0x00000040); // #22
shiftOut (11, 12, LSBFIRST,0x00000020); // #21
shiftOut (11, 12, LSBFIRST,0x00000010); // #20
shiftOut (11, 12, LSBFIRST,0x000000080); // #19
shiftOut (11, 12, LSBFIRST,0x000000040); // #18
shiftOut (11, 12, LSBFIRST,0x00000080); // #17
shiftOut (11, 12, LSBFIRST,0x00000040); // #16
shiftOut (11, 12, LSBFIRST,0x00000020); // #15
shiftOut (11, 12, LSBFIRST,0x00000010); // #14
shiftOut (11, 12, LSBFIRST,0x000000080); // #13
shiftOut (11, 12, LSBFIRST,0x000000040); // #12
shiftOut (11, 12, LSBFIRST,0x00000080); // #11
shiftOut (11, 12, LSBFIRST,0x00000040); // #10
shiftOut (11, 12, LSBFIRST,0x00000020); // #9
shiftOut (11, 12, LSBFIRST,0x00000010); // #8
shiftOut (11, 12, LSBFIRST,0x000000080); // #7
shiftOut (11, 12, LSBFIRST,0x000000040); // #6
shiftOut (11, 12, LSBFIRST,0x00000080); // #5
shiftOut (11, 12, LSBFIRST,0x00000040); // #4
shiftOut (11, 12, LSBFIRST,0x00000020); // #3
shiftOut (11, 12, LSBFIRST,0x00000010); // #2
shiftOut (11, 12, LSBFIRST,0x000000080); // #1
shiftOut (11, 12, LSBFIRST,0x000000040); // #0 first shift register
digitalWrite(8, HIGH);
digitalWrite(8,LOW);
}

ScottA1

LOL! I've taken myself to school.

You really don't need all of those zeroes.

Code: [Select]
shiftOut (11, 12, LSBFIRST,0x8);        \\works the first light on the last shift register
shiftOut (11, 12, LSBFIRST,0x4); \\works the second light
shiftOut (11, 12, LSBFIRST,0x20); \\works the third light
shiftOut (11, 12, LSBFIRST,0x10); \\works the fourth light
shiftOut (11, 12, LSBFIRST,0x80);       \\works the fifth light on the first shift register.

craigcurtin


LOL! I've taken myself to school.

You really don't need all of those zeroes.

Code: [Select]
shiftOut (11, 12, LSBFIRST,0x8);        \\works the first light on the last shift register
shiftOut (11, 12, LSBFIRST,0x4); \\works the second light
shiftOut (11, 12, LSBFIRST,0x20); \\works the third light
shiftOut (11, 12, LSBFIRST,0x10); \\works the fourth light
shiftOut (11, 12, LSBFIRST,0x80);       \\works the fifth light on the first shift register.



Good work - yes those Zero's were making it tough to read.

You probably want to turn this into a function so you can call it with something like

TurnOn 1,1
TurnOff 1,1 etc

By doing that you can wrap all of those shiftout statements up and not have to worry about them anymore.

Now back to the original problem - i assume at the start of the run you will download a CSV file with the days orders in it - will this be a wired connection at the mothership before the worker heads out on the floor ?

If it were me i would have an SD card and would download the product combination for each product as a seperate file

So lets say we get to product bin 1

The worker hits the start button
Your program reads the SD card and looks for product1.csv
Opens the file and finds the combination for Product 1
Lights all the relevant lights on the bins so he knows how many to pull and for which bins.

he moves on to product 2 and hits the button
Your program reads the SD card and looks for product2.csv etc etc etc

I would also include an LCD screen (at a minimum) with some code to prompt him which product he is picking etc and to let him change that (in case he presses the button twice etc)

Have a look at Liudrs stuff on here - he makes an excellent library for LCD menus and scrolling as well as selling the various components if you wanted to go that way.

Craig

ScottA1

Craig - Thank you for the tips. I will try to turn these shiftOuts into functions.

So, yes, there will be a .csv or .txt file upload. The idea is the setup a small tablet on the cart. What are we looking at there? I'd like to use a VB form that allows the worker to touch "back" and "next."

Or would it be easier to place use and SD card and an LCD screen?

I've found a couple of great libraries (I think) that I'm sure you're familiar with which are, Visual Micro and Firmata. Do you have a preference?

I would like to connect these Next Buttons to product1.csv, product2.csv, product3.csv, etc.

Thanks,

Scott

ScottA1



I would like to connect these Next Buttons to product1.csv, product2.csv, product3.csv, etc.



Actually, we think that multiple .csv files will slow down the process. We are hoping there is a way to code this from one .csv file that will have 60 columns and probably 100 rows. If there is a number between 0 - 5, then the program will send a signal to each light. One file and one upload should be better, right?

Scott

craigcurtin




I would like to connect these Next Buttons to product1.csv, product2.csv, product3.csv, etc.



Actually, we think that multiple .csv files will slow down the process. We are hoping there is a way to code this from one .csv file that will have 60 columns and probably 100 rows. If there is a number between 0 - 5, then the program will send a signal to each light. One file and one upload should be better, right?

Scott



Scott,

I would go much simpler to start with or you are asking for trouble

Dont try and interface a tablet as well (at least not in the first step)

I would build a simple LCD interface - have a look the PHI stuff from Liudr it will be the quickest way to get you going.

Loading small SD files will not take any time at all - later on if you really wanted to you could try and read it all into an array and then use the LCD buttons to bounce between elements in the array - but i would not try and build that to start with.

So at the start of the run or the night before - however your picking system works -

1)  the worker inserts a SD card that has been written by your order processing system with the list of orders for the day
2) trundles off to the first product bin
3) on the LCD panel he chooses the option (have a look at LIUDRs stuff - he sells an LCD with a rotary encoder that would be perfect for this) to start the days run
4) Your app goes to the SD card and reads the lowest numbered file - prints on the screen confirmation that these are todays orders and what product to start at
5) Worker confirms on the LCD he is at the right product shelf
6) System lights up the LEDS and he merrily picks away - you could get fancier here and only light one bin at a time with the LEDS and he has to confirm on the LCD as he finishes each bin and then the next one lights up - cuts down on errors but more to and fro for the worker
7) Once complete - he chooses the option on the LCD to continue to the next product and the sequence repeats until he gets to the end

Craig
8)

ScottA1

#28
Sep 24, 2013, 04:51 pm Last Edit: Sep 24, 2013, 05:01 pm by ScottA1 Reason: 1
We have built the cart and secured the lights to it. We are running into a power distribution problem, I believe and would like to ask if someone could point me in the right direction.

When we plug the Arduino into the series of lights (set up in series) it all works well up to bin 18. Once it goes past bin 18, the lights begin lighting up randomly throughout the entire series. When we stop at 18, the lights are controlled really well.

I'm not sure what to do to fix this yet.

Here are some photos to show what's going on.

craigcurtin

Sorry Scott, Life got in the way and i have not been on the forum for a while.

How did you go with this ? It sounds to me like drawing too much current between the various shift registers ?

What are the connecting cables - RJ-45 /CAT5/5e/6 ?

Craig

Go Up