ADS1115 ADC checkout – #1

I have application for an analogue to digital converter (ADC) in a noisy environment, so a possible solution is to place an ADC module very close to the analogue sensors and use some form of digital connection back to a microcontroller. A possible protocol is I2C, and has the advantage that several ADC modules can be attached to the same bus, along with other peripherals Eg LCD.

ads1115-00The above ADS1115 modules have four input channels, 16 bit conversion, flexible input mux, and were available on eBay for less than A$4, so worth a try.
Continue reading ADS1115 ADC checkout – #1

Backup for NBN VDSL access

The change from Telstra ADSL to NBN VDSL drops the POTS line that gave telephone access independent of premises power.

Telephony is now provided by an ATA integrated into the VDSL modem, and dependent on mains power.

NBN makes no definitive statements about battery backup to the node, or endurance of any battery backup. Nevertheless it appears from pics people have taken of the node cabinets that the bottom layer is batteries and it is likely that they have endurance of more than 10 hours.

1474860682982

Above, a pic of an NBN FTTN cabinet from NBN’s website, and showing batteries in the bottom layer.

NBN is not customer facing, and it seems they will provide are reluctant to provide all manner of information useful to end users, perhaps guided by lawyers who do not want to create any obligation or liability for the company… the way of modern telecommunications.

In that context, it would seem worth the risk to provide battery backup to the VDSL modem to provide broadband access to battery devices such a tablets, laptops and smartphones, and access for a POTS handset plugged into the ATA port.

The supplied modem includes a 12V DC power pack rated at 2A.

iinetgatewaycurrent

Above, measurement of the current drawn averages around 0.5A with all features running (though it may draw more current during phone ringing). Continue reading Backup for NBN VDSL access

Queueing in data networks

Modern data networks route or switch relatively small ‘packets’ of data across shared links that along with the switching nodes, form the wider data network.

One of the roles of the switches is to receive packets on one link, and send them onwards on the most appropriate link. Since links may be at different speeds, and many links may source packets to be sent on any link, there exists a mechanism in the switch to store packets pending transmission, in the simplest case it is a first come first served link queue.

The function of the queue then is to hold packets until they can be sent on the link, and to offer them in first come first served order. That raises two important questions:

  • how long will packets be delayed;
  • how many slots does the queue need.

Queuing theory gives us a method of estimating these quantities.

Lets make some assumptions about the traffic:

  • service requests arrive randomly in time; and
  • service time is exponentially distributed with an average time of 1.

screenshot-19_10_16-08_25_32

Above is a plot of normalised average response time (service time + queue wait) vs resource (link) utilisation (pu means per unit). It can be seen that when the link utilisation is 0.5pu (50% busy), that response time is 2pu (ie twice the average service time), twice that needed to send an average packet at very low utilisation. Response time rapidly degrades:

  • at 70% link busy, response time is 3.3 times packet transmission time; and
  • at 90% link busy, response time is 10 times packet transmission time.

To ensure packets are not discarded, the queue need sufficient slots to hold packets even in most peak bursts. Whilst at 70% link utilisation, the average queue size is 2.3 slots (3.3-1), a larger queue size accommodates bursts better. Discarded packets can severely affect performance, not only are they likely to be resent after some delay and network overhead, they can break a higher level protocol unit in simple systems and waste the link capacity and other links used to send the rest of that protocol unit. Continue reading Queueing in data networks

Android and local IPv4 DNS name resolution

Much has been written of problems with local IPv4 DNS name resolution over quite some years, and some of it may have been software defects, but some of it seems to be a side effect of IPv6.

I have run a home network with local DNS and DHCP (doing dynamic DNS updates) for close on 20 years mostly without problems. This is a similar configuration to many corporate networks with an Intranet and gateway to the Internet.

Recent installation of a iiNet TG-1 VDSL gateway changed all that.

Try as I might, the Android tablets (6.01) would not resolve names defined in the local DNS even though they showed that they had acquired the correct IPv4 DNS and search path.

The Android tablets certainly try to discover available routers (and DNS).

screenshot-17_10_16-20_11_26

The packet trace above shows the Router Solicitation message from one of the Android tablets. Continue reading Android and local IPv4 DNS name resolution

Backup options for NBN VDSL access

The change from Telstra ADSL to NBN VDSL drops the POTS line that gave telephone access independent of premises power.

Telephony is now provided by an ATA integrated into the VDSL modem, and dependent on mains power.

NBN makes no definitive statements about battery backup to the node, or endurance of any battery backup. Nevertheless it appears from pics people have taken of the node cabinets that the bottom layer is batteries and it is likely that they have endurance of more than 10 hours.

1474860682982

Above, a pic of an NBN FTTN cabinet from NBN’s website, and showing batteries in the bottom layer.

NBN is not customer facing, and it seems they will provide are reluctant to provide all manner of information useful to end users, perhaps guided by lawyers who do not want to create any obligation or liability for the company… the way of modern telecommunications.

In that context, it would seem worth the risk to provide battery backup to the VDSL modem to provide broadband access to battery devices such a tablets, laptops and smartphones, and access for a POTS handset plugged into the ATA port.

The supplied modem includes a 12V DC power pack rated at 2A.

iinetgatewaycurrent

Above, measurement of the current drawn averages around 0.5A with all features running (though it may draw more current during phone ringing). Continue reading Backup options for NBN VDSL access

mpd on a RPi, streamripper and sox

u20

For some years I have run mpd on an early RPi as a media player, and it has worked very well… better as Raspbian improved in robustness. Playback is controlled mostly from mpdroid on our Android tablets or phones. Playlists switches can be automated using cron on the RPi.

Whilst using Telstra Bigpond ADSL for broadband access we have been unable to stream Shoutcasts (“Internet Radio”) without frequent stops and starts rendering it unusable. The 8Mb/s broadband service performed so badly it would not sustain near real time traffic at 200kbps.

With the experience that Telstra does not maintain sufficient capacity to give its customers good service, we chose another provider once NBN access became available. Continue reading mpd on a RPi, streamripper and sox

Adapting a 5V TTL GPS to RS232

5V TTL interface GPSs can be had for about $10 on eBay. They are aimed at the RC market and although the GPS chip is a 3.3V chip, they have a 5V regulator on board and level shifters or 5V tolerant IO.

To use them with APRS you usually need to get RS232 output and to support the common 12V feed on the DE9 connector, the RS-232 / TTL adapter needs to incorporate a 12V/5V regulator.

This article describes a couple of modules that are available on eBay for a dollar or so, and suitable for modification by adding the regulator.

max3232powerAbove left and bottom are two MAX3232 modules that have had a LM78L05 regulator and decoupling cap added to provide for 12V in and 5V to power the MAX3232 and GPS (top right is a Ublox NEO6M).

In the case of the lower module, a track has to be cut to disconnect the pad for 12V in from the existing circuitry.

 

Fan controlled by humidity sensor – pre implementation data gathering

This article documents measurements of temperature and relative humidity (RH) over 10 days prior to implementing the fan solution to provide a baseline for designing the Fan controlled by humidity sensor.

A RC-4HC datalogger was used to collect temperature and RH measurements over 10 days which included a range of late winter weather, some rain, some fine clear days. The logger was located at 1.5m above floor level in the shed in a relatively clear spot in the middle of the area..

Screenshot - 22_08_16 , 15_53_17

Above is a chart of temperature and RH. The daily RH peaks are typically between 08:00 and 09:30, and pretty much coincide with the minimum observed temperature. There is clearly a lag from outside temperature which would tend to be minimum a few hours earlier, and a lower minimum (there were plenty of frosty days in the sample set). Continue reading Fan controlled by humidity sensor – pre implementation data gathering

Time to get some experience with 32bit microcontrollers – some progress

At Time to get some experience with 32bit microcontrollers I wrote that after almost 50 years working with 8bit microcomputers and microcontrollers, I thought it about time to get my hands dirty on some 32bit microcontrollers.

This article reports some work in the STM stream.

I abondoned the ST Discovery board in favour of a low cost basic ST32F103 development board costing about $4 on eBay. The chip is a 32bit microcontroller clocked at 72MHz.

As a learning vehicle, I decided to implement the functionality contained in Arduino thermistor thermometer – a tutorial.

The development environment is Eclipse with the GNU ARM toolchain, a debugger probe, the basic development board, and a 1602 LCD display with I2C backpack and an inexpensive CP2102 USB RS232-TTL interface.

ST32F103-d01

Above is the working trial. The GDB debugger allows On Chip Debugging (OCD).
Continue reading Time to get some experience with 32bit microcontrollers – some progress

Fan controlled by humidity sensor – design technique

This article gives an outline of the process used in designing the Fan controlled by humidity sensor to use my Generic heating / cooling controller design (hcctl).

Arduino thermistor thermometer – a tutorial gave a method for designing a thermometer based on a formula predicting the behaviour of the sensor. This article explains a different approach where that is not possible.

HDS10-02

Above is a characteristic from the manufacturer’s data.

The curves to no lend themselves to simple curve fits, so a cubic spine interpolation will be made based on key points from the curve.

Four our purposes, the mean curve (green) is sufficient for design.

Screenshot - 24_07_16 , 08_16_07

 

Above, the mean curve was digitised to capture the shape of the curve, 17 points were used.
Continue reading Fan controlled by humidity sensor – design technique