# Cajoe Geigercounter + Wemos D1 + ESPEasy

**URL:** <https://community.homey.app/t/cajoe-geigercounter-wemos-d1-espeasy/63753>\
**Category:** Devices\
**Tags:** mqtt\
**Created:** [May 17, 2022, 7:10pm UTC](https://community.homey.app/t/cajoe-geigercounter-wemos-d1-espeasy/63753 "2022-05-17T19:10:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chillout](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/chillout/32/29997_2.png) [@Chillout](https://community.homey.app/u/Chillout)\
**Post date:** [May 17, 2022, 7:10pm UTC](https://community.homey.app/t/cajoe-geigercounter-wemos-d1-espeasy/63753/1 "2022-05-17T19:10:10Z")

</div>

While adding additional sensors to my home, I stumbled across a Cajoe radiation sensor on Aliexpress:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/a/3a851c992972c52b6f876b7c3cec1f09fd32b7f2.jpeg)

It wasn’t too expensive, and the description promised it was easy to connect to an Arduino:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/0/b0792c16dd315e6b298464fc807ab4c4f0647a88.png)

That would mean it wouldn’t be too hard to get data to Homey either!  
After doing some research, I came across this topic on the Home Assistant forums:

> **[Geiger counter with HA integration?](https://community.home-assistant.io/t/geiger-counter-with-ha-integration/107660/12)**
>
> I just set it up with ESPHome and it was very easy! Very basic code and wiring. This is the relevant code part of the ESPHome device, an ESP8266: sensor: - platform: pulse\_counter pin: GPIO4 name: "Geiger Counter" update\_interval:...

People mostly use ESPHome there, but I didn’t want to jump through all the HomeAssistant/ESPHome config hoops. After doing some more research, I came across this topic that spoke about using ESPEasy to interface with the sensor:  
[https://www.letscontrolit.com/forum/viewtopic.php?t=5388](https://www.letscontrolit.com/forum/viewtopic.php?t=5388)

Setting it all up was fairly easy.  
Here are the steps:

1. Install ESPEasy on your Wemos D1 (or other ESP device)
2. Configure ESPEasy as follows:

**Controllers:**  
Home Assistant (openHAB) MQTT. Make sure to select this controller on the devices tab as well, otherwise there will not be any sensor data on the mqtt channel.

**Devices:**

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/b/8b59255a5e8639714c4e6d96936ebb0b273854b3.png)  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/f/0fe0bb018881ba6ffe4990be9bcb727adad8d69f.png)  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/a/c/accdbb87bdbef1c5a441aa14bc7c5400a95d33e4.png)

**Rules:**

```auto
on System#Boot do
 let,1,0 // total number of cpm's
  let,2,1 // number of measurements
endon

On Geiger#Total do
  TaskValueSet 2,1,[Geiger#Total]*60/%unixtime%
endon

On Geiger#Count do
  TaskValueSet 2,2,[Geiger#Count]*6
  Let,1,[var#1]+[Geiger#Count]*6
  TaskValueSet 2,3,[var#1]/[var#2]
  Let,2,[var#2]+1
  TaskValueSet 3,1,[Geiger#Count]*6/151 //calculates the Sievert rate for this specific sensor.
endon

```

These rules make sure the dummy devices get the right values. CPM is the amount of particles captured per minute. The Sievert value is CPM/151 for this specific tube.

1. Hook up the VIN pin of the sensor to D5, 5V to 5V, GND to GND.

2. Setup a virtual device in Homey. I added the Geiger counter as a PM2.5 sensor. This is my only gripe with this install, because it doesn’t show the right unit, since Homey doesn’t know any radiation units.

3. Add a flow to update the virtual device sensor value whenever a message is received on the mqtt topic.

4. Enjoy knowing whether or not a disaster has happened!  

The hardware (don’t mind the piece of insulation tape underneath the ESP. 😅 )

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/9/d9551beb4a577af5f4e8ee90982eb369c6362157.jpeg)

---

<div class="post-metadata">

**Author:** ![Yov](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/yov/32/33840_2.png) [@Yov](https://community.homey.app/u/Yov)\
**Post date:** [September 16, 2023, 9:37am UTC](https://community.homey.app/t/cajoe-geigercounter-wemos-d1-espeasy/63753/2 "2023-09-16T09:37:46Z")

</div>

Great work! Any chance on testing out if it really works? (Without simulating a real nuclear disaster 😅) also you got a link to where you ordered from on ali? And are you able to use this data on to setting an alert via homey?

---

<div class="post-metadata">

**Author:** ![Yov](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/yov/32/33840_2.png) [@Yov](https://community.homey.app/u/Yov)\
**Post date:** [October 2, 2023, 8:05am UTC](https://community.homey.app/t/cajoe-geigercounter-wemos-d1-espeasy/63753/3 "2023-10-02T08:05:50Z")

</div>

Got it to work, it was a nice project to learn how mqtt works! 🙂
