I am using a hall effect to determine the rotation of a magnet on a flywheel. The rotation is coming from a 220v 3 ph motor driven by a mains power variable speed drive (VSD). I am not getting the results that I am expecting i.e. the frequency that the Uno recording are 1000s times greater than that of the VSD and if I adjust the speed on the VSD the Uno results remains unchanged. I suspect this is a result of electrical interference from the VSD drive as it operates as expected when it is not running. I have changed cable between the VSD and motor from unshielded to shielded and this resolved one issue; the Ardunio does not crash when I now start the VSD. However I am still getting unreliable readings. The power cable screening is connected to the mains earth.
I have have placed the Uno in an externally shielded box with openings for cables. The inside of the box is plastic and the board or it contacts rest on this surface.
When the shielded box is unearthed the serial monitor results is in the 1000s above that of the VSD. If I hold the mains earth I see a reduction. This varies if I hold the earth and touch the shielded box with one hand where the difference is in 100s and if hold the earth in one hand and the shielded box in the other, the difference is in the 10s. If I hold the earth directly to the shielded box the Uno crashes.
Other points the Uno is connected to the PC via a USB to utilise the serial monitor. I have created a home made twisted pair (Signal and earth) to connect the hall effect sensor to the Uno with the supply running next to it. Although I am not sure this is doing anything.
Any thoughts on this? I was wondering if I connected the Uno ground directly to the mains earth but I'm not sure it will work and I could damage the PC if I tried.
VSDs can be brutal. Not only are they likely to radiate crap if not perfectly installed, they're prone to pushing crap back down the power line, and since the power installation won't be filtered or shielded, all hxxx breaks loose.
We had a huge VSD noise issue with an HVAC system installed in a new low-noise(!) building; final solution was to install a three-phase power line filter on the HVAC input AT THE UNIT's INPUT, (first try, they put it at the panel, helped but not a lot). That isolated the noise to the controller and it's shielded connections.
I also now have a VSD on my water pressure controller at home, and it played havoc with our Wifi until I moved the router 40 feet away. I've been told several times that such a system won't affect Wifi, it's built to be tolerant of that; all I can say is, well, it's one heck of a coincidink that the problem went away when we moved the modem, AND the service tech with the ISP was convinced once he saw it happen with his Wifi sniffer; he said that explained several unresolved service calls he'd had, and if he went back to those locations, he now had something new to try. So, it's real.
Sorry, can't offer a magic pill. Distance, and filtering is all I can suggest.
Thanks I will have look at putting a filter on the power cable to the VSD drive. One thing I forgot to mention is that VSD has a single phase power supply. I expect this will not make much difference.
I'd try to keep the sensor as simple as a light barrier or hall effect sensor and run its signal through a long shielded cable to the detached Uno. RS-485 or similar transceivers can improve the signal transmission quality on that line.
For a floating controller you could use a Pro Mini and insert optocouplers into the RX/TX lines before attaching the USB transceiver.
High frequency noise from the VSD it like water spraying from a leaking connection, it gets everywhere.
I suggest the first thing you do is to purchase a small display that can be driven from the UNO allowing the PC to be disconnected. I suggest the 1.3" OLED as they are easy to read with simple for just text. (below is the basic code I use for this display).
Your uno should be in an aluminum (or copper) housing. Could be a cheap aluminum chassis case. Every wire in and out is an antenna. For "every" wire (even power and ground) place a 0.1µf capacitor from the incoming wire to the chassis. Must be right at the entrance of each wire. You can get leaded parts and make the ground connection by a screw or solder lug.
#include <Wire.h>
#include "SSD1306Ascii.h"
#include "SSD1306AsciiWire.h"
#define I2C_ADDRESS 0x3C // alt add = 0x3D
SSD1306AsciiWire oled;
//------------------------------------------------------------------------------
// Setup displays variable names and units.
// We still have to identify the location and length for variable values.
// We should in the future create functions to do the length and position calc.
void setup() {
oled.begin(&SH1106_128x64, I2C_ADDRESS);
oled.setFont(ZevvPeep8x16); // results in 4 lines X 16 characters
oled.clear();
// Fill display so we can see what is being cleared.
oled.println("----------------");
oled.println("----------------");
oled.println("----------------");
oled.println("----------------");
delay(1000);
// (C,R)
oled.SSD1306Ascii::setCursor(0,0);
oled.print("Temp"); // leaves cursor at next char in row.
oled.SSD1306Ascii::setCursor(8*14,0);
oled.print("$F");
oled.clearField(8*4,0,10);
oled.SSD1306Ascii::setCursor(0,2); // note rows are 8 pixels and our font is 16 pixels
oled.print("Humidity"); // leaves cursor at next char in row.
oled.SSD1306Ascii::setCursor(8*15,2);
oled.print("%");
oled.clearField(8*8,2,7);
oled.SSD1306Ascii::setCursor(0,4);
oled.print("Pressure"); // leaves cursor at next char in row.
oled.SSD1306Ascii::setCursor(8*13,4);
oled.print("hPa");
oled.clearField(8*8,4,5);
oled.SSD1306Ascii::setCursor(0,6);
oled.print("IAQ"); // leaves cursor at next char in row.
oled.clearField(8*3,6,13);
}
void loop() {}
Thanks for the advice I have put a filter on the 220v mains incomer to the VSD and that significantly reduced the impact of interference such that the number of counted rotations to the actual rotations was in the order of tens. I then added a screened cable between the sensor and the uno and this seems to seems to have sorted out the problem. Interestingly the cable screening is not earthed and the board is not in a sheilded box and the uno is still connected via the usb.
Thanks your responce I seem to have sort the problem by adding a filter on the mains and a unerathed screened cable between the sensor and uno. If this hadn't of work I would have moved onto your suggestions. I will keep it in mind for the future.