Show Posts
Pages: 1 ... 36 37 [38] 39 40 ... 109
556  Using Arduino / Project Guidance / Re: Sending DIY code through IR on: April 17, 2014, 07:59:39 pm
I have searched for some projects regarding the measurement of voltage with an analog pin and noticed they all work pretty good. Although the lack of precision resistors the voltage is measured pretty accurately. But I also have seen most of the projects are battery powered and they use the method to know when the battery is almost empty. Therefore if the Arduino is powered by a battery, it’s address will change overtime when the battery starts to lose power.
Well spotted. I hadn't thought of that. I'd assumed that they had mains derived power.
Quote
How many trains do you want? Your original post said just a couple!
Quote
That’s the thing, I don’t know how much trains there will be. This project is to see if I can get automated trains to run on a track layout. If this works on a small scale, we are going to try and expand the layout. The idea for this project goes back a long time. Because my father loves LEGO trains, he was asking me to do something to make them drive by themselves. But last year I went on a school-fieldtrip to Germany. There we visited this: Miniatur Wunderland. Here there are like 100’s of trains running through the building on their own. That is when the actual project began to take shape.
How much money and time do you have?   smiley-money smiley-money smiley-money
557  Using Arduino / Project Guidance / Re: Token detection. on: April 17, 2014, 07:35:06 pm
I may have misinterpreted the OP's question because I did not see where he said the tokens could be tagged. If they can then
RFID is definitely the simpler solution.
He didn't say ANYTHING about the tokens, or the surface!  Your crystal ball must be malfunctioning... smiley
558  Using Arduino / Project Guidance / Re: Bytes to ASCII on: April 17, 2014, 07:22:19 pm
I think there is something in your code that causes it.
Serial.print does not translate it to a string,
That would depend on whether he's printing (80) or ("80").
559  Using Arduino / Project Guidance / Re: OCR Sorting Machine on: April 17, 2014, 07:11:46 pm
They are all the exact same size. Just have different markings on them.
What size are the beads? What shape are the beads (spherical, disk, etc)? Are they the sort of size markers that clip onto the hanger?
560  Using Arduino / Programming Questions / Re: Relay -why it acts the other way - help needed! on: April 16, 2014, 11:11:16 pm
It seems like the NO and NC markings on the relay are reversed. Connect your load to the contact marked NC instead of the one marked NO.
561  Using Arduino / Project Guidance / Re: Sending DIY code through IR on: April 16, 2014, 10:44:29 pm
Theoretically 1023, practicably a lot less. With 5% resistors, (two resistors = possible 10% error) around 100. Expensive 1% resistors will give more possible combinations.
Thank you Henry! Do you know if this has ever been done before and they have some test results?
Plenty of projects use an analog pin to measure voltage. All I'm suggesting is you input a set voltage (using resistors) and measure it, to give you the identity of the arduino/train. Map the reading on A0 to 0-99, ignore 0 (as that could be a fault) and use that as your train identifier. How many trains do you want? Your original post said just a couple!
562  Using Arduino / Project Guidance / Re: OCR Sorting Machine on: April 16, 2014, 10:00:15 pm
So I have these size beads (s,m,l,xl,xxl)
Do you mean the beads are of different sizes or are they all the same size with different markings (s,m,l,xl,xxl)?
563  Using Arduino / Project Guidance / Re: OCR Sorting Machine on: April 16, 2014, 09:52:45 pm
Scanning a round object, rendering a flat field view and OCR is not a simple feat, IMO.
Damn near impossible, I'd say. Why not use a series of sieves to sort them on their size?
564  Using Arduino / Project Guidance / Re: Token detection. on: April 16, 2014, 11:49:39 am
Based on most Newbie posts , everyone thinks we are psychics... smiley-lol
My crystal ball has clouded over. Must be because it's running XP!  smiley-cool
565  Using Arduino / Project Guidance / Re: Sending DIY code through IR on: April 16, 2014, 11:37:18 am
Depends on how many different identities you want. One way is to use a voltage divider and measure the voltage on an analogue pin.  A 10K resistor between pin A0 and ground on each Arduino and a different value resistor (1K to 100K) between pin A0 and 5V on each one. The voltage on A0 can be translated into your identity by the ADC and some code. The identity can be easily changed simply by changing one resistor. Cheap, easy and only uses one pin.
At the moment, I think the only way to make it more expandable is like AnalysIR said: Write the address in the eeprom of the device. All other ways that I can think of are limited. The DIP switch I thought off is limited to 128 devices (8-bit). How many devices do you think your method could provide?
Theoretically 1023, practicably a lot less. With 5% resistors, (two resistors = possible 10% error) around 100. Expensive 1% resistors will give more possible combinations.
566  Using Arduino / Project Guidance / Re: Token detection. on: April 15, 2014, 11:01:05 pm
I just need to detect the token, and be able to know what type of token it is. No need to know its position.
RFID seems like a too expensive solution.
How many different types of tokens are there?
What is the size and shape of the base of the tokens?
What are the tokens made of?
How thick/tall are they?
Are the different types of different colours, weights, shapes?
What is the size and shape of the surface?
What is the surface made from?
How thick is it?
Without that knowledge, how do you expect us to help you?
567  Using Arduino / Project Guidance / Re: Sending DIY code through IR on: April 15, 2014, 10:31:17 pm
I would have to give each Arduino a number because the number is programmed via software. Is there an easy way to give it a hardware number? I’m thinking about a DIP-switch or something? But then I need a lot of inputs to read the switch.
Depends on how many different identities you want. One way is to use a voltage divider and measure the voltage on an analogue pin.  A 10K resistor between pin A0 and ground on each Arduino and a different value resistor (1K to 100K) between pin A0 and 5V on each one. The voltage on A0 can be translated into your identity by the ADC and some code. The identity can be easily changed simply by changing one resistor. Cheap, easy and only uses one pin.
568  Using Arduino / Project Guidance / Re: Advice on programming a accessory decoder for a computer controlle train layout. on: April 15, 2014, 12:04:02 am
I've expanded my scope some, utilizing the idea of Arduino in further ways. I was toying with the idea of RFID tags.
I've also been looking into RFID tags. There appear to be 3 different kinds. Low frequency, high frequency and UHF. Many of the tags I've seen don't specify which of these they use.  smiley-mad
I've been recommended some very small tags, about the size of a grain of rice, that are used as pet (cat and dog) chips. They come with an 'injector' (which we wouldn't need) and cost £3.00 (about 3.30 Euros) each. I'm trying to find out if they are low frequency types, whether they can be bought without the injector and if they are programmable or their code is fixed. I'll need over 30 of them for my automatic hump shunting yard.

Quote
Originally I was just going to use a simple reed switches. The idea was that I could have passenger trains that'd trip them and automatically pull into stations. I expanded this idea further though as I found too many limitations with such a simple system.
Depending on what scale you're working in, it's possible to use reed switches to identify a small number of different trains by using two magnets, at different distances apart, on each train. You wire the reed switches in series and if the distance between the reeds matches the distance between the magnets, both of them will be closed at the same time. You need only n+1 reeds to detect n different trains, as one reed is common to all the others.
569  Using Arduino / Project Guidance / Re: Help/Guidance!!!What to use? Encoders dont really help(wheels slippage)! on: April 14, 2014, 11:13:04 pm
If someone picks your car up and replaces it in the wrong place, no amount of 'remembering' will get it back to point B. Even a slight misplacement at point A or a slight bump in the road, over a long distance, could mean it doesn't get to point B by 'remembering' the route. Think about how difficult it is to score a 'strike' in 10 pin bowling where you can see the target (the pins). Now imagine being blindfolded and being spun around three times before you pick up the ball. You're never going to do it by 'remembering', but that is what you're asking of your car. Forget about remembering the route.

What you need is some sort of beacon at point B that your car can head towards, or a track/line for it to follow.
570  Using Arduino / Programming Questions / Re: Help with modulo. 25%10 always rounds off to 6. on: April 13, 2014, 05:15:00 pm
Code:
void processNumber(int number)
{
  int x;
  unsigned int ones;
  int tens;
  ones=(number)%10;
  x=(number)-ones;
  tens=x/10;
  updateDisplay(ones,tens);
}
I don't know if it's what's causing your problem but you don't need to round (number) before dividing it by 10 as tens is an int and can't hold the fractional part of the result.
Code:
   ones=number%10;
   tens=number/10;
Also, why the brackets around number?
You are calling a function from within a function. I seem to remember reading that that's a no-no.   smiley-confuse
Pages: 1 ... 36 37 [38] 39 40 ... 109