Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC data logger

Status
Not open for further replies.
Yes, all are on the same frequency - I allocate each remote unit a single letter code A, B, C or D, and send the code from the PC followed by a simple single letter instruction (in this case 'a'). So the PC sends out 'Aa' (no Cr/Lf) and waits for the reply (the reply is prefixed with A as well), then it sends out 'Ba' and so on. So it's dead simple, you can also send 'Av' and get a version ID back from the remote unit as well - while I was initially playing with them I used considerably more commands, for setting an a RTC, reading data from an on-board FRAM etc. but for this specific project none of that was needed.
 
hi,
I am using the USB to Rs232 cable assembly from Amazon for connection between the HC12 and PC.
Image A05 is a test TX/RX between the HC12 and PC, using a VBasic GUI.
The intention is to get the Remote and Base units debugged using VBasic before conversion to Lazarus.

E
 

Attachments

  • A04.gif
    A04.gif
    50.2 KB · Views: 259
  • A05.gif
    A05.gif
    13.7 KB · Views: 257
hi Nigel,
A little extra info on the HC12 transceivers that others may find useful.

Using a HC12 with the supplied spiral wire antenna,
RS232 settings: 9600 baud, N81
The HC12 has the recommended 1N4001 diode from the +5V supply to HC12, giving 4.3v at Vin.

Transmitting temperature and humidity from a DHT22 sensor at one second rate.

Transmitter located indoors and the Receiver located in a garden shed.
So the TX signal has to pass thru 3 brick walls, 10 metres of free space and the shed.

Started with AT+Px = 8 , [20dBm], good strong signal at the RX
Stepping down the Px value in increments from 8 to 3
At Px=3 [5dBm] the RX, the signal would be sometimes be missed, depending upon movement of the RX PCB.

E

BTW: hope you don't mind me adding this to your Thread.:)
 
BTW: hope you don't mind me adding this to your Thread.:)

Not at all, good to know :D

Incidentally, I've had two sensors running off batteries (6xAA), and the humidity readings massively increase as the batteries get towards the end of their life - I'm currently adding a couple of resistors to an A2D pin to monitor the battery voltages as well.
 
Have you considered a step up psu like this,? 5 off for £1.0 [Amazon]
Runs off 3 * AA battery NiCd or Recharge.

E
 

Attachments

  • A03.gif
    A03.gif
    45.3 KB · Views: 260
hi Nigel,
The HC12's are working fine, image posted showing the results using VB5.
The image shows the data from the Remote displayed on a PC,, Temp,RH%, 2 ADC,s a PIR bit and LDR bit, together with 4 PORT bits.
The data is time tagged and can be logged by the VB5 program.
As you may recall I had NRF radio's for this set up, but I could not get the required radio range.
The final stage is to modify my receiver for SD card onboard logging.
I am using 18F4520's as the SD card program needs at least 1K free RAM.

For info only, the HC12 will work OK with the 5 wires extended to 1.5mtrs, as do the USB/RS232 modules.

Eric
 

Attachments

  • A05 Jul. 16 12.44.gif
    A05 Jul. 16 12.44.gif
    35 KB · Views: 245
So, that sensor runs on the i2c?

What abt i2c comms (or RS232) between a PIC and the ESP826612e..so that I can get bidirectional comms to the PIC via the internet and an android app?

Doable?
 
I also have a DHT22 but I don't have much faith in it's humidity readings, it's used to control a dehumidifier who's internal sensor appears to be useless. The DHT22 however gives readings that depart by up to 20% from a simple commercial battery powered temperature/humidity LCD display the difference being greatest in the mornings, of course with only two devices I don't really know which is wrong except the DHT22 takes a long time to settle down after power up and also if you blow on it etc. Anybody else compared these with a reference device of some kind ?
 
So, that sensor runs on the i2c?

No, it uses it's own system - nothing like I2C.

What abt i2c comms (or RS232) between a PIC and the ESP826612e..so that I can get bidirectional comms to the PIC via the internet and an android app?

Doable?

Depends what you mean by 'comms'?, as far as I'm aware you can't just make a simple serial connection from PIC to Phone, via the Internet?.

As far as I'm aware (and what I'm playing with) what you do is upload the data to a MYSQL database using PHP, and POST or GET commands.
Or you can run a webserver directly on the ESP, and access it via a browser on the phone.
 
My current project* uses a HIH6030 (I2C) Temperature and RH sensor , claims to be 4.5% ... I have no means of knowing !
( * PIC24 will water my allotment green house tomatoes and collect a days data and TX via HC-12 ).
 
Last edited:

Attachments

  • A03.gif
    A03.gif
    34.4 KB · Views: 236
  • A04.gif
    A04.gif
    30.1 KB · Views: 231
Last edited:
Check if you have a local site page
Thanks for that Eric , the site said 50% RH the sensor on my desk said 54% , ( near enough for my use) must be my heavy breathing...
NG Thanks for the posts on this subject.
 
Hi,
I'm playing with similar modules. My first tests are without a control PIC, so I have a switch as a PTT. I've tried sending data through one and I'm receiving it with a second radio.

If I want it connected to a device sending data 1/sec, without a PIC, is it correct that I would need to keep the PTT in TX mode. In my mind, this doesn't seem 'good', so am I also correct that I must have a PIC switching PTT on/off to use them in this way?
Camerart.
 
I'm not really sure what you mean by PTT?, you just send serial data (5V RS232) to the module, and it sends it out to the other module(s).

What kind of data are you trying to send, and why no processor?.
 
I'm not really sure what you mean by PTT?, you just send serial data (5V RS232) to the module, and it sends it out to the other module(s).

What kind of data are you trying to send, and why no processor?.

Hi N,
(PTT push to talk, SEND/RECEIVE)
I was trying to make the minimum set-up for sending data, from a device. E,g, sending GPS from a moving object, back to BASE. This afternoon, I did just that, and it dawned on me that I had to have the carrier signal on at all times waiting for the Data signal (Not good) So I've answered my own question! I have to have a PIC that switches SEND on 'send data', then switch off till next data.
Thanks, C.
 
Hi N,
(PTT push to talk, SEND/RECEIVE)

I know what PTT stands for, it just doesn't apply to these RS232 radio modules :D

I was trying to make the minimum set-up for sending data, from a device. E,g, sending GPS from a moving object, back to BASE. This afternoon, I did just that, and it dawned on me that I had to have the carrier signal on at all times waiting for the Data signal (Not good) So I've answered my own question! I have to have a PIC that switches SEND on 'send data', then switch off till next data.
Thanks, C.

I'm still totally baffled, what modules are you using?, presumably something completely different to what I'm using?.
 
I know what PTT stands for, it just doesn't apply to these RS232 radio modules :D



I'm still totally baffled, what modules are you using?, presumably something completely different to what I'm using?.

Hi Nigel,
Sorry, I searched for threads using similar radio modules to mine, and probably clicked on yours by mistake. The one I use is a radio module DRA818 and not a Wifi module. Anyway, I have answered my question, by tests earlier today.
Cheers, Camerart.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top