Raspberry Pi Zero Controlling Things

John, as Greg says, there are several guys experimenting with similar systems over this side of the pond. Dave Bodnar has a website with all kinds of projects
http://www.trainelectronics.com/
His latest is using a wireless charger to power a moving object, like a marquee sign.

Martin Sant has posted (on LSC) lots of interesting stuff, and there's a guy (Eric?) who has reverse-engineered the airwire system

Thanks for the post. I have been looking at many of the videos. Confirms that I need to get plowing in this direction!
 
Last edited:
The issues come down to the throttle (can you use an app on a smart phone or do you want buttons and knobs) and to really sound and more sophisticated functions.

From what I see, the smart phone and physical knobs can easily co-exist on the same setup. You can have your cake and eat it too.

With sound, I can see endless possibility. Large and many WAV and MP3 files can be stored and sent to speakers using small low cost remotely accessible devices.

The fact that I spent $150 on an LGB 65000 years ago now kills me. For it it does, compared to what can be done today for 1/10th the cost makes it a dinosaur. I guest that is the way most technology goes.
 
Ok here goes, there is a lot of information to digest.

Back in late 2014 when this was seen as feasible, had to plough a very lone furrow, JMRI at that time was not available as such to run on a Raspberry Pi, the Raspberry Pi2 Model B900MHz quad-core ARMv7 Cortex-A7 1024 MiB that was chosen was unsupported by the core JMRI program, let alone set up a Pi as a stand alone wireless access point never the less a solution was found.

I do have spare UNO's, Motor Controller Boards and BTS7960B, and can if required make up sets!
As previously mentioned this subject went way over the heads and into the blue yonder!
Wonder if there is any real interest in this particular aspect of DIY DCC?
Perhaps a " DCC Workshop" at this years forthcoming GRAIL?


Thankfully today's installation from scratch on how to setup JMRI on Raspberry Pi3 as an Access Point as a self contained stand alone DCC Central Station was simple and straightforward, using an Arduino UNO R3 and a Deek Robot Motor Shield, following Steve Todd's guide as mentioned below*, the only change I made was to use RealVNC instead of TightVNC.

The following is provided as a prerequisite before attempting to do the above installation.
The Raspberry Pi2 Model B and the Raspberry Pi 3 are the more suitable for this.

https://elinux.org/RPi_Hardware
Raspberry Pi Model B
700 MHz ARM11 ARM1176JZF-S core 512 MiB (since 15 Oct 2012)
2 USB 2.0 (via integrated USB hub in LAN9512)
10/100 wired Ethernet RJ45
26 General Purpose Input/Output (GPIO) pins, Serial Peripheral Interface Bus (SPI), I²C, I²S, Universal asynchronous receiver/transmitter (UART)

Raspberry Pi Model B+
700 MHz ARM11 ARM1176JZF-S core 512 MiB
4 USB 2.0 (via integrated USB hub in LAN9514)
10/100 wired Ethernet RJ45
40 General Purpose Input/Output (GPIO) pins, Serial Peripheral Interface Bus (SPI), I²C, I²S, I2C IDC Pins, Universal asynchronous receiver/transmitter (UART)

Raspberry Pi2 Model B
900MHz quad-core ARMv7 Cortex-A7 1024 MiB
4 USB 2.0 (via integrated USB hub in LAN9514)
10/100 wired Ethernet RJ45
40 General Purpose Input/Output (GPIO) pins, Serial Peripheral Interface Bus (SPI), I²C, I²S, I2C IDC Pins, Universal asynchronous receiver/transmitter (UART)

Raspberry Pi 3
1.2GHz 64-bit quad-core ARMv8 Cortex-A53 1024 MiB
4 USB 2.0 (via integrated USB hub in LAN9514)
10/100 wired Ethernet RJ45, integrated 802.11n Wi-Fi & Bluetooth 4.1
40 General Purpose Input/Output (GPIO) pins, Serial Peripheral Interface Bus (SPI), I²C, I²S, I2C IDC Pins, Universal asynchronous receiver/transmitter (UART)

Start here at the DCC++ homepage https://sites.google.com/site/dccppsite/the-system

How to setup the Motor Controller Boards https://github.com/DccPlusPlus/Documentation

*How to setup JMRI on Raspberry Pi3 as an Access Point as a self contained stand alone DCC Central Station https://mstevetodd.com/jmri-raspberrypi-access-point

Engine Driver, Throttle for Android
https://enginedriver.mstevetodd.com/

Another excellent "starter document" can be found here
www.sprog.us.com/pi-sprog-pi3-wifi-2016-11-25-jessie.pdf

DO NOT SKIMP on SD Cards! Recommended type is an 8GB class 6 micro SD card
https://duckduckgo.com/?q=+8GB+class+6+micro+SD+card&ia=products

Likewise especially with a Pi3 ensure you purchase the correct PSU!
Raspberry Pi Universal Power Supply
https://duckduckgo.com/?q=Raspberry+Pi+Universal+Power+Supply&ia=products

Latest IDE ARDUINO 1.8.5
https://www.arduino.cc/en/Main/Software

Latest NOOBS (New Out Of Box Software) Version: 2.4.5 Release date: 2017-11-29 (stretch)
https://www.raspberrypi.org/downloads/

An easy Operating System installer for the Raspberry Pi, informative and easy to use starter guide.
https://github.com/raspberrypi/noobs

SD Card Formatting Software
https://www.sdcard.org/downloads/formatter_4/

Windows Disk Image Software, use to create a backup as an ISO, or to copy an ISO to another SD Card.
https://sourceforge.net/projects/win32diskimager/

Remote Control / Remote Desktop Software, used to communicate to the Pi from a Windows Computer ( removes the need for a separate Monitor, Keyboard & Mouse for the Raspberry Pi)
https://www.realvnc.com/en/connect/download/viewer/

Motor Control Boards to act as H Bridge Controllers,
http://trainelectronics.com/DCC_Arduino/DCC++/

The original board is this one, after you have recovered in shock about the price, go look for a Deek Robot Board!
https://www.ebay.com/itm/Arduino-A0...163000&hash=item41ac7c27c2:g:sI4AAOSwuhhXXh7K

Deek Robot Control Board, (Make sure it look likes this!)
https://www.ebay.com/itm/310787745501?_trksid=p2059210.m2749.l2649&ssPageName=STRK:MEBIDX:IT

High Power & Amp Controller BTS7960B 43A Stepper Motor Driver H-Bridge PWM For Arduino
https://www.ebay.com/sch/i.html?_fr...Motor+Driver+H-Bridge+PWM+For+Arduino&_sop=15

DO NOT get this one, it won't work without a lot of faffing and tinkering!
https://www.ebay.com/itm/L298P-Shie...368613&hash=item54480d01e5:g:YgIAAOSw5cRZIiwr

A few pictures of today's installation.
View attachment 232294 View attachment 232289 View attachment 232290 View attachment 232291

View attachment 232289

View attachment 232290
View attachment 232291

View attachment 232295

View attachment 232296

View attachment 232297

View attachment 232298
Thanks John... the learning curve gets steeper and steeper .....
Cheers
 
Ok here goes, there is a lot of information to digest.

Back in late 2014 when this was seen as feasible, had to plough a very lone furrow, JMRI at that time was not available as such to run on a Raspberry Pi, the Raspberry Pi2 Model B900MHz quad-core ARMv7 Cortex-A7 1024 MiB that was chosen was unsupported by the core JMRI program, let alone set up a Pi as a stand alone wireless access point never the less a solution was found.

I do have spare UNO's, Motor Controller Boards and BTS7960B, and can if required make up sets!
As previously mentioned this subject went way over the heads and into the blue yonder!
Wonder if there is any real interest in this particular aspect of DIY DCC?
Perhaps a " DCC Workshop" at this years forthcoming GRAIL?


Thankfully today's installation from scratch on how to setup JMRI on Raspberry Pi3 as an Access Point as a self contained stand alone DCC Central Station was simple and straightforward, using an Arduino UNO R3 and a Deek Robot Motor Shield, following Steve Todd's guide as mentioned below*, the only change I made was to use RealVNC instead of TightVNC.

The following is provided as a prerequisite before attempting to do the above installation.
The Raspberry Pi2 Model B and the Raspberry Pi 3 are the more suitable for this.

https://elinux.org/RPi_Hardware
Raspberry Pi Model B
700 MHz ARM11 ARM1176JZF-S core 512 MiB (since 15 Oct 2012)
2 USB 2.0 (via integrated USB hub in LAN9512)
10/100 wired Ethernet RJ45
26 General Purpose Input/Output (GPIO) pins, Serial Peripheral Interface Bus (SPI), I²C, I²S, Universal asynchronous receiver/transmitter (UART)

Raspberry Pi Model B+
700 MHz ARM11 ARM1176JZF-S core 512 MiB
4 USB 2.0 (via integrated USB hub in LAN9514)
10/100 wired Ethernet RJ45
40 General Purpose Input/Output (GPIO) pins, Serial Peripheral Interface Bus (SPI), I²C, I²S, I2C IDC Pins, Universal asynchronous receiver/transmitter (UART)

Raspberry Pi2 Model B
900MHz quad-core ARMv7 Cortex-A7 1024 MiB
4 USB 2.0 (via integrated USB hub in LAN9514)
10/100 wired Ethernet RJ45
40 General Purpose Input/Output (GPIO) pins, Serial Peripheral Interface Bus (SPI), I²C, I²S, I2C IDC Pins, Universal asynchronous receiver/transmitter (UART)

Raspberry Pi 3
1.2GHz 64-bit quad-core ARMv8 Cortex-A53 1024 MiB
4 USB 2.0 (via integrated USB hub in LAN9514)
10/100 wired Ethernet RJ45, integrated 802.11n Wi-Fi & Bluetooth 4.1
40 General Purpose Input/Output (GPIO) pins, Serial Peripheral Interface Bus (SPI), I²C, I²S, I2C IDC Pins, Universal asynchronous receiver/transmitter (UART)

Start here at the DCC++ homepage https://sites.google.com/site/dccppsite/the-system

How to setup the Motor Controller Boards https://github.com/DccPlusPlus/Documentation

*How to setup JMRI on Raspberry Pi3 as an Access Point as a self contained stand alone DCC Central Station https://mstevetodd.com/jmri-raspberrypi-access-point

Engine Driver, Throttle for Android
https://enginedriver.mstevetodd.com/

Another excellent "starter document" can be found here
www.sprog.us.com/pi-sprog-pi3-wifi-2016-11-25-jessie.pdf

DO NOT SKIMP on SD Cards! Recommended type is an 8GB class 6 micro SD card
https://duckduckgo.com/?q=+8GB+class+6+micro+SD+card&ia=products

Likewise especially with a Pi3 ensure you purchase the correct PSU!
Raspberry Pi Universal Power Supply
https://duckduckgo.com/?q=Raspberry+Pi+Universal+Power+Supply&ia=products

Latest IDE ARDUINO 1.8.5
https://www.arduino.cc/en/Main/Software

Latest NOOBS (New Out Of Box Software) Version: 2.4.5 Release date: 2017-11-29 (stretch)
https://www.raspberrypi.org/downloads/

An easy Operating System installer for the Raspberry Pi, informative and easy to use starter guide.
https://github.com/raspberrypi/noobs

SD Card Formatting Software
https://www.sdcard.org/downloads/formatter_4/

Windows Disk Image Software, use to create a backup as an ISO, or to copy an ISO to another SD Card.
https://sourceforge.net/projects/win32diskimager/

Remote Control / Remote Desktop Software, used to communicate to the Pi from a Windows Computer ( removes the need for a separate Monitor, Keyboard & Mouse for the Raspberry Pi)
https://www.realvnc.com/en/connect/download/viewer/

Motor Control Boards to act as H Bridge Controllers,
http://trainelectronics.com/DCC_Arduino/DCC++/

The original board is this one, after you have recovered in shock about the price, go look for a Deek Robot Board!
https://www.ebay.com/itm/Arduino-A0...163000&hash=item41ac7c27c2:g:sI4AAOSwuhhXXh7K

Deek Robot Control Board, (Make sure it look likes this!)
https://www.ebay.com/itm/310787745501?_trksid=p2059210.m2749.l2649&ssPageName=STRK:MEBIDX:IT

High Power & Amp Controller BTS7960B 43A Stepper Motor Driver H-Bridge PWM For Arduino
https://www.ebay.com/sch/i.html?_fr...Motor+Driver+H-Bridge+PWM+For+Arduino&_sop=15

DO NOT get this one, it won't work without a lot of faffing and tinkering!
https://www.ebay.com/itm/L298P-Shie...368613&hash=item54480d01e5:g:YgIAAOSw5cRZIiwr

A few pictures of today's installation.
View attachment 232294 View attachment 232289 View attachment 232290 View attachment 232291

View attachment 232289

View attachment 232290
View attachment 232291

View attachment 232295

View attachment 232296

View attachment 232297

View attachment 232298


Do I get fries with that? :think:
 
Ok here goes, there is a lot of information to digest.

Back in late 2014 when this was seen as feasible, had to plough a very lone furrow, JMRI at that time was not available as such to run on a Raspberry Pi, the Raspberry Pi2 Model B900MHz quad-core ARMv7 Cortex-A7 1024 MiB that was chosen was unsupported by the core JMRI program, let alone set up a Pi as a stand alone wireless access point never the less a solution was found.

I do have spare UNO's, Motor Controller Boards and BTS7960B, and can if required make up sets!
As previously mentioned this subject went way over the heads and into the blue yonder!
Wonder if there is any real interest in this particular aspect of DIY DCC?
Perhaps a " DCC Workshop" at this years forthcoming GRAIL?


Thankfully today's installation from scratch on how to setup JMRI on Raspberry Pi3 as an Access Point as a self contained stand alone DCC Central Station was simple and straightforward, using an Arduino UNO R3 and a Deek Robot Motor Shield, following Steve Todd's guide as mentioned below*, the only change I made was to use RealVNC instead of TightVNC.

The following is provided as a prerequisite before attempting to do the above installation.
The Raspberry Pi2 Model B and the Raspberry Pi 3 are the more suitable for this.

https://elinux.org/RPi_Hardware
Raspberry Pi Model B
700 MHz ARM11 ARM1176JZF-S core 512 MiB (since 15 Oct 2012)
2 USB 2.0 (via integrated USB hub in LAN9512)
10/100 wired Ethernet RJ45
26 General Purpose Input/Output (GPIO) pins, Serial Peripheral Interface Bus (SPI), I²C, I²S, Universal asynchronous receiver/transmitter (UART)

Raspberry Pi Model B+
700 MHz ARM11 ARM1176JZF-S core 512 MiB
4 USB 2.0 (via integrated USB hub in LAN9514)
10/100 wired Ethernet RJ45
40 General Purpose Input/Output (GPIO) pins, Serial Peripheral Interface Bus (SPI), I²C, I²S, I2C IDC Pins, Universal asynchronous receiver/transmitter (UART)

Raspberry Pi2 Model B
900MHz quad-core ARMv7 Cortex-A7 1024 MiB
4 USB 2.0 (via integrated USB hub in LAN9514)
10/100 wired Ethernet RJ45
40 General Purpose Input/Output (GPIO) pins, Serial Peripheral Interface Bus (SPI), I²C, I²S, I2C IDC Pins, Universal asynchronous receiver/transmitter (UART)

Raspberry Pi 3
1.2GHz 64-bit quad-core ARMv8 Cortex-A53 1024 MiB
4 USB 2.0 (via integrated USB hub in LAN9514)
10/100 wired Ethernet RJ45, integrated 802.11n Wi-Fi & Bluetooth 4.1
40 General Purpose Input/Output (GPIO) pins, Serial Peripheral Interface Bus (SPI), I²C, I²S, I2C IDC Pins, Universal asynchronous receiver/transmitter (UART)

Start here at the DCC++ homepage https://sites.google.com/site/dccppsite/the-system

How to setup the Motor Controller Boards https://github.com/DccPlusPlus/Documentation

*How to setup JMRI on Raspberry Pi3 as an Access Point as a self contained stand alone DCC Central Station https://mstevetodd.com/jmri-raspberrypi-access-point

Engine Driver, Throttle for Android
https://enginedriver.mstevetodd.com/

Another excellent "starter document" can be found here
www.sprog.us.com/pi-sprog-pi3-wifi-2016-11-25-jessie.pdf

DO NOT SKIMP on SD Cards! Recommended type is an 8GB class 6 micro SD card
https://duckduckgo.com/?q=+8GB+class+6+micro+SD+card&ia=products

Likewise especially with a Pi3 ensure you purchase the correct PSU!
Raspberry Pi Universal Power Supply
https://duckduckgo.com/?q=Raspberry+Pi+Universal+Power+Supply&ia=products

Latest IDE ARDUINO 1.8.5
https://www.arduino.cc/en/Main/Software

Latest NOOBS (New Out Of Box Software) Version: 2.4.5 Release date: 2017-11-29 (stretch)
https://www.raspberrypi.org/downloads/

An easy Operating System installer for the Raspberry Pi, informative and easy to use starter guide.
https://github.com/raspberrypi/noobs

SD Card Formatting Software
https://www.sdcard.org/downloads/formatter_4/

Windows Disk Image Software, use to create a backup as an ISO, or to copy an ISO to another SD Card.
https://sourceforge.net/projects/win32diskimager/

Remote Control / Remote Desktop Software, used to communicate to the Pi from a Windows Computer ( removes the need for a separate Monitor, Keyboard & Mouse for the Raspberry Pi)
https://www.realvnc.com/en/connect/download/viewer/

Motor Control Boards to act as H Bridge Controllers,
http://trainelectronics.com/DCC_Arduino/DCC++/

The original board is this one, after you have recovered in shock about the price, go look for a Deek Robot Board!
https://www.ebay.com/itm/Arduino-A0...163000&hash=item41ac7c27c2:g:sI4AAOSwuhhXXh7K

Deek Robot Control Board, (Make sure it look likes this!)
https://www.ebay.com/itm/310787745501?_trksid=p2059210.m2749.l2649&ssPageName=STRK:MEBIDX:IT

High Power & Amp Controller BTS7960B 43A Stepper Motor Driver H-Bridge PWM For Arduino
https://www.ebay.com/sch/i.html?_fr...Motor+Driver+H-Bridge+PWM+For+Arduino&_sop=15

DO NOT get this one, it won't work without a lot of faffing and tinkering!
https://www.ebay.com/itm/L298P-Shie...368613&hash=item54480d01e5:g:YgIAAOSw5cRZIiwr

A few pictures of today's installation.
View attachment 232294 View attachment 232289 View attachment 232290 View attachment 232291

View attachment 232289

View attachment 232290
View attachment 232291

View attachment 232295

View attachment 232296

View attachment 232297

View attachment 232298

This subject has grabbed my attention to start with I have a couple of questions.

Question 1; is this only for power through the rails or can a battery R/C setup be used?

Question 2: a lot of systems around are using mobile phones to drive the whole system is it possible to use a mobile phone as a wifi interface so that a knob and button could be used maybe via USB input perhaps.?
This may negate the screen visibility issues etc that most critism of this type of method seems to attract?
An old smart phone could be recycled maybe?

Keep the ideas coming the 2 Johns because there is fertile ground out here for new ideas and I personally am open to new ideas that can be a source of fun to experiment with.
 
Just remember that if you are burning new code into chips to control a nuclear reactor...


You Really are cooking fission chips!

I know, hat coat door!
:giggle::giggle::giggle:


The favourite takeaway for Nuclear Physicists..... :rofl:

Jon.
 
I still don't see a train running?
 
Joking and doubts aside I do see this as a possible future if and a big if, if one is prepared to take the time to build and get a grip of the coding (3 if’s in one sentence that must be some sort of a record). But for the impoverished and time rich amongst us I see a great future for this tech.
 
That is and can already be done. There is a 00 Tram Layout with a Rptram that has a Camera at each end with the Tram being driven from a PC Monitor and Controller. Playmobil do a Train Camera and Monitor as well.



Back in the 1980's the ill fated Lionel Large Scale did TV transmitters in Locomotives. Some years previous they had done the same in traditional O-27.
 
Some more progress on the Arduino and Bluetooth front.
Clone Arduino UNO R3, Keyes FunduMoto L298P 2 Amp Motor Shield and HC-05 Bluetooth Module, used this combination as it's basically plug it altogether, eliminates wiring errors!
Plus the FunduMoto shield has a servo port and piezo buzzer to play with.

Power was supplied by a LGB L51090 18v 2 amp power supply.
Program (sketch) written for the Bluetooth communication between the HC-05 module and a Bluetooth enabled Smart Phone. PWM and direction control incorporated to supply direct to the track.

Simple APP designed and built for controlling speed and direction of engine on the track and installed on a Bluetooth enabled Smart Phone.

As they say onwards and upwards, next jobs are to work through a variety of H Bridge Controllers to determine their suitability for Track or Battery Power.

Await a Wi-Fi module to arrive, see how that goes.

A few pictures, Oh! and the engine was running!
The other half is away for a few days, will have to await her return with her phone to do a video!!!!

Need to check how this website a) displays the code from the sketch, b) will it allow uploads of peculiar file types!
Off to work, have to sort later.........


View attachment 232416


View attachment 232417

John,
I can recommend Pololu simple motor controllers, I am using them with standard 2.4GHz R/C and they work fine, I have coupled 2 with Mylocosound cards for chuffs and that combo works well. I could add bells and whistles but haven't bothered at the moment, a Picaxe 08M2 as an interface could provide the triggers.
 
Pretty sure this is my first post on this site, but have been playing with G-scale for many years. Started with an LGB starter set , then their MTS "digital" set. I've been following this thread and was inspired to break away from any one particular manufacturer, becoming locked into their quirks, support, and/or longevity... (yes, there are sob stories and plenty of disappointment on all these issues for me, hence my motivation)

My DCC Command Station has been an LGB 55006 and have had pretty good results, regardless of the decoders I acquire. A few quirks, resolved, but best left for another time) I did acquire a Sprog II/v3 that has been wonderful in helping me with various programming needs (various decoders) as I have been using the LGB 55045 with limited success.

Anyway... I have acquired a few Raspberry Pi Zero W processors, a Raspberry Pi 3B (Zero W and 3B both wireless), and a few motor drivers with the goal of creating a wireless access DCC (DCC++) Command Station for (well, so far) <$200.
As of today, I was able to use the 2 Zero W processors, and Sprog II, to create a wireless access point and JMRI-controlled Command Station. I was able to control trains via WiThrottle on my iPhone with this arrangement. And I did no programming or wiring of shields (for now). Only downloading of OS images.
My next goal is to replace the Sprog II with a DCC++ Command Station that can handle 18-22V and 5-6A.

I've already seen that done on this thread so I know I can get it done. Just waiting the arrival of another board (shield).

So, count me in as one of the "hobbyists" willing to give it a go!
 
Just think how far ahead of its time the Hornby Zero 1 was! OK it was very basic compared to what's being discussed in this thread, but it was certainly a huge jump ahead from DC wiring
 
Back
Top Bottom