I was also very impressed by the nature of System On Chip aspect of the microcontroller PIC16F886, 8K ROM, 384 Bytes RAM . . . The chip would be able to:
- Generate the ultrasound using its PWM.
- Listen to the echo/reflected using its AD in a loop.
- Communicate with other chips via its USART.
- Drive the 4 x 20 characters LCD display controller.
A few weeks after I placed an order online from http://www.futurlec.com/ for the electronic components I would use. The development board was delivered by DHL during the first week of November 2010. I anticipated a lot of stuff for the electronic components I would use. I was abit lucky here. The components reached Mauritius by January 2011, and I had a working bread board for analog part by end of February 2011. Additional components would be sourced on the local market as well as Ebay.
The topology of the devices would be 2 sensorbox and 2 display box. They would be connected using CAT5 cable. The twisted pairs in the CAT5 cable would help immunise the communication against noise. The blue pair would be used for powering the devices with 5V. The transmit of the devices would be on the orange pair and receive on the green pair. In june 2011 I ordered MAX485 transceiver chips on eBay as I wrongly assumed that I could connect the 3 devices Tx to the 1 the one pin of the Rx of the master device.
By August 2011 I had finally installed the devices on the 2 tanks and a display reading in my mother's kitchen. The devices or boxes were successfully talking to each other. But by beginning of November 2011 there were erroneous values being displayed. My mother was complaining that the main tank was empty and the system would still show it was 88% filled. Since then I am still fine tuning the system for more reliable values. I first suspected the transducers had failed but which was the not the case. Needless to say that I got discouraged with the project, spending so much time with it and not knowing what to do next! In December 2011 I made a second PCB layout just for the SensorBox, refer to this post. I even changed the cable between the transducer and the SensorBox from a pair of wires to an audio coaxial cable.
In fact the biggest mistake I made with the circuit is that I forgot to use Bypass Capacitors for the PIC and the Op-Amp MCP6284. Microchip says "With this family of operational amplifiers, the power supply pin (VDD for single-supply) should have a local bypass capacitor (i.e., 0.01 µF to 0.1 µF) within 2 mm for good, high-frequency performance. It also needs a bulk capacitor (i.e., 1 µF or larger) within 100 mm to provide large, slow currents. This bulk capacitor can be shared with nearby analog parts." I suppose same applies to the PIC microcontroller. I have redesigned a third PCB layout in the 1st week of January 2012 which I have to send out for etching. Further to adding these bypass capacitors and a bulk capacitor, I am using the fourth OpAmp in the MCP6284 as a voltage follower which will send its output to the existing OpAmp Non-Inverting amplifier. Other web sites I have read also mention about these ByPass capacitors, like in this site.
The electronic shop doing my etching has ran out of PCB, they have asked me to wait for a week.
No comments:
Post a Comment