atc1441 / ATC_MiThermometer

Custom firmware for the Xiaomi Thermometer LYWSD03MMC and Telink Flasher via USB to Serial converter
2.78k stars 466 forks source link

PCB pinout / GPIO control #122

Open vortigont opened 3 years ago

vortigont commented 3 years ago

Hi! Maybe someone already poked through the P-pads on PCB, is there any pinout available? Wonder if this tiny could do more than just sending temp/humi? Something like gpio control, door/window sensor, attaching some other i2c sensors maybe? The SDK is quite brief with not much of the examples/libs available to play with.

atc1441 commented 3 years ago

Hey.

Yes i have a paper at home with most of the pinout. I can post it later if i not forget it

It is definitely possible to add aditional hardware.

Just as info not much pins are free. 3 or 4 i think

vortigont commented 3 years ago

Thanks, @atc1441! Would be nice to have pinout available in repo. Have an idea to use it as water volume counter, all it need is an interrupt-driven event for a single pin open/close.

pvvx commented 3 years ago

Add to the description that the Sensirion SHTC3 sensor is used. https://www.sensirion.com/en/environmental-sensors/humidity-sensors/digital-humidity-sensor-shtc3-our-new-standard-for-consumer-electronics/

agmlego commented 3 years ago

It is unclear how to connect to the board for UART flashing; there seems to be a wire missing from the Mi_SWS_Connection.jpg image. A pinout would be helpful!

pvvx commented 3 years ago

marking PCB image Only pins PB6, PC2, PC3 are used

agmlego commented 3 years ago

Danke so much!

On Thu, Dec 17, 2020, 22:15 Victor notifications@github.com wrote:

marking PCB [image: image] https://user-images.githubusercontent.com/12629515/102570353-375f6d80-40f8-11eb-91c9-c885b08b1a65.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/atc1441/ATC_MiThermometer/issues/122#issuecomment-747841685, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAO7FJ4LDNQ7SBMAIVLZT3SVLCOTANCNFSM4UVAQE7A .

agmlego commented 3 years ago

Actually, no, now I am more confused. The image for flashing shows a wire connected to P14, which I guess is in the SWS position on the mux. Is there no RX needed for flashing?

atc1441 commented 3 years ago

My image was for a non Transceive flasher but now the flasher is updated so it can also read from the TLSR8251 thanks to Victor

You can use this pinout https://github.com/pvvx/TlsrComSwireWriter

pvvx commented 3 years ago

BoardPinout https://github.com/pvvx/ATC_MiThermometer/tree/master/BoardPinout

atc1441 commented 3 years ago

@pvvx Victor to the sensor, inside of the Thermometer is actually an SHTV3 but the SHTC3 is very similar and can be used.

agmlego commented 3 years ago

Oh! OK, thanks! I got it.

pvvx commented 3 years ago

Actually, no, now I am more confused. The image for flashing shows a wire connected to P14, which I guess is in the SWS position on the mux. Is there no RX needed for flashing?

There are two options. With and without reading. Only USB-COM PL-2303HX or CH340 is suitable for reading. Not FTDI! PL-2303HX is preferred.

pvvx commented 3 years ago

@pvvx Victor to the sensor, inside of the Thermometer is actually an SHTV3 but the SHTC3 is very similar and can be used.

Datasheet on SHTV3? SHTC3 completely matches, including timing and electrical specifications.

Datasheet:

Current board and my test:

pvvx commented 3 years ago

image image image Copy from https://www.pepper.pl/comments/permalink/4397657

atc1441 commented 3 years ago

A datasheet is not available for the SHTV3 the sensor works exactly the same so as mentioned the SHTC3 datasheet can be used.

pvvx commented 3 years ago

image

OnOff :)

atc1441 commented 3 years ago

Love it!

pvvx commented 3 years ago

Alarm button (TTP233D-HA6 TonTouchTM', at low power mode typical 2.5uA, maximum 5uA )? :) http://www.tontek.com.tw/uploads/product/120/TTP233D-HA6_V1.1_EN.pdf