Showing posts with label PIC. Show all posts
Showing posts with label PIC. Show all posts

Tuesday, 31 October 2017

Power control 2-01 - Testing

Power control 2-01 - Testing

Sensors arrived

Finally! The sensors are here. I ordered ACS712T from Aliexpress almost a month ago and yesterday received 10 of them. I quickly soldered the sensors to the adapter board with separately soldered wires for stronger current (up to 5A).

Test Setup

According to ACS712T datasheet the device provides continuous output of instantaneous measurements of current. Also I found out since the resolution is roughly 30mA for a 10bit ADC I will not be able to measure small current. I am still waiting for a single supply opamps, this will help me to expand the current range.

Due to the instantaneous nature of current measurement it would be hard to sample high frequency AC. Since I don't need high precision I decide to use some analogue circuitry to maintain the voltage level. In the datasheet I found the following rectifier circuit.

Since I wanted the full range I omitted the resistors, leaving only the diode and capacitor.

First impressions

After running a small DC motor with the current sensor and rectifier circuit I was able to measure the current. Of course the data was not accurate - I will need to get a formula to adjust for capacitor and diode influence. But the general increase/decrease in current were consistent with the motor's behavior.

Next step will be running an AC load (up to 1A to start with) and plotting the data in real time. Also I will have a power calculation, but first I need to test it with a proper power meter.

Tuesday, 24 October 2017

Data Aquisition Real Time Visualisation

Data Acquisition Real Time Visualization

This is a new sub-project for the future version of Touchscreen Control (2.0). I wont reveal much details about this right now, suffice to say once I have all the components I will start on bringing everything together for testing phase

Setup

After playing with real time audio conversion/visualization in my Digital DI Box project I shifted the focus to slower sampling rate in order to be able to keep up with changing data. USB FTDI drivers are not suitable for 2Mbs continuous data flow and I am not ready yet to write my own USB driver. Instead I decided to use a simpler MC (PIC16F1827) with a reasonable amount of ADC channels to see if web interface is ready for moderate amount of data. I set sampling rate at 100ms, starting with one ADC channel and slowly moving to 5 channels (there will be more, I just ran out of sensors). Right now I get the following info:

  • Potentiometer
  • Potentiometer (inverse)
  • Magnetic sensor
  • Photo cell
  • Temeprature sensor

There was a vibration sensor, but it requires amplification and my opamps need dual power supply. The breadboard is already full and there is not much room for virtual ground and the whole bunch of additional wires.

Results

The web interface was able to produce some nice looking real life graphs. Unfortunately I killed the photo cell - it's sensitivity has dropped a lot after some miswiring. Otherwise the system is doing great. Next step will be to test the timing by gradually reducing the sampling period in order to capture finer detail (as you can see on the screenshot below the mangetometer - black line - is not very smooth when displaying slowly rotating magnetic flux).

Is low level programming still relevant these days?

The levels of abstraction have made the application programming much easier and faster. But everything comes at a price. This is a new ...