Add WiFi shield?

This topic contains 14 replies, has 5 voices, and was last updated by  DonZalmrol 4 years, 2 months ago.

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #9864

    JvS
    Participant

    Hi team

    I was looking at your kit based on the Shield NCS314, to combine with an Arduino Mega. Would you know if it’s possible to add a WiFi Shield in between the NCS314 and the Mega? This one: https://www.adafruit.com/product/3653
    Adding WiFi combined with some reprogramming should make it possible to remote-control the Nixie Clock, which would be extremely cool!

    And if you think this (theoretically) should work, will the whole thing still fit in the case you sell? I think the shield will add appr. 1cm to the overall assembly height.

    Many thanks!

    #11408

    Zwartoog
    Participant

    I do not think that there is sufficient room between the Arduino and the NCS board.

    I also wish to add WiFi capability for syncing the clock by NTP, so I have ordered a board with integrated WiFi module: Wemos Mega +WiFi R3 ESP8266. No idea if it will work, but it seemed the simpler solution.

    #12999

    mcpgza
    Participant

    Is there any result? I’m interested in it too. NTP would be great.

    #13007

    Zwartoog
    Participant

    Hi,

    Yes, it works! I abandoned the Wemos solution: the board didn’t fit due to connectors in the centre of the board, and I fried the board when I tried to remove them :s

    Anyway, Arduino Mega + ESP8266 module works, and can be made to assemble properly 🙂 NTP syncs up to sub-second accuracy, and I have even added automated DST adjustment. And much more.

    Just haven’t gotten the time to write it all down in a howto. 🙁

    I can try to make the beta sourcecode available somewhere this weekend.

    Ciao!

    #13009

    mcpgza
    Participant

    Wow, short howto would be great 🙂 Which ESP8266 module did you used specifically, and how did you mount/wire it to the Mega panel? I have gps attached to my nixie clock, but it is not very reliable in indoor environment, and has a long cable, I would like to eliminate it, DST also would be a great addition.
    Thanks!

    #13010

    Zwartoog
    Participant

    I used a generic ESP8266 module, nothing fancy. Just note that you need a logic level converter, since the ESP works on 3.3V and the Arduino on 5V. U used a 4 pin one, one for each connector (+, -, Rx, Tx). Also bring tools to program the ESP. I used the one-but-cheapest solution, by using a FTDI cable, and following these instructions (here they use an USB-FTDI module):
    https://www.instructables.com/id/How-to-Flash-Firmware-Update-for-ESP8266-With-FTDI/

    Cheapest version is to configure your Arduino as a USB-passthrough.

    On wiring: I used feather stackers and bended them 90 degrees. Feather stackers have long pins, and fit tight in the connectors on the board. Then I connected jumper cables to those stackers towards the ESP. What puzzled me the most was where to tap on the 5V juice. If you look at the Mega board, the right connector has +5V at the top 2 pins, and GND at the bottom 2 pins, see:

    Arduino Mega Tutorial – Pinout & Schematics

    It is unfortunately not that visible. I connected the serials to Tx3 and Rx3. Of course, use non-conductive tape to properly fix the jumper cables to the feathers, and the feathers to the board – you don’t want to risk a cable being pulled out easily, especially not when close to the high voltage circuit!

    On GPS timings: this has one huge advantage: your (great-)grandchildren will still be able to fairly accurately use the clock. It does not require any knowledge to use this option. For NTP, you already need to reprogram the board as soon as your WiFi network changes password.

    Anyway, this is one of the loose ends in my code still – if there is no WiFi or internet connection, the clock freezes. Proper solution would be:
    – if NTP works, use that
    – if last succesfull NTP sync > 7 days, fall back to standard option (use GPS if available)

    Another one is fixing the dot-blinking, so it blinks exactly 0.5 secs after each second update (now it has its own 1000 ms timer, which is by far not in sync with the RTC).

    I’ll post the “almost done” code soon and let you know.

    #13020

    Zwartoog
    Participant

    Ok, the main part of the codes can be downloaded here:
    Nixie Clock Weather Station

    In the NCS code, replace MY_WIFI_SSID and MY_WIFI_PASSWORD with your own. If you want DST, create an account at timezonedb.com and enter your key also in the file.

    For the ESP, you need the files in that directory, and some libraries. One of them is the NTPClient, to which I made some updates (still need to push those changes them upstream).

    If you hooked up the ESP directly to serial, you can see if it works by giving some commands, like:
    PING
    GIMMETIME
    GIMMEACCURATETIME

    etc.

    Full tutorial still needs to be written, but this is a start.

    #13021

    mcpgza
    Participant

    Wow, thank you!

    #25427

    hamish-graafch
    Participant

    I’m interested in using an ESP8266 with the NCS312 to display something other than the time. (I want to fetch the current output of my solar inverter and display it.)

    Does the NCS312 only work with 5V Arduino boards? Looking at the schematic I think this is the case. I would like to use something like the Wemos D1 board which is an ESP8266 in Arduino Uno footprint, but it has 3.3V I/O only.

    If so does anyone know any other boards that would suit directly?

    #25429

    mcpgza
    Participant

    I’m using Wemos Mega with wifi (integrated esp8266) and it works perfecly, but this board is Arduino compatible, so it is not a big deal. I created a firmware for the esp2866 part using esphome.

    #25430

    Zwartoog
    Participant

    I think you will have to experiment with that. The simplest approach is to use a generic Mega with either an integrated or external ESP8266, and (re)use the source code I wrote (see link above) to communicate between the Arduino and the ESP.

    When only using an ESP8266-only board, the question is how compatible these boards are with generic Arduino code. Does it run “normal” Arduino code out-of-the box? If not, you will have to reprogram (parts of) the NCS code anyway. The good thing is that the code is fairly readable. In its bare basics, you can also only use the Nixie-indicator code and design your own program around it.

    From the hardware side, you will need logic-level-shifters for each pin to interface between 3.3V-5V, an ESP8266 with many pins (an Uno has barely enough pins to fully run the Nixie shield), and I guess you’ll have to apply 12V power on the shield directly (on the proper pin) otherwise the nixies will not lit. I really do not know if there are unforeseen pitfalls.

    So, if it is only for displaying your own numbers, you can probably get away with limited number of GPIO pins for the tubes and possibly the LEDs (require PWM). Also, you can use the indicator code as basic, and write your own code around it, which is very straightforward. Much of the pins are assigned for clock functionality (momentary push buttons, RTC, EEPROM, temperature, IR-function, serial-GPS, etc), and much of the code is around setting and displaying the time and so. Just keep in mind that you would want to implement some slot-machine like effect to increase the lifetime of your nixies, and possibly also want to turn them off.

    Anyway, just try. The worst thing that can happen is that you end up with “just” a Nixie clock 😉 (given that you worked out the electronics carefully)

    #25432

    hamish-graafch
    Participant

    Thanks for the comments guys. I found some code to drive the shield directly from ESP8266 at https://github.com/newkit/esp8266_nixie (not all the features of the shield due to limited I/O pins). But given the I/O voltage issue I ordered a RobotDyn Uno+Wifi board (Uno with extra 8266) instead, as it should just go together easier.

    #25433

    Zwartoog
    Participant

    Great! That shield looks like a similar solution as mcpgza uses (and I tried to use before). It is basically an Arduino with separate EPS8266 on board. From a software point of view, they are two independent boards (just as if you would add an ESP later). This means that you will have to setup the communication manually over serial. So, you can have a look at my code for some inspiration on that.

    #25434

    hamish-graafch
    Participant

    Yeah the software architecture won’t be pretty but it simplifies the hardware.

    #35025

    DonZalmrol
    Participant

    Apologies for digging this up from the past, but I’ve followed similar instructions on how to incorporate the NTP, it works but its buggy.
    The UDP package size drops from 48 (What it should be for NTP) to 0 causing my RTC to default to 1970… I’ve created topic for my issue.

    Arduino NTP issue for IN-12 Arduino Shield+Adapter+Raspberry Pi Nixie Tubes CLK

Viewing 15 posts - 1 through 15 (of 15 total)

You must be logged in to reply to this topic.