Pages: [1] 2   Go Down
Author Topic: Need Help With Arduino :-|  (Read 2676 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 23
Using an Arduino UNO To Control a Model Railway's Points and Signals
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi everyone.

I have started a project which is to make a dashboard for a game called OMSI DerOmniBusSimulator.
here is a picture of the amazing gazz's omsi dash.


My dashboard is not to that standard.
No. #1 Because I do not know the programming to get the data from the game to the led's on my arduino uno.
Currently I have all the led's hooked up correctly and working, - I have tested all of them.
I really need help extracting the data from the game and getting it to my arduino uno.
No. #2  - I have some switches and I would like them to control functions in the game such as door open/close etc. Is there any way I can get the signal from the switch to my arduino uno and then to the pc/game WITHOUT and custom firmware of any kind.

Thankyou for your time and effort to answer these questions.

Steve
« Last Edit: January 26, 2013, 03:35:22 pm by Steve - The OMSI Fan » Logged

------------
Youtube: http://youtube.com/virgocomputing
Current Projects: Using an Arduino UNO To Control a Model Railway's Points and Signa

Offline Offline
Jr. Member
**
Karma: 0
Posts: 61
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I put the codes needed on my site, linked from my youtube page...

www.kampenwagen.co.uk

Hopefully that should get your led's turning on and off with the game's dashboard light (remember i use a mega, so have many more outputs than a uno)

I havent tried using my arduino for inputs, i used a leo bodnar usb input board for that, i'd recomend the
http://www.leobodnar.com/shop/index.php?main_page=index&cPath=86
It's a usb button box input board, just connect any buttons to it, assign them in the gam, and roberts your wifes sisters hubby,

I have recently blown my bodnar input board, mis-wired a voith gear selector, and shoved 24 volts for the lights up an input pin, so i now have a U-HID from ultimarc, twice the price of the leo bodnar board (or 3 times if you go for the solder the pins on your self version) but it is more than an input board (can do a few outputs, but mainly it can easily be set up for pulse on switch down, pulse on switch up, so no need to faff about modifying every bus's script to handle latching switches in omsi.


Hope some of this helps,
Gazz
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 23
Using an Arduino UNO To Control a Model Railway's Points and Signals
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the link gazz.
You are the person I wanted to talk to!

The problem I am having while using your scripts is that yours are set up for the mega not the uno
and my board is not working as It needs to be set up using 8, 9 ,10, 11, 12, 13  and your program is 22,23,24,25.

But... I have  edited the arduino code and deleted the gauges section  - verified and all ok, Then I changed the numbers for all of the outputs to the ones I have.

Do you think this will work?

Steve
Please stay in contact
Logged

------------
Youtube: http://youtube.com/virgocomputing
Current Projects: Using an Arduino UNO To Control a Model Railway's Points and Signa

Offline Offline
Newbie
*
Karma: 0
Posts: 23
Using an Arduino UNO To Control a Model Railway's Points and Signals
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

REPLYING TO MY OWN TOPIC:

Yay, I have re-coded it to work on my setup, Thanks very much gazz, You owe me everything.
I dont actually know this works but I sort of do as the abs goes to line 13 and the led comes on and off with the abs, so... everything must be setup right!
And for the buttons I took apart a logitech attack 3 joystick which I have had in the back of the cupboard for years!
I will email you some pictures if you pm me your email.
I owe you everything gazz.

Here is what I have done so far, The reds going up in the air with the labels are all of the 'lives' which will go to dash lights. The block at the bottom in the middle is connections to 4 grounds, 5v, and 3.3v.
I have connected 3 of the digial pwn lines to a block which is not visable.
The single block up in the top left is the ground next to pin 13.
I am going to connect 6 L.e.d's Do you think I will need a power supply for that. If so is a 12v 200ma ok if I need it.


Many thanks
Regards,
Steve
Please stay in contact - You are my omsi dash hereo!
email: virgopaperbus@lycos.com
« Last Edit: January 27, 2013, 07:11:35 am by Steve - The OMSI Fan » Logged

------------
Youtube: http://youtube.com/virgocomputing
Current Projects: Using an Arduino UNO To Control a Model Railway's Points and Signa

Offline Offline
Jr. Member
**
Karma: 0
Posts: 61
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Cool,

On mine i have just ran all the led's directly off the arduino, i.e. each led, i connect the anode through a suitable resistor to run it at 15Ma on 5 volts, and then to the arduino's output pin i want to control that led,

All the cathodes from the led's are tied together and go back to one of the GND pins on the arduino (the one next to pin 13 on the uno is connected to the ones by the 3.3 and 5v pins on the other side of the board btw)

Now, i may be stressing my arduino by doing this, i believe the max current that should be drawn from any 1 pin is 20Ma.... and i have just realised i am running about 10 white led's off one pin for the instrument backlights.. oops,

I am not sure if the current limit applies when the arduino pins are sinking the current... someone else can answer that as i am just not sure,

But for now, i'd not bother with an external power supply on your set up, as it's only 6 leds, and the arduino is more than capable of running that load,

i only need 12 volts in my set up as i have automotive gauges that run on 12 volts, i also have 24 volts for a few illuminated buttons that just do not look right with led's in them, but as i mentioned, when mixing voltages, you really need to keep them seperate and away from the arduino,
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 23
Using an Arduino UNO To Control a Model Railway's Points and Signals
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the help gaz, Subscribe to my youtube http://youtube.com/virgocomputing    as I am going to be uploading some videos of my progress soon.

Sorry if you have already explained this but what voltage do pins 8 to 13 give out;
As I want to run some other lights apart from led's as well, e.g 4 led's and 2 light bulbs (e.g 2, 5 volt ones?)
Logged

------------
Youtube: http://youtube.com/virgocomputing
Current Projects: Using an Arduino UNO To Control a Model Railway's Points and Signa

Offline Offline
Newbie
*
Karma: 0
Posts: 23
Using an Arduino UNO To Control a Model Railway's Points and Signals
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

video:
Logged

------------
Youtube: http://youtube.com/virgocomputing
Current Projects: Using an Arduino UNO To Control a Model Railway's Points and Signa

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 94
Posts: 4751
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Now, i may be stressing my arduino by doing this, i believe the max current that should be drawn from any 1 pin is 20Ma.... and i have just realised i am running about 10 white led's off one pin for the instrument backlights.. oops,

Max on a pin is 40 mA but 20 mA is recommended as most.
Max total you should pull from an UNO is 200 mA.

Feed a transistor to power the backlights. Each should have its own resistor. For higher power there are Darlington's (ULN 2803 has 8 in one chip I believe, can run 500 mA 30V) and FET's (FET's are -very- static sensitive).

Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Offline Offline
Newbie
*
Karma: 0
Posts: 23
Using an Arduino UNO To Control a Model Railway's Points and Signals
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Just as an update...

just to tell everyone. I have fitted all the led's to the dash, and all the switches that run to the game controller. My next think'a'bout is the speedometer!  smiley-eek I have got one ready to be picked up. Just..... I dont know how to wire it up???????? Please can someone help. Preferably gazz as he knows this kind of thing!.

Steve
Logged

------------
Youtube: http://youtube.com/virgocomputing
Current Projects: Using an Arduino UNO To Control a Model Railway's Points and Signa

Johannesburg. UTC+2
Offline Offline
Faraday Member
**
Karma: 82
Posts: 3840
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Sorry if you have already explained this but what voltage do pins 8 to 13 give out

They're 0v or 5v....

The ones with the ~ are PWM pins so they give a pseudo-voltage between 0 and 5v, but they're really switching on-off-on very quickly between 0 and 5v. The "voltage" delivered is scaled between 0 and 5 with a value set for the pin between 0 (0% on = 0v) and 255 (100% on = 5v).
Logged

Although I answer in good faith, remember always: Your Mileage May Vary.
Get me on LinkedIn: za.linkedin.com/in/jimbrownza/

Offline Offline
Newbie
*
Karma: 0
Posts: 23
Using an Arduino UNO To Control a Model Railway's Points and Signals
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thankyou for your help with the voltage:)  i just have to wire the speedo/tacho head now.... smiley-eek-blue
Logged

------------
Youtube: http://youtube.com/virgocomputing
Current Projects: Using an Arduino UNO To Control a Model Railway's Points and Signa

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi mates!

I'm trying to build this project, which is magnificent! smiley
I would like to ask you if it is possible, instead of an analogue gauge, to have a series of led showing the RPM...

Thank you in advance!
Logged

Johannesburg. UTC+2
Offline Offline
Faraday Member
**
Karma: 82
Posts: 3840
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is this the kind of thing you mean?

Logged

Although I answer in good faith, remember always: Your Mileage May Vary.
Get me on LinkedIn: za.linkedin.com/in/jimbrownza/

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Not exactly... but it touches the general idea. It needs a lot of customisation in order to can be adapted on the OMSI dashboard script.. I'll have a try although...
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Some years ago I made a hallmeter for my car. This is the sketch.

Can I use it as "LED - gauge"?
Logged

Pages: [1] 2   Go Up
Jump to: