Page 2 of 2
Re: LEM LTSR 15-NP and more
Posted: Sat Aug 28, 2021 10:16 pm
by medelec35
Nps.
Component is finished, but I just need to get the key, so it can be added to a component pack..
Might not be until Tuesday, as its bank holiday Monday in the UK.
Re: LEM LTSR 15-NP and more
Posted: Sun Aug 29, 2021 7:06 am
by jgu1
Wow, Martin. I Will order one now.
Jorgen
Re: LEM LTSR 15-NP and more
Posted: Sun Aug 29, 2021 6:15 pm
by Frank607
Hi viktor_au and Martin,
I will test the file from Viktor tomorrow Dutch time. @Martin, wow nice work, let me know when it is ready for V.8
Frank
Re: LEM LTSR 15-NP and more
Posted: Mon Aug 30, 2021 8:15 am
by Frank607
Hi viktor_au,
I have tested your file Test_An0.fcfx.
When I power the board the LED on C4 goes immediately on. I have not connected the LAB Power supply to An0. (RA0)
The power on the chip is 5.01V.
Even when I connect the LAB Power supply to An0 and play with the voltage from 3.0 to 5.1V the LED stays on.
The LED blink test file is still working. The resistor to the GND pin of the LED is 3.3K.
Frank
Re: LEM LTSR 15-NP and more
Posted: Mon Aug 30, 2021 10:42 pm
by viktor_au
I am not sure Frank.
I would check the ground connection between your power supply and the board with pic.
I would check PIC MC analog input settings. Is it input by default? Is it not?
Check this post:
ADC ground ref setting ->
viewtopic.php?t=22383
----------
I have changed the input from an0 to an2.
Test it with the attached file.
------------
Use potentiometer instead of power supply.
---------
I cannot help you more as I don't use PIC.
Please check your MC settings. Read datasheet. Check in FC8: Build->Project options->Configure.
-------------
All the best.
Re: LEM LTSR 15-NP and more
Posted: Mon Aug 30, 2021 11:31 pm
by medelec35
Frank607 wrote: ↑Mon Aug 30, 2021 8:15 am
Even when I connect the LAB Power supply to An0 and play with the voltage from 3.0 to 5.1V the LED stays on.
That depends on the current you want the LED to stay on at.
3V = 12A though the LTS/LTSR 15
2.8V = 7.5A
Re: LEM LTSR 15-NP and more
Posted: Tue Aug 31, 2021 9:58 am
by medelec35
Hi Frank,
I have attached a component for you to try.
One way of adding the component is:
1. Create a new folder for component files.
2. Place the component in the new component folder.
3. Open Flowcode & select View Global Options.
4. Select Locations and the ... icon in the Look for components in.
5. Browse to the new components folder and choose the .fcpx file.
6. Close and reopen Flowcode (or use the reload option) & the new component should be present.
You can use the search option to find the component.
The component relies on the supply voltage to the microcontroller being as near to 5.00V as possible.
You must always set the VDD within the component properties to voltage going to the VDD of the microcontroller.
If the voltage set within properties is out, then the current reading will be out.
This is because the LTSR generates a precision voltage, e.g 2.50 when there is no current flowing.
If VDD to the microcontroller is 4.87V then the ADC will read 2.567V
Therefore instead of no current flowing, the current reading will be 1.44amps.
The voltage you need to enter for VDD will correct this.
Note: I have kept the component free, so you don't need to have purchased any component packs to be able to use it.
Edit:
I have removed the component as it is now on the update system.

Re: LEM LTSR 15-NP and more
Posted: Tue Aug 31, 2021 5:45 pm
by Frank607
viktor_au wrote: ↑Mon Aug 30, 2021 10:42 pm
I am not sure Frank. ...
Hi viktor_au,
Thanks for your latest file but I have the same result. The LED goes immediately on when I power the PIC16F1788. I really don’t know why.
I have read the topic link in your latest post but this is going too far for me.
(Anecdote)
In my earlier years I was a Novell specialist. I had all Novell certifications of Novell Netware with NDS, ZenWorks, IDM and Groupwise. I was working on a high school but even companies and municipalities where calling me if I could help them with a Novell problem. I dive in every problem but also a few times I needed the help of Novell Support in Ireland. Now in these days Microsoft is the networking system what almost all people use.
I hope that you understand that (I was thinking) that this LTSR issue was easy to program.
I really appreciate your input on this LTSR issue. Thanks again.
Frank
Re: LEM LTSR 15-NP and more
Posted: Tue Aug 31, 2021 5:58 pm
by Frank607
Hi Martin,
Wow, nice work

. I have tried to make a flowchart according to your screen picture what you have posted earlier. But It does not work.
Can you post an .fcfx file to show how this component works in a flowchart including a LED ?
Btw, I have the Sensors pack but it nice to see that you could this component for free for other FlowCode users.
Frank
Re: LEM LTSR 15-NP and more
Posted: Tue Aug 31, 2021 6:15 pm
by medelec35
Hi, Frank.
Thanks.
If you post the flowchart you tried with then I will check it over for you.
If you inject a DC signal just remember that the sensitivity of the lts/ltsr 15np is 41.6mV/A
So you will either need a PSU with a course + fine adjustment or a 10 turn pot.
The voltage injected to the ADC for 0 to 7.5A = 2.50V to 2.81V so the full voltage range for 0 to 7.5A is only 312mV.
What is the precise voltage across your microcontroller supply pins?
Re: LEM LTSR 15-NP and more
Posted: Thu Sep 02, 2021 3:37 pm
by Frank607
Hi Martin,
Attached you will find the .fcfx file.
I can’t find under the LCD16x2 the “PrintFloat” function. Do I have to create this ?
PrintFloat(ResultFloat,2)
Re: LEM LTSR 15-NP and more
Posted: Thu Sep 02, 2021 6:33 pm
by medelec35
Hi Frank, try the attached flowchart.
Frank607 wrote: ↑Thu Sep 02, 2021 3:37 pm
I can’t find under the LCD16x2 the “PrintFloat” function. Do I have to create this ?
No, that is what I created for V9 LCD's
It enables you to directly display float values on LCD's without the need of adding and converting to string.
Re: LEM LTSR 15-NP and more
Posted: Mon Sep 06, 2021 4:09 pm
by Frank607
Hi Martin,
Thanks. I have tested your .fcfx file. It looks good in hardware!

The LED goes randomly on at a voltage between 3.5 and 5.1V.
But I see that my old LAB Power Supply is given some suddenly voltage “spikes” I have connect a SDM3055 Digital Multimeter to the An0 wire.
When I turn the voltage up I see some suddenly fast spikes of voltage. Not visible on the LAB Power supply.
So this LAB Power Supply is broken. I have ordered a new one and it will arrive tomorrow.
Frank
Re: LEM LTSR 15-NP and more
Posted: Tue Sep 07, 2021 2:42 pm
by Frank607
Hi Martin,
I have received my new LAB Power Supply with two channels and I have tried your fcfx file.
The MCU voltage is 5.01V in this test.
- If I play with the voltage on An0 from 2.5V to 5.1V nothing happens with the LED.
- If I set the voltage from 3.5V to 4.9V and wait, the LED goes On after 34 seconds.
- If I set the voltage from 3.5V to 5.1V the LED goes On after 15 seconds.
- If I set the voltage from 3.5V to 4.5V the LED goes On after some 2 minutes.
After every test when I set the voltage back to 3.5V It takes a long time when the LED goes off >1 minute
Every test I have done after I toggle the power on the MCU. So a clean start.
It seems to me that something is very slow.
Re: LEM LTSR 15-NP and more
Posted: Tue Sep 07, 2021 3:23 pm
by medelec35
Hi Frank,
Sounds like you need to check the configuration settings match your hardware?
Have you tried the
one second flash test?
Re: LEM LTSR 15-NP and more
Posted: Tue Sep 07, 2021 4:14 pm
by Frank607
Hi Martin,
You are right, I have not done this in this chip on the breadboard. I will do that tomorrow.
Re: LEM LTSR 15-NP and more
Posted: Thu Sep 09, 2021 11:13 am
by Frank607
Hi Martin,
I have set the correct OSCCON value to run at 16MHz. I have tested this with a scoop and the LED flashes every second.
Then I have tested your file with the correct OSCCON values. It reacts now much faster but it is unstable.
The LED goes randomly on between a voltage from 3.2 to 5.0V. And sometimes the LED is even not going on. I have also changed to An1 to see if this makes a different.
Maybe it has something to do with the properties of the LTSR component, but that I don’t know.
Re: LEM LTSR 15-NP and more
Posted: Thu Sep 09, 2021 3:15 pm
by medelec35
Hi, Frank.
The component is only as good as the ADC.
Try adding an ADC ReadAsVoltage component and send the value to line one 1 of the LCD.
There could be an issue with ADC or the source you are measuring.
The LTSR has also been tested by V9 forum member.
Results are
here.
Re: LEM LTSR 15-NP and more
Posted: Wed Sep 15, 2021 4:37 pm
by Frank607
Attached there is a video where you can see how this LTSR-15_Test-03.fcfx works in my hardware.
The LED is in the very upper right corner of this video.
https://youtu.be/qJzmZnVjQ-8
If I get this to work then there is a another problem. The original PCB is from 2005 ? and there is a TL082CP between the output from the LTSR-15 and the PIC. Original there was a PIC16F876A ?? on board. The text on this PIC is almost gone
I have redrawn this damaged PCB as it was. So, also with all the components. It works great but the last thing is the LTSR-15 for safe use.
Attached there is a part of the schematic as it is.
MC_TL082 is a connection to the PIC.

- 2021-09-15_16-04-35.jpg (31.7 KiB) Viewed 27535 times
Re: LEM LTSR 15-NP and more
Posted: Mon Sep 20, 2021 3:56 pm
by Frank607
Hi Martin,
I have taken your code from the LTRS 15 into my code. Now the total code is running very slow on hardware. I have disabled the decision “ResultFloat > 7.49” and it makes no difference.
So, the slow running comes from the Component Macro “ResultFloat… “ and the Calculation icon “CurrentString…”
Is there something I can chance to let it run is faster ?
Btw, I have removed the TL082CP and put there a solder wire between the two pins.
Frank
Re: LEM LTSR 15-NP and more
Posted: Mon Sep 20, 2021 7:05 pm
by medelec35
Hi Frank, there was a mismatch between clock settings and OSCCON value.
What about trying at 32MHz?
You might be best doing a flash test first as if clock speed is set to 32MHz, but hardware is running much slower, then it hardware will be unbearably slow.
Re: LEM LTSR 15-NP and more
Posted: Tue Sep 21, 2021 2:48 pm
by Frank607
Hi Martin,
Many thanks for this 32MHz and 4x PLL idea. Indeed the buttons are reacting much more faster.
There is only one last problem what I have in this code. That is about the manual switch.
The Manual Operation Switch must be a Manual Operation Switch. This switch is a momentary toggle switch with three positions. It goes automatic to the middle position when you not touch it.
1 Left (Down)
2 Middle (Nothing - GND)
3 Right (Up)
I have played in the section for this switches (Decision icon – If Manual_Operation_ …) I see why this is not working , because of what is above this decision icon. But I don’t know how to change this to let it to work as it should be.
I have now disabled this Decision Icon in this 07 version.
Frank
Re: LEM LTSR 15-NP and more
Posted: Thu Sep 23, 2021 4:36 pm
by Frank607
I have tried to add two toggle switches (standard one in FlowCode) but this also didn’t work for me. Is it possible that the FlowCode team can make a momentary toggle switch component as this:
SPDT (On)-Off-(On)
https://nl.farnell.com/2128040