HOME Technical Tips  

OLED AC CURRENT METER

OLED display, 128x64, 0.96", SSD1306, I2C with PIC12F675. OLED is driven by software (bit banging) I2C. Code includes functions for reading the sensor. Moving the decimal point can be done in software only.
R is calculated for 5V drop at max AC current, R = 5 / I secondary. Trim 10K pot to desired reading. The voltage drop on the diodes doesn't cause an error because the transformer is a current source.

You are free to use the circuit diagram and the software with no limitations.

current current

Circuit Description
See also Technical Tips

Current transformer is normally 5 Amp primary to 10 mA secondary, in that case R is 500 ohm metal film resistor.
10K pot is to trim the PIC input to about 5V peak when the Aac is max.
Caps are for smoothing the rectified current.
470R are for reducing 5V to 3.3V input of the SSD1306.

ANALOGUE SIGNAL TO PC VIA USB

Project for connecting analogue signal to PC without a need for microcontroller. Included Visual Basic VB6 software and app, VS2010 code and circuit diagram. The MCP3201 is a micro-power 12 bit analogue to digital converter. The conversion selector reads eigther 10 or 12 bits. With less resolution the reading is more stable. The 5V supply to the circuit is from the USB.
The communication to the PC is bit banging the Hardware Controls, the DTR is used for clocking the ADC, RTS as CS and the CTS is used for data input.

Datasheet for the MCP3201 can be downloaded from here
The USB to Serial I used is: https://www.ebay.co.uk/itm/CP2102-USB-2-0-to-TTL-UART-Module-6Pin-Serial-Converter-STC-Replace-FT232-Module/381374541932?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2060353.m2749.l2649
There are other similar modules, make sure they have all the connections needed. RTS and CTS need to be soldered, they come with only holes in the module's PCB.

usb3201  usb3201  

INPUTS OUTPUTS TO PC WITHOUT MICROCONTROLLER

Using USB to serial module drive 2 outputs that can be LEDs or relays. Also read 2 digital inputs from a switch or a DC source. The app uses the Hardware Controls of the USB to Serial module; inputs CTS, DSR and outputs DTR, RTS. Outputs and inputs are 3.3V , to sense voltage over 3.3V it's needed to add a series resistor to the module input.
The app is in VB6 that can be downloaded below and VS2010 code can be downloaded from GitHub https://github.com/projects22/Digital-Inputs-Outputs-to-PC . In the app enter the Com Port that the USB to Serial modules opens. 2 LED images show the state of the 2 inputs and 2 tickboxes operate the 2 outputs.
The USB to Serial I used is: https://www.ebay.co.uk/itm/CP2102-USB-2-0-to-TTL-UART-Module-6Pin-Serial-Converter-STC-Replace-FT232-Module/381374541932?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2060353.m2749.l2649
There are other similar modules, make sure they have all the connections needed. RTS and CTS need to be soldered, they come with only holes in the module's PCB.

You are free to use the circuit diagram and the VB software with no limitations.

 

SOLAR 6-12 VOLT BATTERY CHARGER

The circuit is a high efficiency charger, it is useful for charging 6 to 12V batteries using small number of solar cells. The solar cells can be connected in series or parallel to generate 1 to 12V , cells voltage has to be lower than battery voltage. When the mosfet is on it charges the coil with energy from the solar cells, and when the mosfet is off that energy is discharged into the battery.

Circuit Description
See also Technical Tips

The 6 inverters CMOS are used as a free running oscillator.
The MOSFET charges the coil when it's on, and when it's off the coil dumps its charge via the diode into the battery.
BS170 can be replaced by equivalent MOSFET. The MOSFET and the diode are capable of charge currents up to 50mA, for higher currents they can be replaced by higher current components.



Name:

Comments and questions

Copy the number from the picture It stops net-robots from adding comments.



23.05.2022 - 09:24
Name: Moty
Comment: Hi Djalltra, The 10 bit ADC reads 0-1023 * by 5 = 5115. To get readings of 5000 use the trimmer. The PIC12F675 doesn't have enough RAM to calculate a float number so we use only integers.

22.05.2022 - 12:49
Name: djalltra
Comment: hello moty please i want to ask in this line of the code count=((ADRESH << 8) + ADRESL)*5 where the 5 comes from

05.05.2022 - 12:56
Name: Moty
Comment: Hi Djalltra, You can find the formula to calculate R in the project description above. R=5/secondary current, 208 ohm.

04.05.2022 - 16:21
Name: Djalltra
Comment: Hi moty thanks I'm going to be using your approach I also have another CT with 60A/24mA how do I calculate the resistor for this thanks

03.05.2022 - 12:24
Name: Moty
Comment: Hi Djalltra, Your circuit looks at the AC and my circuit convert it to DC before the MCU input. There are many ways to read CT by MCU, I chose my circuit because I tested it and it works.

03.05.2022 - 07:28
Name: Djalltra
Comment: Link https://drive.google.com/file/d/11QUGYRtQ_-KimtFILa-bxtL0rYy9-dtQ/view?usp=sharing

03.05.2022 - 07:27
Name: Djalltra
Comment: Hi moty thanks for the response please have a lookbat this link https://drive.google.com/file/d/11QUGYRtQ_-KimtFILa-bxtL0rYy9-dtQ/view?usp=sharing it is an inverter using a current transformer but as you can see the way it's connected is quite different from yours the also used two equal resistors to create an offset of 2.5v please am still yet to understand how to use the configuration any help would be appreciated.

01.05.2022 - 19:40
Name: Moty
Comment: Hi Djalltra, For your CT you need burden resistor of 100 ohm. It will give 5V at 50A. To read 50.00 instead of 5.000 swap the x value of the decimal point with x value of the second digit.

01.05.2022 - 18:05
Name: Djalltra
Comment: Hi moty how did you calculate the value of your burden resistor and can this method be implemented for any current transformer for instance I have a CT of 50A/50mA and I want to be able to read the AC current from my appliances

15.01.2020 - 22:30
Name: rc555n
Comment: Thanks

21.11.2017 - 12:59
Name: Suresh
Comment: I need some details about 30 watt solar panel and which type of batteries can choose for solar panel. My mail id is gopavarapuvenkatasuresh@gmail.com

17.02.2016 - 11:25
Name: Moty
Comment: Hi Seed. There are many discussions on this subject in this forum, you'll be able to get help there. http://www.edaboard.com/forum.php

16.02.2016 - 16:12
Name: seed
Comment: I need soalr 12V 5W to 220V

20.11.2015 - 22:17
Name: David
Comment: interesting projects I love electronics

05.07.2015 - 23:25
Name: SHOHIDUL
Comment: GOOD

31.12.2012 - 19:54
Name: Moty
Comment: Hi Helal, For 12V battery charged at 20 mA you can use the circuit in the project with no changes.

31.12.2012 - 12:41
Name: helal
Comment: ineed 20 am 12v SOLAR BATTERY CHARGER

Name: Nick Mercury
Comment: What efficiency would you expect from this circuit? I need a 3.3 to 3.6V battery voltage (which chemical type battery would work best). I've sourced some cheap 3.6V 0.2W cells from ebay. I want to run a trial for a few months to see how it goes. Thanks Nick

Name: Moty
Comment: Hi Nick The efficiency of the charger is about 90% when the charge current is 50mA. You can use either NiCad or NiMH cells. You will find that solar cells give the full output on a bright sunny day and on cloudy day the output drops to about 5%. The efficiency of converting sun energy to electrical energy by solar cells is about 0.1%. The cmos 4049B will work at supply voltage of 3.3v but you will need to replace the mosfet with one that has a lower threshold gate voltage, i.e. RFD14N05 Hope you get the results you want.

Name: Santhosh
Comment: Hi I have a 2V 80mA solar cell and I need to charge a 7.2V 1200mAH Ni-Mh battery pack.Do I need to make any changes to this circuit.

Name: Moty
Comment: Hi Santhosh, You don't need to make any changes to this circuit for your application. When the cells source 80mA the charge current will be about 20mA.

Name: SANTHOSH
Comment: Can I use 220uH inductor instead of 100uH

Name: SANTHOSH
Comment: Can I use 220uH inductor instead of 100uH

Name: SANTHOSH
Comment: Can I use 220uH inductor instead of 100uH

Name: Moty
Comment: Hi Santosh, You can either put 2 coils of 220 in parallel to get 110uH, or change the 100K resistor to 220K to adopt the frequency to the coil.


iconFlag Countermoty22.co.uk  2008-2022