Data Rates

Guest
Hi,

I am new to electronics. So, please be patient. I am trying to figure out the following problems for past 10 hours and can not get it solved.

I need to sample six sensors after every 20 minutes using a microcontroller. Four temperature sensors and two light sensors. Each sensor is connected to the six individual pin of the ADC. This ADC is integrated into the microcontroller chip.

The on chip microcontroller has 12 bit ADC which can sample at 10kSamples/sec.

So, what does it mean that 10bits + 10bits + 10bits + 10bits + 10bits + 10bits = 60 bits every 20 minutes.

20 minutes = 1200 seconds., So, its 60 bits every 1200 seconds. But then ADC is sampling at 10kHz. How would that fit into this mathematical equation?

So, the data rate would be 0.05 bits /sec. I am so confused. I am also confused about taking into account the switching time of the ADC among all six sensors. I meant how much time does the microcontroller take to move from one channel to another.

I am planning to use the following microcontroller


http://www.atmel.com/images/atmel-8271-8-bit-avr-microcontroller-atmega48a-48pa-88a-88pa-168a-168pa-328-328p_datasheet_complete.pdf


mel
 
On Wednesday, November 25, 2015 at 2:40:08 PM UTC-8, walrave...@gmail.com wrote:
Hi,

I am new to electronics. So, please be patient. I am trying to figure out the following problems for past 10 hours and can not get it solved.

I need to sample six sensors after every 20 minutes using a microcontroller. Four temperature sensors and two light sensors. Each sensor is connected to the six individual pin of the ADC. This ADC is integrated into the microcontroller chip.

The on chip microcontroller has 12 bit ADC which can sample at 10kSamples/sec.

So, what does it mean that 10bits + 10bits + 10bits + 10bits + 10bits + 10bits = 60 bits every 20 minutes.

20 minutes = 1200 seconds., So, its 60 bits every 1200 seconds. But then ADC is sampling at 10kHz. How would that fit into this mathematical equation?

So, the data rate would be 0.05 bits /sec. I am so confused. I am also confused about taking into account the switching time of the ADC among all six sensors. I meant how much time does the microcontroller take to move from one channel to another.

I am planning to use the following microcontroller


http://www.atmel.com/images/atmel-8271-8-bit-avr-microcontroller-atmega48a-48pa-88a-88pa-168a-168pa-328-328p_datasheet_complete.pdf


mel

Don't think of this as bits per second because nothing runs that way.
You only need 6 readings every 20 minutes so your processor will basically do nothing almost all the time. So, write the timing routine to 'eat' the 20 minute block of doing nothing. I'm not familiar with this processor but there may be a low power timer mode where you set some registers to let the timer wait to generate an interrupt to wake it up, do the task and go back to low power mode. This would be very important if running on batteries. Is this time interval 'about' 20 minutes or EXACTLY 20 minutes? If it's exactly you'll have to account for the time the ADC uses getting the readings. BTW, after you have these numbers, what will you do with them? Do you need an interface to some sort of non volatile memory like a camera card or thumb drive? Or are you sending the data on some sort of serial link whenever it's available every 20 minutes. If it's serial you'll need a little bit of 'protocol' to verify the data made it to the receiver with no errors. A favorite trick in IR remotes is to send the data twice but the second time with all the bits inverted. The receive end then Exclusive ORs the normal and inverted data and if 'good' the result will be all 'ones'. If the receiver gets an error it can request a re-send of the data.

 
Hi,

Thanks for your reply! The microcontroller that I have has 256 KBytes of RAM and 512KBytes of EEPROM. Every 20 minutes, I want to send the data to ZigBee module using UART ( 8 bit register, 9.6kbps).

So, my confusion is that after every 20 minutes I will get 6 x 10k x 10 = 600kbits of data. So, I have to store it in the RAM. Would 256KBytes be enough? and can I be able to send 600kbits of data over Zigbee after every 20 minutes.

mel
 
On 11/26/2015 06:08 AM, walravenmelissa@gmail.com wrote:
Hi,

Thanks for your reply! The microcontroller that I have has 256 KBytes
of RAM and 512KBytes of EEPROM. Every 20 minutes, I want to send the
data to ZigBee module using UART ( 8 bit register, 9.6kbps).

So, my confusion is that after every 20 minutes I will get 6 x 10k x
10 = 600kbits of data. So, I have to store it in the RAM. Would
256KBytes be enough? and can I be able to send 600kbits of data over
Zigbee after every 20 minutes.

mel

You can likely send it as you get it.
otherwise 6*2*8/8= 12 Byte every 20minutes...
but it gets larger if you convert to ascii

The datasheet has the 10-15 Kilosamples because at faster speeds the
sampling stage won't work properly.. interval too short,
you'll get crosstalk. I asked a while ago about the max speed
on sci.electronics.design. there's a url there somewhere, too(openmusiclabs...I think).

It does not mean you have to use it continously.
 
On Wed, 25 Nov 2015 14:40:00 -0800, walravenmelissa wrote:

The on chip microcontroller has 12 bit ADC which can sample at
10kSamples/sec.

So, what does it mean that 10bits + 10bits + 10bits + 10bits + 10bits +
10bits = 60 bits every 20 minutes.

20 minutes = 1200 seconds., So, its 60 bits every 1200 seconds. But then
ADC is sampling at 10kHz. How would that fit into this mathematical
equation?

The ADC *can* sample at 10 kHz; that doesn't mean that it has to
sample at that rate. The ADC supports single conversions (where each
conversion is started explicitly), free-running mode (which starts a
new conversion as soon as the previous one is complete), and auto-trigger
(which starts a conversion on a timer event or external interrupt).

In free-running mode, it takes 13 clock cycles per conversion. In
single-conversion mode, there's at least a one clock gap between samples.
In either case, it takes an extra 12 cycles for the first converion after
enabling the ADC.

With a 100 kHz ADC clock, 6 samples will take just under a millisecond,
yielding either 8 or 12 bytes of data depending upon whether you pack the
6x 10-bit samples into 60 bits, or store each sample as two bytes. Sending
them at 9.6 kbps will take up to 12.5 milliseconds (more if you have
framing or error checking/correction). After which, you can put the CPU to
sleep for 20 minutes.

So, the data rate would be 0.05 bits /sec. I am so confused. I am also
confused about taking into account the switching time of the ADC among all
six sensors. I meant how much time does the microcontroller take to move
from one channel to another.

According to the data sheet, none, i.e. you can start a conversion
immediately after switching channels. In free-running mode, you can change
the channel for the next conversion while a conversion is being performed,
i.e. you can sample continuously with each sample taken from a different
channel.
 
On Wed, 25 Nov 2015 21:08:18 -0800, walravenmelissa wrote:

Hi,

Thanks for your reply! The microcontroller that I have has 256 KBytes of
RAM and 512KBytes of EEPROM. Every 20 minutes, I want to send the data
to ZigBee module using UART ( 8 bit register, 9.6kbps).

So, my confusion is that after every 20 minutes I will get 6 x 10k x 10
= 600kbits of data. So, I have to store it in the RAM. Would 256KBytes
be enough? and can I be able to send 600kbits of data over Zigbee after
every 20 minutes.

You DO NOT need to keep the ADC running all the time, and even if you did
you wouldn't need to save all the readings.

Wake up once every 20 minutes, read each relevant ADC channel in turn,
send it to the ZigBee module, then go back to sleep.

Compared to the job you need to get done you have oceans of RAM, oceans
of EEPROM, and oceans of processing power. You should be fine.

--
www.wescottdesign.com
 

Welcome to EDABoard.com

Sponsor

Back
Top