element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Experimenting with Extreme Environments
  • Challenges & Projects
  • Design Challenges
  • Experimenting with Extreme Environments
  • More
  • Cancel
Experimenting with Extreme Environments
Blog Extreme Environment Home Assistance Sensors #3 Home Assistant on Raspberry Pi Compute Module 4 (CM4)
  • Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Experimenting with Extreme Environments to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: fyaocn
  • Date Created: 26 Apr 2024 2:33 AM Date Created
  • Views 649 views
  • Likes 8 likes
  • Comments 1 comment
Related
Recommended

Extreme Environment Home Assistance Sensors #3 Home Assistant on Raspberry Pi Compute Module 4 (CM4)

fyaocn
fyaocn
26 Apr 2024

image

#2 Home Assistant on Raspberry Pi Compute Module 4 (CM4)

For Extreme Environment Home Assistance Sensors


Table of Contents

  • 1. Raspberry Pi Compute Module 4 (CM4) and Compute Module IO board
  • 2. Home Assistant 
  • 3. Getting start
  • 4. Installation
  • 5. Configuration
  • 6. Ready to Go for ESPhome
  • Reference

1. Raspberry Pi Compute Module 4 (CM4) and Compute Module IO board

Raspberry Pi Compute Module 4(CM4) include a high-performance 64-bit quad-core processor,  4GB of RAM, No onboard eMMC, and  SD card interface for SD card, together with Gigabit Ethernet, USB 2.0, dual camera interfaces, and PCIe Gen 2 x1 interface. The CM4 is small in size with same capability of Raspberry Pi 4B. Raspberry Pi Compute Module 4 (CM4) and Raspberry Pi 4B share same Software Image. Therefore they both can switch-off with-ease, only change the SD card in card slot.

The hardware design of CM4 IO board is as follows,

image

The function diagram is as follows,

image

There are special features in CM4 IO board to be used in this experiment,

  • The PSU

The main PSU input (J19) is a 2.1mm DC tip positive +12V input. There is a +12V to +5V DC-DC converter to power the CM4. There is also an on-board +12V to +3.3V DC-DC converter PSU which is only used for the PCIe slot.  the external PSU connect and the FAN connector directly ( J20, +5V, +12V ). Compute Module 4 IO Board is recommended to budget 9W. This can be used to power up auxiliary board in sameIP68 enclosure.

image

  • The RTC

For the Raspberry Pi 4B, the system time shall be set every start-up time via NTP server. The CM4 can solve the problem with this RTC feature if I2C is properly set in software.

image

  • The USB hub

The USB goes into device mode if USB cable is plugged. This shall be taken care of if Host mode is needed.

  • The Ethernet

The POE is possible to power-up the board with RJ45 cable alone.

  • PCIe Gen 2 x1 Slot

The PCIe slot is available for function extension in CM4 while Raspberry Pi occupies this as USB 3.0 hub.

image

image

2. Home Assistant 

Home Assistant Operation System (HAOS) is open source home automation that puts local control and privacy first. Perfect to run on a Raspberry Pi or a local server. In this Experiment on Extreme Environment, both Raspberry Pi Compute Module and Raspberry Pi 4B shall be used for comparation. Other applicable hardware platform such as Home Assistant Green, Home Assistant Yellow are similar platform as Raspberry Pi does. As Installation - Home Assistant (home-assistant.io) shows.

HAOS is perfect in scenery full of sensors, with Automation Integration and smart control. 

3. Getting start

Install Raspberry Pi Image Writer and open it,

image

select hardware, with raspberry Pi, 4

image

choose Operation System (OS) to download and install

image

go to opther specific purpose OS

image

select Home assistant and home automation

image

go to Home Assistant 

image

Select latest Home Assistant OS 12.1

image

then choose storage

image

with detected 32G SD card

image

Press next

image

confirm the selection

image

Press Next to start download and flash the SD card. Download first, it takes a while,

image

Then flash the SD card

image

The the image is verified

image

In the end pop the note with success.

image

If prefer to flash SD card with other tool, go to open source github page for latest release, download it

imageimage

Here is what in the SD card, 

image

4. Installation

Insert the SD card in slot and power the Raspberry Pi Compute Module 4 (CM4) 

Plug in an Ethernet cable and make sure the Raspberry Pi is connected to the same network as your computer.
Connect the DC 12V power supply to start up the device.

image

After a while, access the Home Assistant Installation Interface by web Browse from computer with local address :homeassistant:8123

If there is any errors, power up the Raspberry Pi Compute Module 4 (CM4) again until every thing is right

image

until login page appears

image

create user with new password

image

location selection

image

feedback data if choose to,

image

After HAOS  installed and user login , the HAOS scan local area for compatible devices, such as smart-TV, smart router, smart alarm, etc. 

image

here is the smart alarm founded,

image

press Finish to enter dash board overview, it is done with installation.

image

5. Configuration

Go to Overview

image

The Map Item shows the location of HAOS hub

image

Energy Item shows the energy consumption with supported Smart Meters for electricity, solar panel, natural gas, or portable water, etc.

image

Logbook Item shows the sessions of login or update listed in date.

image

History show the history of HAOS

image

Media Item shows supported media source like music or video

image

To do lists Item shows preset task to do.

image

Go to Home Assistant  sensors or discover and settings,

image

Go to configure sensors discover from here, 

image

Here is detail lists to be configure

image

In development tools , YAML format is used as development tools

image

Logout and login again for clean start,

image

If there is any update of HAOS, this is popup for quick update.

image

Press configurate for TV, select place 

image

Confirm the configuration with submit button

image

Same TV support other Access Protocol, so configure again, 

image

Configure the 3 in One smart alarm clock

image

image

confirm the configure

image

select location

image

Configure the discovered device one by one as listed below, even the power status of raspberry Pi is supervised,

image

go to other tabs for detail information

image

If the TV is power off, red alarm shows that it can not be accessed

image

Go to setting page for configure

image

take the smart alarm  clock as example, The Humidity , temperature value is shown here.

image

Home Assistant cloud is ready, if user information is created already,

image

Automation Task can be put here with ADD Integration,

image

design automation algorithm for smart control

image

all devices list below can be covered in  HAOS,

image

In addon page, no plugin is added now,

image

In setting page more can be edited.

image

go to add addons, more can be added later, in this project, HAOS is addedl

image

Hardware information can be found here,

imageimage

If time permitted, following plugins are ready to install.

imageimage

Take Jupyter lab as example , press install

image

after awhile, it is install and ready to start,

image

New note book for python can be created and debug here,

image

6. Ready to Go for ESPhome

ESPhome is one of the addon for Home Assistance OS, it is easy to use and flexible in programming, more to be explained in blog #4.

Reference

[1]  Extreme Environment Home Assistance Sensors #1 Unboxing Experiment Kit - element14 Community

[2] Buy a Compute Module 4 – Raspberry Pi

[3] Home Assistant (home-assistant.io)

[4] Compute Module 4

[5] Raspberry Pi Compute Module 4 IO Board 

  • Sign in to reply
Parents
  • DAB
    DAB over 1 year ago

    Very good update.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • DAB
    DAB over 1 year ago

    Very good update.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube