Engineering Project - Simulator Controls

I said in Reply #9 that you are best using a pot with a resistance at or below 10k. If you need reassurance on the point read the Atmel datasheet.

When I used a higher value pot (because it was all I had at the time) the results from the ADC had a lot of variation and were almost useless.

Just get an Arduino and try it out. You will have the answer far quicker that way.

...R

Robin2: When I used a higher value pot (because it was all I had at the time) the results from the ADC had a lot of variation and were almost useless.

...R

Did you try increasing the SHTIM ?

Boardburner2: Did you try increasing the SHTIM ?

Almost certainly not - it was in my early Arduino days.

What is the SHTIM? - I don't see a register with that name in the datasheet

...R

Sorry wrong processor

http://www.atmel.com/Images/doc32135.pdf

Its generally true for any ADC.

But very difficult to find datasheet for individual processors with useful data.
They seem to tell a lot about the digital side without giving the analogue information.

Slowing down the clock on a uno can improve the adc performance which is useful with battery powered stuff where you want to reduce power consumption.

Without carrying out a lot of tests however I suggest you take that with a pinch of salt.

ADC and DAC(or lack of them ) are something about microcontrollers that are a pita to me.

Flaky adc values you have mentioned are an annoyance which I have not been able to find the reason for.

Michael22: ... less of a condescending attitude would be appreciated. ...

In my experience, (most) condescension here is unintentional, and is generally born out of frustration with repeatedly encountering the same lack of relevant information from new members. I've seen the same thing on many of the technical forums I visit.

Suppose I went on a mechanical engineering forum and asked, "I'm building a metal box. What type of metal should I use, and what size should it be?" That's roughly the level of detail you provided in your opening post.

shooter: analogWrite(13,out);

JimboZA: You sure about that?

shooter: @jim yes

Well I just checked back through the thread and no Arduino model is mentioned afaics, so I'll give you the benefit of the doubt that you are talking about a Mega. But the most popular Arduino, and I'd go so far as to call it the default, the Uno, doesn't PWM on pin 13.

From the Uno man page:

PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite() function.

Boardburner2:
Flaky adc values you have mentioned are an annoyance which I have not been able to find the reason for.

I had no problems once I changed to a 10k pot - which is (I believe) just at the upper limit of the specs of the Atmel datasheet.

…R

Why not get the actual controls from a real train? That will simulate the feel perfectly and I bet they are robust against wayward train drivers operating them with their feet.

They can be frightfully expensive (thousands of $ for a ‘simple’ pot) but I’m sure you can find a train manufacturer to donate the controls to your university.

My lecturer is saying I should use a myRIO instead of an arduino, does anyone know anything about these?

I didnt realise there was a strict conduct with regards to what I can post.

When you think about it, when you post here, it is the same as your first sit down with a consultant. He is going to want to know the entire scope of your project and every aspect you want help with. We are no different (except we work for free). We expect the entire project to be presented with all the specifications and requirements, (including hardware ) and all of the things you need help with. I wouldn't call a "strict conduct" so much as a SOP PROTOCOL for a post.

A recent newcomer posted this

http://forum.arduino.cc/index.php?topic=298195.0

That's the sort of thing we like to see.

It can get frustrating with having to drag details out of someone as well, especially youngsters.

Yeah ! Now THAT's what I'm talking about. (I've actually seen even better but that's pretty good by anyone's standards.

It can get frustrating with having to drag details out of someone as well, especially youngsters

It can turn into an interrogation sometimes when the poster is withholding a lot of details. It's too bad we don't have a room with one chair and bright hanging overhead light. We do play "good cop"/"bad cop" on occasion. ( I'm usually the "bad" cop and Robin is the good "cop" . Grumpy Mike is almost always the "bad cop" and Paul can go either way.

I was trying to post what I thought was the minimum required as I only wanted small amounts of information about something specific. Didnt want to take up more time than necessary. But I'll remember to be more descriptive in future.

Michael22: I was trying to post what I thought was the minimum required as I only wanted small amounts of information about something specific. Didnt want to take up more time than necessary. But I'll remember to be more descriptive in future.

Appreciate the sentiment.

If you had said you were using a pot to vary the brightness of a LED it would probably not have raised an eyebrow.

Pot and train simulator in the same post tends to raise a lot of questions though.

Didnt want to take up more time than necessary. But I'll remember to be more descriptive in future.

We don't want unnecessary information. If you posted only about the pot then it was sufficient (somewhat, since there was no mention of resistance value or wattage. If the pot was only the beginning, and there's more to come then it wasn't.