Can I Turn On an XBee, ATMega328, RTC DS1307 and Catalex microSD adapter

Thread Starter

IgnacioMorac

Joined May 30, 2021
39
Hello partners

I am an engineering student and I am doing my graduation project. I try to send information from the Photovoltaic Panel to the computer. In order to do this, I made a design of a circuit that can measure the voltage of a panel that is generating between 25 and 44 volts. This voltage will be measured by the ADC, processed and sent in a data frame already established in the XBee Transmit Request format. Part of the design is in my previous post, where I ask how to make a protection circuit. https://forum.allaboutcircuits.com/threads/crowbar-circuit-to-protect-sensor-for-overvoltage.179464/

Anyway, so as not to tire them with the story. I made a PCB and assembled everything. The circuit did not work, which is very frustrating.
Since I have to introduce myself the other week, I got in trouble.
. I made a PCB and assembled everything. The circuit did not work, which is very frustrating.
Since I have to present the other week, I got into trouble.

As this could not be done, we proceed to rephrase the problem. I am no longer going to focus on measuring panels with voltages within the 25 to 40 range. Instead, I am going to focus on 18 volts maximum. What I have done is use the same circuit for the ADC without the protection stage, just to begin to see what is failing me in the circuit.
1623429062899.png
Now I need a circuit that gives me 5 volts independently of the input. So I used the LM2596 DC - DC buck.

1623429286336.png
Then I connect the XBee and it does not turn on. So make a stream mirror. But when I connect the buck, the current mirror should theoretically have the same voltage but more current. What happens is that when I measure the voltage at the output of the buskc I have 1.4 volts.

1623429422128.png

So I can't turn on an XBee, much less will I be able to use a circuit that has an XBee, an ATMega, an RTC and a Datalogger.
 

Thread Starter

IgnacioMorac

Joined May 30, 2021
39
Hello colleagues I want to know if in this forum you have carried out projects with an ATmega328 (not the arduino) only the microntroller and the XBee.

My idea is to make a sensor that takes the voltage from a panel, the panel voltage will feed the Xbee, Atmega328, RTC ds1307 components and the Datalloger Catallex MicroSD module.

I would love to know any tips or advice when using these devices.
 

Irving

Joined Jan 30, 2016
2,322
I think you have a few fundamental flaws in your understanding of basic circuit theory here. The circuit with the 1490 won't do anything useful - the output of the voltage follower will just be a few mV less than its supply rail - ie the PV cell output voltage. You might as well junk the 1490 and just connect R7 & R8 across the PV cell, it'll give the result you are aiming for assuming you're looking for a 5.2v sample from an 18v feed.

Plus its hard to follow what you're attempting to do with the current mirror. As to the buck converter, where are you powering it from? The PV cell?
 

Thread Starter

IgnacioMorac

Joined May 30, 2021
39
I think you have a few fundamental flaws in your understanding of basic circuit theory here. The circuit with the 1490 won't do anything useful - the output of the voltage follower will just be a few mV less than its supply rail - ie the PV cell output voltage. You might as well junk the 1490 and just connect R7 & R8 across the PV cell, it'll give the result you are aiming for assuming you're looking for a 5.2v sample from an 18v feed.

Plus its hard to follow what you're attempting to do with the current mirror. As to the buck converter, where are you powering it from? The PV cell?
Hi Irving
If correct, I am feeding the buck directly from the photovoltaic cell.

My idea is to measure the voltage of the photovoltaic panel.
So I thought about making a simple sensor, that can measure the voltage of the panel and that at the same time this sensor is fed by the voltage of the cell to work.

This image is the block diagram representation of the sensor.
The first stage is an overvoltage protection circuit, which I thought about using a Power Zener, made up of a zener and a transformer, but it didn't work for me, so I think I'm going to discard it.

The second stage consists of two circuits, with the first circuit I seek to regulate the voltage to be able to have 5 volts at the output and to power the ATMega328 microcontroller, the RTC DS1307, the MicroSD catalex module and the XBee S2C 2.4 digimesh T.h.
All of these are powered by 5 volts.

The second circuit of the second stage is the circuit that reduces the voltage to a measurable range by the ADC of the microcontroller, this would be a range from 0 to reference voltage, in this almost a voltage of 5 volts.

The third stage is the microcontroller and the RTC module and the micro SD module, this stage is to keep a record of the date and time at which the measurement was made. In turn, the microcontroller will form a frame that will send through its UART ports to the XBee.

The fourth and last stage would be the XBee, this module will be in charge of sending the data frame to a computer.

I already did the programming of the ATMega328 and already configured the network so that they can communicate. Unfortunately it did not work since I had that power problem. I would be very grateful if you would help me.

DiagramaBloquesSensor.PNG
 

Thread Starter

IgnacioMorac

Joined May 30, 2021
39
ComponentPower Consumption
ATMega32881,8mW
Xbee TX148mW
Xbee RX102,3mW
RTC11.5mW
MicroSD Moduleworks with 5V but i cant found the datasheet to see it the power consumtion.
 

Irving

Joined Jan 30, 2016
2,322
This is really 'homework help' so I'm happy to guide and help you think it through but I won't give you the answers. When you say 'graduation' project at what level is that? High School, college, or?

My idea is to measure the voltage of the photovoltaic panel.
So I thought about making a simple sensor, that can measure the voltage of the panel and that at the same time this sensor is fed by the voltage of the cell to work.
OK, that's fine. Is the cell powering anything else? What is the benefit of your 'sensor'.

What do you estimate the average and maximum power consumption will be, and what is that in terms of mA at 5v? What is the power output of your PV cell? What can you say about the output voltage/current/power of a PV cell.

So, you've already built the ATMega/RTC/XBee/SD-card functionality? Have you powered that from a 5v supply (a USB adapter or a Power-bank) and verified it all works, and checked the power consumption? Its a good idea to get a USB tester like the one shown below and power your circuit through it - this will give you power supply data including Watt-hours so you can see how much energy is consumed on average over time.

1623514230318.png
What happens when the PV cell can't generate enough power? Have you considered what happens in your software when the power drops out? How do you maintain time during power outages?

The first stage is an over-voltage protection circuit, which I thought about using a Power Zener, made up of a zener and a transformer, but it didn't work for me, so I think I'm going to discard it.
What do you mean by a transformer? What do you know about transformers and why did you think one was appropriate here? How did you test it? Where do you think the over-voltage condition will come from? Can you give examples?

The second circuit of the second stage is the circuit that reduces the voltage to a measurable range by the ADC of the microcontroller, this would be a range from 0 to reference voltage, in this almost a voltage of 5 volts.
This is good, and you previously showed a voltage divider with 2 resistors. What is your expected maximum input voltage from the PV cell? What does that translate to at the ADC input? What is the ADC reference voltage and where is it derived from?

This is a very 'do-able' project, but for a good result you need to understand and be able to explain what the issue is, why it is important, how your solution solves the problem and what alternatives you considered (and why you rejected them).
 

Thread Starter

IgnacioMorac

Joined May 30, 2021
39
When you say 'graduation' project at what level is that? High School, college, or?
College Sir.

OK, that's fine. Is the cell powering anything else? What is the benefit of your 'sensor'.
The benefit of my sensor is that if I make a system with several sensors that provide me with the voltage value, I can make calculations, mostly comparisons, in which I can determine if a panel is failing according to its value. voltage compared to average.

Is the cell powering anything else?
The solar cells will be used in a solar farm to feed the solar panel laboratory that is responsible for the study of this energy. My project is focused on monitoring these panels. But this is a prototype so it is like the basis for other future students to improve the sensor.


hat do you estimate the average and maximum power consumption will be, and what is that in terms of mA at 5v?
I have estimated the overall consumption of the sensor to be 343.6 mW. Taking the quantum the power that the XBee consumes sending and receiving. What I could not take into account is the consumption of the Catalex microSD Module since the data sheet of this module does not exist, I have found several pages but the only thing I find is the same, that it works at 5V and that in the module it has a voltage regulator that regulates at 3.3V.

What is the power output of your PV cell?
In terms of power of the photovoltaic panel, I know that the panel generates a maximum of 18 volts in open circuit.

What can you say about the output voltage/current/power of a PV cell.
Regarding current and power, I owe you that. Since I do not have the data sheet of the photovoltaic cell, but it does generate enough to power my device.

So, you've already built the ATMega/RTC/XBee/SD-card functionality?
Yes of course. The funny thing about this, was that the first test I did was to connect the Xbee to the arduino uno R3 and everything was fine. But when you connect the RTC or the module for the microSD. The power fell apart, that's understandable. What I did was feed the RTC DS1307 and MicrSD modules of catalex with the arduino Mega and on the other hand feed the XBee with the arduino UNO. Only power, because what are the SDA and SCL connections of the RTC and SCK, MISO, MOSI of the MicroSD Module are connected to the Aruino R3. I managed to do the programming that joined these 3 modules with the ATMega328 and I was able to successfully send the data frame I expected. In order to test the ADC, what I did was connect the 3.3V output of the ArduinoMega to the microcontroller ADC.

I want to clarify that due to the pandemic conditions that are experienced in Costa Rica, it has been impossible for me to make many trips to the laboratory. Therefore I have done everything from my home and the tests have been very homemade. I have no source or anything.

Have you powered that from a 5v supply (a USB adapter or a Power-bank) and verified it all works, and checked the power consumption?
I have never seen that here in Costa Rica.

What happens when the PV cell can't generate enough power? Have you considered what happens in your software when the power drops out? How do you maintain time during power outages?
If I have taken that into account. The software is designed to restart again when there is insufficient power to shut down. And it works again once there is energy. The idea is that it only sends data when it is necessary, in its peak solar hours when the power generation is considerable and it is important to measure to determine any failure.

What do you mean by a transformer? What do you know about transformers and why did you think one was appropriate here? How did you test it? Where do you think the over-voltage condition will come from? Can you give examples?
Excuse me here. I meant transistor. I thought of a surge protection stage, thinking that voltage spikes could occur, mostly out of precaution and care of the circuit components. I also thought about protection before polarization but it is not very common in these systems.

This is good, and you previously showed a voltage divider with 2 resistors. What is your expected maximum input voltage from the PV cell? What does that translate to at the ADC input? What is the ADC reference voltage and where is it derived from?
The maximum voltage expected for the photovoltaic cell is 18 volts.
The idea is that this voltage will translate to 5 volts maximum. We know that the voltage range that the ATMega328 microcontroller ADC accepts is 0 to 5Volts. My reference voltage will be the same voltage that will power the microcontroller. This voltage will be the same regardless of the voltage of the solar panel, obviously there are limits and if the panel voltage is 5 V it will never power the microcontroller.

In the programming I enter a formula, the equation of the line, this will determine the real value of the panel according to the input value in the ADC, so if I receive 5V at the input of the ADC, the algorithm will give me 18 Volts and if it goes down to 2.5V the algorithm will know that it is 9volts.


This is a very 'do-able' project, but for a good result you need to understand and be able to explain what the issue is, why it is important, how your solution solves the problem and what alternatives you considered (and why you rejected them).
Thank yout Sir. It has actually been very frustrating these last few days. Doing research for months, simulating the stages where he saw the results he wanted, also testing with the arduinos and obtaining interesting results. Arriving this week at the laboratory (the measures against the covid decreased their intensity these days) and mounting everything on a PCB that I designed and that will not work was a headache and an incredible frustration.
 

Irving

Joined Jan 30, 2016
2,322
The benefit of my sensor is that if I make a system with several sensors that provide me with the voltage value, I can make calculations, mostly comparisons, in which I can determine if a panel is failing according to its value. voltage compared to average.

The solar cells will be used in a solar farm to feed the solar panel laboratory that is responsible for the study of this energy. My project is focused on monitoring these panels. But this is a prototype so it is like the basis for other future students to improve the sensor.
Do you plan to replicate all of this circuit for each panel or just have one checking the voltage of multiple PV cells? How are the multiple cells configured/connected in the farm? Can you foresee any problems this might bring?

I have estimated the overall consumption of the sensor to be 343.6 mW. Taking the quantum the power that the XBee consumes sending and receiving. What I could not take into account is the consumption of the Catalex microSD Module since the data sheet of this module does not exist, I have found several pages but the only thing I find is the same, that it works at 5V and that in the module it has a voltage regulator that regulates at 3.3V.
Does the XBee transmit and receive simultaneously or is it 1/2 duplex transmission? How might that affect your estimate?

The CatalexuSD module is just a 3.3v regulator and a buffer to the SD card. See the schematic and other useful info here. Now can you make an estimate?

Yes of course. The funny thing about this, was that the first test I did was to connect the Xbee to the arduino uno R3 and everything was fine. But when you connect the RTC or the module for the microSD. The power fell apart, that's understandable.
Is it? Why do you think that? From your estimate above how much current do you need at 5v? Where were you getting the 5v from? The R3 USB connection? How much current is available at a USB port?

What I did was feed the RTC DS1307 and MicrSD modules of catalex with the arduino Mega and on the other hand feed the XBee with the arduino UNO. Only power, because what are the SDA and SCL connections of the RTC and SCK, MISO, MOSI of the MicroSD Module are connected to the Aruino R3. I managed to do the programming that joined these 3 modules with the ATMega328 and I was able to successfully send the data frame I expected. In order to test the ADC, what I did was connect the 3.3V output of the ArduinoMega to the microcontroller ADC.
Ok, slightly confused here. How about a schematic of your test setup?

Going to eat now, I'll respond to the rest in another post....
 

Thread Starter

IgnacioMorac

Joined May 30, 2021
39
Do you plan to replicate all of this circuit for each panel or just have one checking the voltage of multiple PV cells? How are the multiple cells configured/connected in the farm? Can you foresee any problems this might bring?
If I plan to replicate the sensor on other honeycombs.
Since the complete system needs to take into account the voltage of several panels to make comparisons and determine which voltage is the lowest and with this determine which panel has the fault.
How are the multiple cells configured/connected in the farm?
Serially

Can you foresee any problems this might bring?
Yes.
Yes, in fact, in a series arrangement the sum of the voltages can affect when measuring the voltage of a solar panel. If we have a 10 panel arrangement that generates 100 volts because each panel generates 10 volts, for example.
When measuring the voltage of a single panel, the voltage of the system can affect the measurement, it is a matter of referencing the grounds. I feel that if I know that problem, however, I do not know how to attack it. If I create a specific land for each panel but I don't know, I think it is not feasible.

I have also thought of creating the sensor only for systems that work with few panels or systems that use a panel or panels that are not in arrangements, only that they are alone.
Does the XBee transmit and receive simultaneously or is it 1/2 duplex transmission? How might that affect your estimate?
Good question, the ATMega programming is designed to receive a message from the computer. This message will be the one that will start to start sending the data. From there, it will only be the Xbee sending data.

See the schematic and other useful info here. Now can you make an estimate?
Thanks, Even on that page they indicate that there is no datasheet haha yes thank you very much, and what is the schematic, programming and system schematics I have it. If I know that with the arduino it connects to 5 V but the system has a built-in regulator to write the data at 3.3V.

Is it? Why do you think that? From your estimate above how much current do you need at 5v? Where were you getting the 5v from? The R3 USB connection? How much current is available at a USB port?
Well what I did was the following:
First I wanted to see how to send messages from arduino through Xbee to the computer. Connect the Arduino to the usb of the computer and connect the Xbee to the arduino (feed it with the 5 volt pin, connect the ground pin and RX and TX), there everything is fine. I did frame submission tests and it went well.

The next thing I did was send the RTC time and date through XBee. When you connect the RTC to the same arduino and feed this module with the same 5 volts from the XBee, and the power is low. I could tell because the Xbee's LED stopped glowing brightly.

Estimate the current needed by the modules and generate this table.
ModuleCurrent
ATMega32816,34mA
Xbee TX45mA
XBee RX31mA
RTC DS13072.3mA
MicroSD ModuleNo datasheet


How much current is available at a USB port
Most computer USB ports supply 5V of electricity with a maximum current of 0.5A.

Ok, slightly confused here. How about a schematic of your test setup?

Going to eat now, I'll respond to the rest in another post....
Dont worry me too, but Im Back.

This is the diagram
1623529957525.png
 

Irving

Joined Jan 30, 2016
2,322
Can you clarify something... you have 2 boards, an Arduino Uno R3 and an Arduino Mega 2560? But you plan to use an Atmel ATMega328 chip (as used in the Uno) in your final version - did I understand that correctly?

With regard to the SD Card interface, the details I'll agree are not obvious. You have to realise that the interface is just that, an interface. The power consumption is driven by the SD Card itself and that info can be found buried deep in the SD Card specification. In short, for 'normal' signalling on a standard/default SD Card (<= 12.5Mbit/sec) its spec'd at 0.36W maximum, so approx 110mA worst case on 3.3v, though most SD Cards won't take that much. Those currents are primarily due to switching losses while reading/writing, the static and average currents will be much lower.

Even so, the total current draw of the XBee, RTC and SDCard is less than 200mA, which is way lower than the 500mA available from a USB port. Even allowing for the Uno R3's own consumption it should have worked OK, unless something was wired incorrectly. I would like to see some actual measurements of current consumption for the individual components - do you not have a multimeter?

Turning to the question I asked about the PV farm configuration, you replied:
Yes, in fact, in a series arrangement the sum of the voltages can affect when measuring the voltage of a solar panel. If we have a 10 panel arrangement that generates 100 volts because each panel generates 10 volts, for example.
When measuring the voltage of a single panel, the voltage of the system can affect the measurement, it is a matter of referencing the grounds. I feel that if I know that problem, however, I do not know how to attack it. If I create a specific land for each panel but I don't know, I think it is not feasible.

I have also thought of creating the sensor only for systems that work with few panels or systems that use a panel or panels that are not in arrangements, only that they are alone.
1623582236704.pngSo you correctly identified the issue of ground referencing - it may help to draw it - here's a simplified version using 5 batteries....

Apart from the obvious solution of a sensor for each PV cell, can you identify how to measure an individual cell voltage?

This is a common problem in these sorts of systems. Its similar to measuring individual battery cells in a high voltage stack in, for example, an electric vehicle. As an example, my wife's i-Pace has 105 3.7v Li-ion cells in series giving 388v, yet each is independently measurable.

There are many solutions to this. I suggest you do some reading around that subject.
 

Thread Starter

IgnacioMorac

Joined May 30, 2021
39
Can you clarify something... you have 2 boards, an Arduino Uno R3 and an Arduino Mega 2560? But you plan to use an Atmel ATMega328 chip (as used in the Uno) in your final version - did I understand that correctly?
If correct, I am only using the arduino Mega to power the RTC and MicroSD module.
All the programming is focused to be executed in an ATMega328, which is the micro of the Arduino UNO.
unless something was wired incorrectly.
You are right, all this mess of using two plates was due to a bad connection, he just confirmed and there is no problem, all three are connected and the XBee has its led on.
Who knows what happened, I remember very well this working with the XBee and when I connected the RTC, the xbee stopped having the led on, and that was why I started to power the RTC and the micro SD interface with the other board .

Well, this can be seen as a small advance.

do you not have a multimeter?
No I dont have it with me.

you identify how to measure an individual cell voltage?
I read that the Manufacturers rate their photovoltaic panels based on the DC output power at an irradiance of 1000 W/m2 (full sun) and a panel temperature of 25oC in order to get you to buy their product. This is the STC conditions and we can found in the datasheet of each panel.

A standard 12-volt PV panel will generate a maximum terminal voltage of about 20 volts in full sunlight with no connected load. However in the real world, photovoltaic solar panels operate below these ideal settings resulting in an output power much less than the PV panels possible maximum output power rating. So I think I can measure the voltage simple, like conect an multimeter in the terminals of the solar panel.

1623596653021.png
 

Thread Starter

IgnacioMorac

Joined May 30, 2021
39
So you correctly identified the issue of ground referencing - it may help to draw it - here's a simplified version using 5 batteries....

Apart from the obvious solution of a sensor for each PV cell, can you identify how to measure an individual cell voltage?

This is a common problem in these sorts of systems. Its similar to measuring individual battery cells in a high voltage stack in, for example, an electric vehicle. As an example, my wife's i-Pace has 105 3.7v Li-ion cells in series giving 388v, yet each is independently measurable.

There are many solutions to this. I suggest you do some reading around that subject.
Hello Irving I already have the solution for this very interesting problem. The work is in Spanish but I can summarize it here, basically this work consists of the simulation and implementation to test a circuit that despite being in an array, can obtain the measurement of a solar panel and reduce it to a range in the one that can be read by an ADC. This circuit attacks the land problem and is totally focused on eliminating this problem.

I must focus on obtaining a voltage from this circuit, in order to have a constant 5 volt output and with this feed the proposed sensor.
 

Irving

Joined Jan 30, 2016
2,322
I read that the Manufacturers rate their photovoltaic panels based on the DC output power at an irradiance of 1000 W/m2 (full sun) and a panel temperature of 25oC in order to get you to buy their product. This is the STC conditions and we can found in the datasheet of each panel.
1000W/m^2 and 25degC are standard test values so you can compare products. Direct sun at sea level is about 1050 W/m2, and global radiation on a horizontal surface (averaged across all ground levels) is about 1120 W/m (according to Wikipedia)

A standard 12-volt PV panel will generate a maximum terminal voltage of about 20 volts in full sunlight with no connected load. However in the real world, photovoltaic solar panels operate below these ideal settings resulting in an output power much less than the PV panels possible maximum output power rating. So I think I can measure the voltage simple, like conect an multimeter in the terminals of the solar panel.
Not quite. If you look at the IV curve of a PV panel it has an O/C voltage as you said, and a S/C current. At both O/C and S/C points the power output is 0W. Here are the IV curves for one of my Panasonic 285W panels. If you plot power output, ie V * I you'll find it peaks at approximately V=31.2v and I=8.98A, or about 280W, this is known as the Maximum Power Point (MPP) and itt varies with level of irradiation and cell temperature. The inverter the panel(s) are connected to adjusts the load to maximise the power drawn - so operating on the edge of the curve is very close to its rated output. Of course, each panel varies slightly and they change over time as well. The technique for extracting the maximum possible power from a PV cell is known as MPP Tracking (MPPT).
1623603518649.jpeg
So, coming back to my previous question, how can you measure the voltage at each cell when they are all in series? And I didn't mean with a multimeter! Looking at the stack of cells from before what information do you have that allows you to work out a given cell voltage?



Hello Irving I already have the solution for this very interesting problem. The work is in Spanish but I can summarize it here, basically this work consists of the simulation and implementation to test a circuit that despite being in an array, can obtain the measurement of a solar panel and reduce it to a range in the one that can be read by an ADC. This circuit attacks the land problem and is totally focused on eliminating this problem.
Is this your solution, or something you found elsewhere. Do you understand how it works and what its limitations are? Why don't you post the circuit and describe how you think it works...
 
Top