I am designing a smart energy monitoring system as my FYP, I have used two pic18f452 microcontrollers to monitor the electric parameters and they are doing it successfully.

now to make it more user friendly, i am thinking to transmit the data which i have on my serial ports to the raspberry and then on an internet server via wifi or ethernet.

please suggest me a way to solve this problem.


The Pi has an available UART port so you could direct the PIC data to that port (pins 8/10 on P1). The Pi is a 3.3V machine so if the PIC is outputting at 5V levels you will need to use a voltage divider on the PIC to Pi line. The Pi to PIC direction should be fine.

See http://elinux.org/RPi_Low-level_peripherals for Pi pin outs and electrical details.

Then you write a C/Python/whatever program to do the rest. Google for tutorials.

| improve this answer | |
  • the microcontrollers transmits two serial frames simultaneously,and since it is a measurement device, i think USB would be must faster as compare to serial, is their a way i can send data to rpi using USB ports ? – RPJ Jul 27 '14 at 13:08
  • You can buy serial to USB bridge hardware. I'd imagine a software only solution would be very complicated. What sort of data rates (bit rate and messages per second) are you talking about? – joan Jul 27 '14 at 13:19

Allot of energy monitors use 433mhz. This is a simple Serial interface 433mhz transciever only and you don't even have to do any code changes! You just connect your serial data UART TX, RX to the TX,RX (crossed), VCC and GND. Then on the Pi/Mac/PC/Arduino you attach another 433 Transceiver or receiver (You can get USB ones) and read UART. Simple and cheap!

enter image description here

As mentioned in the comments be carefull not to buy just the radio, then you have to use a library to encode and decode but thats even cheaper than a Serial Wireless 433mhz embedded.

| improve this answer | |
  • RF transmitters don't quite work that way; you'll need some kind of protocol like Manchester Encoding to have a chance of the receiver picking up anything coherent. – scruss Jul 26 '14 at 6:10
  • Yes, you are correct, I got the radio only. I updated to an embedded transparent serial wireless module, slightly more expensive but if you search around you can get some very cheap ones, especially if you buy in 5, 10 or more. Then all modules receive data from all other that send. Its really easy. – Piotr Kula Jul 26 '14 at 9:50

If you have to interface with multiple microcontrollers (in your post you mention two), you could use I2C. The PIC18F452 and the Pi have built-in support for I2C, which would allow you to talk with multiple PICs on just two wires. It could be a little harder to program if you're not familiar with how I2C works, though.

| improve this answer | |

I do like this for a temperature wireless sensor, with HC-12 433MHz module, 1 USB to my Rpi and 1 UART to a PIC18F13k22, it work well at more than 25m...

| improve this answer | |

Online PIC programming via USB port of a Raspberry Pi https://www.youtube.com/watch?v=S30wVi9RWEs. Programs available in https://www.dropbox.com/s/whwolbzf0cwkkb9/SanUSBrpi.zip

| improve this answer | |
  • 1
    Welcome to Raspberry Pi! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – Steve Robillard Mar 9 '15 at 2:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.