Tag Archives: wifi module

Pop-UP Clock… now in colour!

The Pop-Up Clock described in a recent post “Pop-Up Clock and Flipper Clock – Magnetic Digit Elements” is a work-in-progress proof of concept as I develop a full 4-digit clock (complete with flashing colon).

So far, the design displays the time on this single digit display in a sequential manner: two digits for the hour, then a dash (“-“) followed by two digits for the minutes.

Wishing to increase the illumination of the display and the contrast of the segments between ON and OFF (or IN and OUT) states, I made some changes. I added a strip of addressable WS2812 LEDs around the periphery of the display and blacked-out the rear of each segment so that little light passes into the HDPE when it is extended (OUT).  When retracted (IN), light from the LEDs shines into the elements and illuminates them.  In the software I reversed the direction of the segments so that when it is ON, it is retracted (IN).  Here’s a video that shows the effect.

This test shows considerable light bleed from the LED strip, and this shall be rectified when there is a fully enclosed baffle between the front plate and servo mount plate… In addition, I shall also increase the contrast of the segments with a better light seal.

As with many of my clocks, the accurate time is obtained from an NTP request to the US National Institute of Science and Technology (NIST) atomic clock server, using an ESP8266 WeMost D1 Mini WiFi module.  WiFi channel access parameters, local time relative to GMT, daylight savings active, and duration between display updates (minutes) are entered on its web server and subsequently stored in EEPROM when the unit is powered on for the first time, or if it fails to connect to the local WiFi channel.

Oh yes, and just for Lise, the display its blue!

 

TIME LOOP Clock: accuracy with celestial connections

Introducing the TIME LOOP Clock
Accurate local time with celestial connections

The TIME LOOP Clock provides automatic to-the-second time accuracy with a dynamic display that adjusts hues and brightness based on the real-time position of both the sun and moon.

TIME LOOP Clock

TIME LOOP Clock: showing 1:45:44 PM in daylight hues

TIME LOOP Clock:

TIME LOOP Clock: beautifully coloured time display that dynamically adjusts based on the position of the sun and moon

Time Loop

Time Loop: moon rise and moon set

Time Loop

Time Loop: sunrise and sun set

Time Loop

Time Loop: time mode

TIME LOOP Clock:

TIME LOOP Clock: showing 10:13 PM in its night time hues. Note that the moon was not in the sky so the hues reflect this.

TIME LOOP Clock:

TIME LOOP Clock: showing 8:25 AM with its daytime hues. The brightness of the display is based on the current time relative to solar noon

The TIME LOOP Clock is a 182mm (7.2″) diameter wall-mounted clock that sports a ring of LEDs used to tell the time. Based on conventional analogue clock faces, hours are displayed as single fixed points of light, minutes fill or empty around the ring while a second ‘hand’ gently pulses and traverses the ring. The hues of the display automatically adjust based on the position of the sun and moon. During daylight hours, the brightness of the display adjusts based on the current time relative to solar noon while nighttime hues are chosen based on moon rise and moon set times.

Continue reading

Weatherman: Port to WeMos D1 R2 ESP8266 board

The WEATHERMAN: Web Weather Forecaster original project was built using an Arduino UNO and an Ethernet shield to connect to the web to obtain the forecasted weather information. The need for an Ethernet connection was a severe limitation and the small amount of data RAM of the UNO meant that only three days worth of weather data could be processed…. Bummer!

However, my new WeMos D1 R2 WiFi ESP8266 Development Board has oodles of memory so the Weatherman project was a great way to test how easy it is to port existing the code onto the ESP8266 and to expand the forecasting to the full 7 days.

Et voila!

Weatherman: Port to WeMos ESP8266 WiFi Board

Weatherman: Port to WeMos D1 R2 WiFi ESP8266 Development Board

Continue reading

Level Shifting: Arduino & ESP8266

Using the ESP8266 WiFi Transceiver module with a 5v Arduino requires the use of level shifting circuitry. A resistor divider (1k and 2k typically) works perfectly well for signals from the 5v Arduino to the ESP8266 3.3v. However, while many people connect 3.3v derived signals directly to a 5v powered input, to maintain good noise margins requires an active interface. While there are several bus drivers available that will perform level translation and buffering (such as the 74LVC245A), they are overfill when just a couple of signals are involved.

In the design of the ESP8266 WiFi Module: Data Logger there are just two signals (TX and RX) that require level shifting and this circuit, using a couple of 2N7000 N-Channel Enhancement Mode Field Effect Transistors is small and works very well.

Level Shifting Interface

Level Shifting Interface

Now, I recognize that some of you may not be convinced that this actually works. Unfortunately this may be because I failed to draw in the drain-substrate diode of the MOS-FET (see state 3 below).

Operation of the level shifter:

The following three states should be considered during the operation of the level shifter:

  1. No device is pulling down the bus line. The bus line of the ‘lower-voltage’ section is pulled up by its pull-up resistors to 3.3V. The gate and the source of the MOS-FET are both at 3.3V, so its VGS is below the threshold voltage and the MOS-FET is not conducting. This allows the bus line at the ‘higher-voltage’ section to be pulled up by its pull-up resistor to 5V. So the bus lines of both sections are HIGH, but at a different voltage level.
  2. A 3.3V device pulls down the bus line to a LOW level. The source of the MOS-FET also becomes LOW, while the gate stays at 3.3V. VGS rises above the threshold and the MOS-FET starts to conduct. The bus line of the ‘higher-voltage’ section is then also pulled down to a LOW level by the 3.3V device via the conducting MOS-FET. So the bus lines of both sections go LOW to the same voltage level.
  3. A 5V device pulls down the bus line to a LOW level. The drain-substrate diode of the MOS-FET means that the ‘lower-voltage’ section is pulled down until VGS passes the threshold and the MOS-FET starts to conduct. The bus line of the ‘lower-voltage’ section is then further pulled down to a LOW level by the 5V device via the conducting MOS-FET. So the bus lines of both sections go LOW to the same voltage level.

OK?

To illustrate, I used the 32kHz square-wave signal from an RTC module. In the first instance, the RTC module was powered by 5v and in the second by 3.3v. The following screen capture from my oscilloscope shows the RTC 32KHz 5V signal (green) shifted to 3.3V (yellow). The on-screen measurements show the shift from 3.9V peak-to-peak (0.6 – 4.5V) to 2.9V peak-to-peak (0.4 – 3.3V).  Just what we wanted!

Level shifting from 5v to 3.3v

Level shifting from 5v to 3.3v. Notice the peak-to-peak measurements for each channel (green – input, yellow – output)

Now, when the RTC is powered from 3.3V the square wave has 2.9V peak-to-peak (0.6 – 3.3V). The trace below shows the shift to 3.3V peak-to-peak (0.5 – 3.8V).  For a typical CMOS gate operating at 5V, the acceptable input signal voltages range from 0 – 1.5V for a logic 0 state, and 3.5 – 5V for a logic 1 state. While several designs suggest a direct connection between a 3.3V output and 5V input is okay, if it works at all there is absolutely no noise margin as a 3.3V output is lower than the nominal minimal input voltage level for a logic 1 state.

However, level shifting from 3.3V outputs to 5V inputs using this design provides at least 0.3V of noise margin.

Level shifting from 3.3v to 5v

Level shifting from 3.3v to 5v.

Hope that this helps…

Just saying!