Like from one discussion by Oriolo20, forum member, I developed this project, if we want to call it that. In fact it is not really a complete project but only the proof of an experiment that wants to demonstrate a written program. I called it XP which means eXperimental Project…. In fact, it is noted that it is not a definitive editing, but only to prove the functioning of all the programs and other materials used. In particular, I could notice the optimal frequency to keep the white LEDs on without noticing flickering.
The development is based on a sketch which must manage an array of elements. In my case I preferred to mount simple white LEDs. However the sketch is oriented to manage without changes also the nixie tubes with any differences.
Partly for an oversight and partly because I found it cheaper, I mounted a 1-on-10 decoder like the CD4028. In fact my oversight I mounted the common cathodes, instead of the anodes that are to drive the nixie.
I must say that the sketch is not portable on other Arduino models that do not mount the ATmega328p. In fact, this sketch directly addresses the registers of the micro-controller.
The assembled unit can work if powered by the USB connection showing the serial monitor, but excludes other connections on pins D0 and D1, or with a power distributor that I mounted. There was a particular attention that the power lines were very safe and even multiple, since the jumper wires are not very capable and also the connector contacts can create resistances or false contacts. A note on addressing the problem of connections that disappeared. I found that “jumper” they are not very reliable and the tinned copper conductor. easily stops.
I note the two connectors that provide for the expansion of communication to the sources of information necessary to keep the timetable punctual. I thought I could mount jumpers for the moment you want to program or edit the Arduino sketch.
I also did another development for the program on an ESP module-01 which communicates via the I2C bus and sends the time taken from a modulo DS3231 and synchronized via WiFi to a server NTP.
I was unable to communicate via UART, but I think it's better in I2C.
As you can see, it is also connected to the Arduino serial line. So that you can send additional time sources via that source. The package that I have prepared includes an example of a sketch that expects data from the serial in the predetermined format. In order to be able to take information from a GPS or other, this attachment should be expanded to convert the data received into the format that I explain below.
The format must consist of 6 byte, but the buffer does 8. These six bytes describe the time and date
HH:MM:SS for the hour and GG:MS:AA for the date. The others 2 bytes can be used for future developments that can contain the milliseconds of difference that the data travels. However this is not currently included.
The program is commented in English. For those who are not used to it, I could make a translated copy of it, while my ambition would be to be able to divulge it even for those who do not know Italian also because it is rational that it is written internationally.
In the first part, as is my custom, several definitions are collected (define) which determine how the sketch can be compiled as needed.
To the line 32, the Arduino address is defined on the I2C bus as a slave, which in case could be changed.
To the line 33, there is the update period of the matrix in milliseconds. I think it is not possible to increase further, unless you change the timer prescaler parameter 1. Or switch to using the TimerOne library.
To the line 38, you can choose some levels of debugging, ranging from 0 a 4. In this method you can use the serial information and a liquid crystal display. The liquid crystal device has a parallel serial interface with integrated 74HC595. For this reason, you can choose between using the Arduino SPI method or the ShiftOut method.
I must say that I didn't have much time to fully verify this phase. I modified the libraries for the interface model that I used, as seen in the diagram. For this I have unified them to use the same type of serial adapter.
To the line 39, it is expected if the serial information is addressed to a terminal that accepts ANSI escape characters or if it is a simple serial interface.
To the line 41, there is the safety value that the time you want to change is not back in time.
Regarding the choice of the connections of the liquid crystal display, it also implies a variation to where you want to connect the 1-on-10 decoder. Obviously if you want an LCD on outputs D8 ~ D11 (using SPI), it will not be possible to connect the decoder from that port, therefore in the program the outputs A0 ~ A3 are chosen.
Vice versa if you want the decoder on outputs D8 ~ D11, then the display will be connected to outputs A0 ~ A2, but with the possibility of being able to choose other free outputs.
The program is fairly streamlined and it is expected that we can also add the management of other sources where you can take the time to the precision of a second without risking losing seconds.
The the rest of the project plans to provide the sources of the exact time. For this I have implemented a management via micropython (MP, below) installed on ESP-01.
I explain that the choice to use MP was from the fact that the firmware that is supplied with the purchase has not proved stable enough.
Perhaps also due to the fact that the module was mounted precariously on a breadboard. Instead, care must be taken that the contacts are secure and allow the current peaks that ESP requires during the connection phase to the router. For this I mounted on a millefori board with the necessary accessories to be able to reprogram the module.
I also assembled a level adapter for the I2C bus. Maybe it wasn't strictly necessary, but among the many tests, I could not understand why Arduino did not receive the signals sent to it.
But that circuit is of an alarming simplicity and I made it in a few minutes. Given that from the side 5 volts I did not put the pull-up resistors because they are already present on the RTC module.
other tests that I put in place was to connect my SBC (Tinker Board) to send the timetable data. Everything works very elegantly. If you are interested you can find the python script to load to run. I have tried with an installation Armbian, why the attempt with the Archlinuxarm cannot find the bus correctly.
About these SBCs, it is not difficult to test the connection and send the data. In the package there is also a python script that can be used with a Raspberry or computer that can be interfaced to the I2C bus.
The command must be sent with administrator privileges, since it must access the I2C bus hardware, this will be a command like:
sudo ./sendtime02.py 60 europe.pool.ntp.org
You can exclude the two parameters after the name, then the default values will be used. These two parameters define the pause between one query and another to the NTP server. While the second parameter defines which server to connect to.
The package is available on my drive.
If there is any other information you need or notes, I will be happy to be able to give an opinion
https://www.elettroamici.org/wp-content/uploads/2020/06/Main-scaled.jpg20812560Picmicro675https://www.elettroamici.org/wp-content/uploads/2017/08/FAVICON-1-300x271.pngPicmicro6752020-06-17 09:12:412020-06-29 08:11:02Dot clock, XP