Initial experiments with Bluetooth and Arduino

A place for discussing battery-electric locomotives, whether they're diesel, steam or even electric outline
User avatar
ge_rik
Driver
Driver
Posts: 2836
Joined: Sun Oct 25, 2009 10:20 pm
Location: Cheshire
Contact:

Initial experiments with Bluetooth and Arduino

Post by ge_rik » Mon Jul 01, 2019 7:01 pm

Whilst away on my hols (in sunny France - and yes it was hot!!), I got to grips with the (very) basics of Arduino. Now I'm back I've been experimenting.


Still early days yet, but I've written up wot I dun on my blog for those who might be interested
https://riksrailway.blogspot.com/2019/0 ... phone.html

Total outlay on the control bits = £17.81. I could have done it more cheaply if I'd bought the bits directly from China - but I didn't want to wait.

Hope it's of interest.

Rik
------------------------
Peckforton Light Railway - Blog Facebook Youtube

User avatar
philipy
Director
Director
Posts: 1982
Joined: Sun Jan 30, 2011 3:00 pm
Location: South Northants
Contact:

Re: Initial experiments with Bluetooth and Arduino

Post by philipy » Tue Jul 02, 2019 6:07 am

Hi Rik,
Glad you had a good holiday. Yes it is hot in France, we still have a few more days here before we have to return and we are only a few kilometres from where the French temperature record was set last weekend at just over 45 deg C.

Anyway, thanks for your Arduino blog, very interesting, and when I've had time to go through the detail, possibly of interest. However, a couple of quick questions first -
1) is it necessary to have a fully working smart phone for the Bluetooth side of things to function, i.e with a valid SIM card installed? The reason I ask is that I don't possess such a beastie, but cheap 2nd hand units are available and might be worth the investment as long as I don't also have to fork out for a SIM account ( what did you say about being a cheapskate??).
2) You mention the limited Bluetooth range issue, and I wonder if it might be possible to programme the Arduino to maintain whatever its current instructions are on loss of signal, and continue with them until signal is regained, similar to the Deltang operation?

User avatar
ge_rik
Driver
Driver
Posts: 2836
Joined: Sun Oct 25, 2009 10:20 pm
Location: Cheshire
Contact:

Re: Initial experiments with Bluetooth and Arduino

Post by ge_rik » Tue Jul 02, 2019 7:24 am

Hi Philip
I can't see any reason why a network free phone wouldn't work. I also use it with my tablet which is like a phone without the phone. Regarding the range. I tested it in my garden and easily got 17m with foliage in the way. That's the max I get to see from phone to loco, so it could well be more. The coding by default keeps the last value received until it detects a change from the phone so in effect has built in coast control.

Rik
------------------------
Peckforton Light Railway - Blog Facebook Youtube

User avatar
ge_rik
Driver
Driver
Posts: 2836
Joined: Sun Oct 25, 2009 10:20 pm
Location: Cheshire
Contact:

Re: Initial experiments with Bluetooth and Arduino

Post by ge_rik » Tue Jul 02, 2019 7:49 am

It's early days so I haven't had much time for a full evaluation but what I've found so far is:

Pros
  • Cheap
    Flexible (I'm presently investigating a DIY app and already added directional lighting and coded auto station stop)
    Acceptable range
    Plenty of resources
Cons
  • Hard to see the screen in sunlight
    Not tactile - ie you can't feel the controls in your hand
    Easy to press the wrong button and lose the app - but that might be because I'm not an experienced smart phone user
    Not as compact and convenient as Deltang
    Some tech knowledge required but the learning curve is quite shallow
I'm going to keep playing, cos I like the challenge but I'm not sure it will become my default control system

Rik
------------------------
Peckforton Light Railway - Blog Facebook Youtube

User avatar
ge_rik
Driver
Driver
Posts: 2836
Joined: Sun Oct 25, 2009 10:20 pm
Location: Cheshire
Contact:

Re: Initial experiments with Bluetooth and Arduino

Post by ge_rik » Tue Jul 02, 2019 10:04 am

Latest development.
Steve Massikker from arduinorailwaycontrol.com has been in touch and wants me to collaborate in producing an app and coding specifically to meet the needs of large scale train operation. Watch this space, as they say.

Rik
------------------------
Peckforton Light Railway - Blog Facebook Youtube

User avatar
tom_tom_go
Chairman
Chairman
Posts: 4339
Joined: Wed Feb 23, 2011 3:08 am
Location: Kent, UK
Contact:

Re: Initial experiments with Bluetooth and Arduino

Post by tom_tom_go » Tue Jul 02, 2019 10:12 am

Oh Rik what have you started, I play trains to escape technology!

As long as this type of tech doesn't render DCC and traditional Tx/Rx obsolete then it's good thing for those who want to operate using a touch screen and an app.

User avatar
philipy
Director
Director
Posts: 1982
Joined: Sun Jan 30, 2011 3:00 pm
Location: South Northants
Contact:

Re: Initial experiments with Bluetooth and Arduino

Post by philipy » Tue Jul 02, 2019 12:22 pm

ge_rik wrote:
Tue Jul 02, 2019 10:04 am
Latest development.
Steve Massikker from arduinorailwaycontrol.com has been in touch and wants me to collaborate in producing an app and coding specifically to meet the needs of large scale train operation. Watch this space, as they say.

Rik
I've just come back from wading through his site and I noticed that you seemed to have joined up!

User avatar
ge_rik
Driver
Driver
Posts: 2836
Joined: Sun Oct 25, 2009 10:20 pm
Location: Cheshire
Contact:

Re: Initial experiments with Bluetooth and Arduino

Post by ge_rik » Tue Jul 02, 2019 12:45 pm

philipy wrote:
Tue Jul 02, 2019 12:22 pm
ge_rik wrote:
Tue Jul 02, 2019 10:04 am
Latest development.
Steve Massikker from arduinorailwaycontrol.com has been in touch and wants me to collaborate in producing an app and coding specifically to meet the needs of large scale train operation. Watch this space, as they say.

Rik
I've just come back from wading through his site and I noticed that you seemed to have joined up!
Have I? Must have a quick wade myself..... :shock:

Rik
------------------------
Peckforton Light Railway - Blog Facebook Youtube

User avatar
-steves-
Trainee Driver
Trainee Driver
Posts: 880
Joined: Thu Jul 28, 2011 1:50 pm
Location: Cambridge & Peterborough

Re: Initial experiments with Bluetooth and Arduino

Post by -steves- » Tue Jul 02, 2019 3:47 pm

Rik

I love this idea and think it looks very funky. It's certainly cheap and for that is quite appealing.

One of the down sides is only 10 steps for control. Do you know if this can be changed later on to a much greater number, like 100?

Secondly, will this only work with a 12v ish supply? What about loco's running 18v or indeed 3v?

Cheers
Steve
Ditton Meadow Light Railway (DMLR)
Member of Peterborough and District Association
http://peterborough.16mm.org.uk/

User avatar
idlemarvel
Trainee Fireman
Trainee Fireman
Posts: 137
Joined: Tue May 28, 2019 1:59 pm

Re: Initial experiments with Bluetooth and Arduino

Post by idlemarvel » Tue Jul 02, 2019 4:11 pm

philipy wrote:
Tue Jul 02, 2019 6:07 am
...However, a couple of quick questions first -
1) is it necessary to have a fully working smart phone for the Bluetooth side of things to function, i.e with a valid SIM card installed? The reason I ask is that I don't possess such a beastie, but cheap 2nd hand units are available and might be worth the investment as long as I don't also have to fork out for a SIM account ( what did you say about being a cheapskate??).
...
You don't need a SIM card at all to use the bluetooth feature of a phone, same applied to wifi. I use an old SIM-less iPhone 4 as my wireless train controller.
Dave Miller
currently building the 5" gauge Circle Line

User avatar
BorisSpencer
Trainee Fireman
Trainee Fireman
Posts: 134
Joined: Thu Apr 05, 2018 2:36 pm
Location: East Northants

Re: Initial experiments with Bluetooth and Arduino

Post by BorisSpencer » Tue Jul 02, 2019 4:18 pm

-steves- wrote:
Tue Jul 02, 2019 3:47 pm
One of the down sides is only 10 steps for control. Do you know if this can be changed later on to a much greater number, like 100?
You're stuck with the codes the android app is transmitting.
But looking at the example code, it wouldn't take much of a change to use one of the on-off switches as a 'gear selector' to add more granularity to the speed control. Effectively giving a high and low range.

User avatar
philipy
Director
Director
Posts: 1982
Joined: Sun Jan 30, 2011 3:00 pm
Location: South Northants
Contact:

Re: Initial experiments with Bluetooth and Arduino

Post by philipy » Tue Jul 02, 2019 4:41 pm

idlemarvel wrote:
Tue Jul 02, 2019 4:11 pm
philipy wrote:
Tue Jul 02, 2019 6:07 am
...However, a couple of quick questions first -
1) is it necessary to have a fully working smart phone for the Bluetooth side of things to function, i.e with a valid SIM card installed? The reason I ask is that I don't possess such a beastie, but cheap 2nd hand units are available and might be worth the investment as long as I don't also have to fork out for a SIM account ( what did you say about being a cheapskate??).
...
You don't need a SIM card at all to use the bluetooth feature of a phone, same applied to wifi. I use an old SIM-less iPhone 4 as my wireless train controller.
Thanks Dave.

User avatar
BorisSpencer
Trainee Fireman
Trainee Fireman
Posts: 134
Joined: Thu Apr 05, 2018 2:36 pm
Location: East Northants

Re: Initial experiments with Bluetooth and Arduino

Post by BorisSpencer » Tue Jul 02, 2019 5:09 pm

BorisSpencer wrote:
Tue Jul 02, 2019 4:18 pm
-steves- wrote:
Tue Jul 02, 2019 3:47 pm
One of the down sides is only 10 steps for control. Do you know if this can be changed later on to a much greater number, like 100?
You're stuck with the codes the android app is transmitting.
But looking at the example code, it wouldn't take much of a change to use one of the on-off switches as a 'gear selector' to add more granularity to the speed control. Effectively giving a high and low range.
Apologies for quoting my own post, it also wouldn't take much to smooth the transition between the 10 increments at the Arduino end, i.e. multiple steps between speeds. The 10 increments are probably because we are looking at software orininaly scoped to control basic track-powered 00 locos.

User avatar
tom_tom_go
Chairman
Chairman
Posts: 4339
Joined: Wed Feb 23, 2011 3:08 am
Location: Kent, UK
Contact:

Re: Initial experiments with Bluetooth and Arduino

Post by tom_tom_go » Tue Jul 02, 2019 5:30 pm

I believe Apple phones need a Sim card initially to boot up when new but after that you can take the Sim out and use it on Wi-Fi.

User avatar
ge_rik
Driver
Driver
Posts: 2836
Joined: Sun Oct 25, 2009 10:20 pm
Location: Cheshire
Contact:

Re: Initial experiments with Bluetooth and Arduino

Post by ge_rik » Tue Jul 02, 2019 6:11 pm

Steve has already produced an app with 18 speed steps. What appeals to me is you can have two different speed profiles for each loco. The motor driver has two outputs so it's possible to switch from one to the other. Hence I could have 18 steps with a low top speed for shunting and then another profile with a higher top speed. See -



Rik
------------------------
Peckforton Light Railway - Blog Facebook Youtube

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest