Wednesday, November 15, 2017

Model Railroad DCC Control - JMRI / Raspberry PI

For those who want to control their DCC Model Railroad with their cell phones or tablets (pretty much any Android (Engine Driver) or IOS (WiThrottle) device), There is a Raspberry Pi image already built. Copy it to a sdcard, insert into your Raspberry Pi, and you are pretty much set to go!

Once you've assembled the hardware and installed the image, connect your RPi to your layout via PR3, LocoBuffer-USB, NCE Serial, NCE USB, SPROG or DCC++, and plug in the RPi's power adapter.  You should see some LEDs on the RPi begin to blink, and shortly, using your wifi-capable phone, you'll see a WiFi network named "RPi-JMRI".  Select it and enter "rpI-jmri" when prompted for the key (note that 3rd character is a capital "eye").  Open EngineDriver on your phone, and you should have an available connection under Discovered Servers called "RPi-JMRI".  (Similar with WiThrottle on iPhone).  Enter loco address and run trains!

Tuesday, November 14, 2017

Breadboard Friendly ESP8266-01 / nRF24L01+

The cheapest WiFi modules on the market (around $3 each) are the ESP8266-01 boards, which are WiFi enabled microcontrollers in their own right (with limited I/O), or they can be used with an Arduino as the WiFi interface. However, they have a funky 2x4 header that is not breadboard friendly.

Here is one possible solution. A inexpensive 2x4 to breadboard converter with a 2x4 socket on top and headers on bottom that match up nicely with a breadboard. It not only works with the ESP8266-01, but also works with the nRF24L01+ RF modules as well.

Now it's very easy to experiment with these handy modules. If you need a 5v to 3.3v regulator and level shifting for your ESP8266-01, check out these converters!

More ESP8266 Fun!

We have shown how to use the ESP8266 to collect sensor data, and send it to a database (client mode), but you can also use the ESP8266 as a webserver, displaying a web page and showing status or accepting input (server mode). In fact, it can be a server and a client at the same time. The following code runs a webserver on the esp8266, providing input fields to instruct the esp8266 to perform an action, and then POSTs that set of actions to the database. You could also read a sensor to verify that the actions were actually performed.


Related Posts Plugin for WordPress, Blogger...