I have a custom sensor that uses a 3.3V MCU to process the data.
I need to convert the pwm signal from the output pin (0-3.3V pwm signal) to 4-20ma signal so I can read it with a PLS.
I need the cheapest solution that I can make on a pcb either with discrete components or an IC.
I do not care for any other types of communications as I already have a modbus communication and rs485 and rs232 solution, but for this project I only have 4-20ma available and I need to have a dirty cheap way to add it to the pcb design.
Thanks for any reply to my conundrum, and as I need a quite a few of the sensors to be made, I need the cheapest viable solution as cheapscate as I am, penny pinching bastard and all that
Well the total buget should be under $5, the mcu and the opamps for the sensors with resistors and caps are around $4 now, so I have around $1 left, so I wold like the 4-20ma thing to be under the price of the mcu with its supporting components, but what I like is not reality in most cases....
I have chosen very cheap components from J L C P C B so I am not expecting gold standard performance. but if ypu have a $3 solution, then I will most probably accept it, as I have no Idea how such circuit is made... I am just a chemical and process engineer with a bachelor in computer science as an extra, not an electric engineer, it's just my hobby to make pcbs for my projects, my main goal is the sensors and the science behind those are what makes my heart tick faster... I want the things to be as simple and stupid as possible... It is a kind of sport to make things as basic and low cost as possible, my pH sensor amplifier is costing $0.4 in components and $1 for the pcb and is working beautifully
@J-M-L, any circuit for that ting possible to get from you? I am poorly equipt in my noggin to deal with the thousands of possible configurations that this answer is providing,
thanks for the reply though, it is appreciated , I do not know where to start with this one and my google fu is a bit off these days...
0-100% = 0-3.3v, using a small capacitor to smooth it a bit
I can use 20-100% duty for 4-20mA output, and use 0-20% to indicate error
then it is 0.66V - 3.3V range for normal operating and under 0.66V is some errors, that under 0.66V range = 0-0.66V I can divide further to indicate what error it is... then the output is 0-20mA but normal operating output is 4-20...
Yes squeese my english, I used the norwegian translation of the term, sorry
4-20 mA analouge, not any pulses, the logic controller must then read how many mA can pass through the circuit and display the the sensor result on the HMI
A PLC?
If it is a PLC, can you tell us what make/model?
If it is a PLC, you will need to know what the input impedance of the PLC is when it is in 4-20 mode.
This will then tell you at what output voltage you need to generate the 4-20mA signal.
Can you please tell us your electronics, programming, arduino, hardware experience?
PLS = PLC, sorry I used Norwegian translation term...
I am an chemical and process engineer and a programmer, started using an arduino when it first came out, to do some school project and then a continuous distill for a friend...
After school, I started to work for a company that makes equipment for aquaculture in Norway, I made the procedures for servicing and calibrating all the sensors used in the product lines and then proof reading the embedded code for the diverse equipment and approving the work made by the programmers that I had oversight of, then making design specifications for new products. By then the department started to have too few people to approve the eagle cad drawings, so I had to start to go through those for my projects as a first pass review, see if things were laid out as the datasheets said, pins not short circuited, reversed on the pcb or other such mistakes, so the senior engineer did not have to find too many errors and could make a comment about the layout and design choices, so I have been moving towards electrical engineering more and more for my hobby for the last 3 years, but I am more capable as a programmer and more of a "copy paste electrical engineer", but very capable at reading the datasheets if I know what parts I am to use, so I do use the chinese pcb manufaturers to make pcb's for me and I do a lot of soldering and baking smd parts on the pcb's in my spare time.
I currently work as an automation and system designer and doing a lot of embedded coding of esp32 for industrial purposes, mostly in visual studio code, but for the last project, I had to convert it to Arduino IDE so my coworker who is an electrical engineer and has a degree in robotics too, he has to take over the programming while I take vacation for a month or two later this summer, he is totally lost in VScode and the program as only a few thousands of lines and it was under 20 tabs in the Arduino IDE at last, had to merge some .h files with the .cpp to make .ino but mostly just copy the project to right folders, I am not super fast programmer, just average. For my latest home projects, my EV charger broke down 2 times and I got fed up with that, so I made my own to charge my car, I am making a sound mixer with motorized faders for my son this summer and am working on a capacitive spectrography sensor now and a pH, EC, chlorine... sensor suite for my ebb and flow hydropony system and my hot tub water quality and a dosing system to add nutrients to the plants and the chlorine to the hot tub...
Too many project ideas and too little time....
I posted my first draft of my EV charger here on the arduino forum and, my pH sensor amplifier is on the hackaday projects site. My latest revision of my car "charger" is written in micropython, so the code is not posted here, I liked the drag and drop files for the web server for an example and the fact that the code lives on the MCU ram, so it will not get lost while the thing is working, so access from any computer with Thonny or similar program and the files ar just a drag and drop from the usb, so when I do web server projects, then I like more to do them in circuitpython or micropython, I do most of the front end displaying and processing of the data from the mcu's with python and in some cases in java or javascript in worst cases because I can get quick and dirty results fast, but if I do need to get fancy, then I can make c++ application, but mostly I do not bother with that in my little projects, I am terrible with GUI design, I like the back end better....
You know when you buy a pressure transducer or similar an it said it is a 4-20mA...
Thew manufacturer of that sensor does not know the model of the equipment that it is supposed to work on...
This is my goal, just to make a lego brick that I can use in my future designs, that is cheap to make and easy to pop in my easyEDA design and get a pcb in 15 days with economy transport at $5 cost for 5
It would be nice to have a design here on the forum so anyone can make their own or use as a starting point for a cheap circuit to test a 4-20mA input device or something like that..
I have an old siemens PLC that I got from my last workplace as it was not usable in any products any more.
I did not read any impendance thingy in the datasheet, it is 24V as is the industry standard.
so 12-48V span is golden but 12-24V range will probably work fine, 36V if one is super careful and the PLC is just 24V
I am not asking for the translation of 4-20mA to voltage, but the other way, to limit the current to 4-20mA according to pwm of the mcu, simulating 0-3.3V with pulses, the pulses are smoothed out with a small cap to get more analouge values out from the mcu...
Yes ideally, you tell me what is possible, I just have the pipe dream
If you have a $10 design that you want to share, then I have at least a staring point